Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Telepathy Communications Library - <b>tp_escseq()</b> - return last escape sequence http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
   tp_escseq() - return last escape sequence

   cSeq := tp_escseq()

   Returns     Escape sequence.

   When called from within a terminal emulator's exception handler, this
   function returns the last escape sequence received by the emulator.
   It can be used on receiving the TTY_ESCSEQ (unrecognized escape
   sequence) message, to allow the exception handler to process escape
   sequences which are not processed by the emulator itself.

   Example:

       #include "telepath.ch"

       // Terminal emulator exception handler for VT102
       function TermException(nCode, nParam)
           local cEsc
           do case
           ...
           case nCode == TTY_ESCSEQ
               cEsc := tp_escseq()
               do case
               case cEsc == chr(27)+"[?1h" // Set cursor key mode
                   lCursorKeys := .T.
               case cEsc == chr(27)+"[?1l" // Reset cursor key mode
                   lCursorKeys := .F.
               endcase
           ...
           endcase
           return 0

See Also: Terminal Emulators

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson