<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>
Date   : Thu, 04 Nov 1982009:29:00-PST
From   : bridger@Rand-Unix
Subject: Catching function key sequences

       My bios CONIN has an option to enter a countdown loop when an ESC is
received.  If the next char is received within that time, it assumes both
the escape and the follow-on character were sent by a function key.  It then
discards the ESC and sets the high bit of the follow-on character to signal
the application program.  If it timesout without receiving anything, the 
ESC is presumed to have been typed as the escape key and is returned.
       You could have your editor patch in its own CONIN to do this while
it's running, then restore the bios CONIN on exit from the editor.
       The timing constant is based on the CPU speed and the baud rate for
the terminal channel and presumes that the follow-on character will be sent
by the terminal's ROM as soon as the baudrate permits.
       Let me know if you pursue this.  On reading Roger Long's message,
I see that this technique may need to be extended another character for
the 3-character sequences from the H-19 alternate keypad.
       A useful feature of this approach is that it allows the editor
to distinguish between ESC-char sent as separate keystrokes, and a function
key that transmits the same sequence.  This permits binding the function keys
to anything without conflicting with bindings chosen for the separate
keystroke commands.
                               bridger.
<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>