decoding function keys

Tim Tsai it1 at ra.MsState.Edu
Thu Dec 13 15:29:28 AEST 1990


I've been writing a small routine to decode the keyboard cursor keys
as an addition to an editor (dte).  Since the editor didn't use the curses
package, I had to decode the multi-character keys myself.  Anyway, I noticed
the sequence for key_up on a vt102 terminal is ESC-OA, but my terminal
program (NCSA Telnet for the PC) sends out ESC-[A.  Why the difference?
VI seems to recognize both format.  Is it safe to replace the 'O' with '[',
and vice versa?  Lastly, does this behavior exist only on VT* terminals?
Thanks in advance for any help..

Environment: Sun OS 4.1 using the SYS V compiler.

-- 
  Sometimes I think the surest sign that intelligent life exists elsewhere
  in the universe is that none of it has tried to contact us.
                                                                  <Calvin>



More information about the Comp.unix.questions mailing list