Next: , Previous: Control Sequences, Up: Virtual Terminal


11.2 Input Translation

In order to do a full VT100 emulation screen has to detect that a sequence of characters in the input stream was generated by a keypress on the user's keyboard and insert the VT100 style escape sequence. Screen has a very flexible way of doing this by making it possible to map arbitrary commands on arbitrary sequences of characters. For standard VT100 emulation the command will always insert a string in the input buffer of the window (see also command stuff, see Paste). Because the sequences generated by a keypress can change after a reattach from a different terminal type, it is possible to bind commands to the termcap name of the keys. Screen will insert the correct binding after each reattach. See Bindkey for further details on the syntax and examples.

Here is the table of the default key bindings. (A) means that the command is executed if the keyboard is switched into application mode.

     
     Key name        Termcap name    Command
     -----------------------------------------------------
     Cursor up            ku         stuff \033[A
                                     stuff \033OA      (A)
     Cursor down          kd         stuff \033[B
                                     stuff \033OB      (A)
     Cursor right         kr         stuff \033[C
                                     stuff \033OC      (A)
     Cursor left          kl         stuff \033[D
                                     stuff \033OD      (A)
     Function key 0       k0         stuff \033[10~
     Function key 1       k1         stuff \033OP
     Function key 2       k2         stuff \033OQ
     Function key 3       k3         stuff \033OR
     Function key 4       k4         stuff \033OS
     Function key 5       k5         stuff \033[15~
     Function key 6       k6         stuff \033[17~
     Function key 7       k7         stuff \033[18~
     Function key 8       k8         stuff \033[19~
     Function key 9       k9         stuff \033[20~
     Function key 10      k;         stuff \033[21~
     Function key 11      F1         stuff \033[23~
     Function key 12      F2         stuff \033[24~
     Home                 kh         stuff \033[1~
     End                  kH         stuff \033[4~
     Insert               kI         stuff \033[2~
     Delete               kD         stuff \033[3~
     Page up              kP         stuff \033[5~
     Page down            kN         stuff \033[6~
     Keypad 0             f0         stuff 0
                                     stuff \033Op      (A)
     Keypad 1             f1         stuff 1
                                     stuff \033Oq      (A)
     Keypad 2             f2         stuff 2
                                     stuff \033Or      (A)
     Keypad 3             f3         stuff 3
                                     stuff \033Os      (A)
     Keypad 4             f4         stuff 4
                                     stuff \033Ot      (A)
     Keypad 5             f5         stuff 5
                                     stuff \033Ou      (A)
     Keypad 6             f6         stuff 6
                                     stuff \033Ov      (A)
     Keypad 7             f7         stuff 7
                                     stuff \033Ow      (A)
     Keypad 8             f8         stuff 8
                                     stuff \033Ox      (A)
     Keypad 9             f9         stuff 9
                                     stuff \033Oy      (A)
     Keypad +             f+         stuff +
                                     stuff \033Ok      (A)
     Keypad -             f-         stuff -
                                     stuff \033Om      (A)
     Keypad *             f*         stuff *
                                     stuff \033Oj      (A)
     Keypad /             f/         stuff /
                                     stuff \033Oo      (A)
     Keypad =             fq         stuff =
                                     stuff \033OX      (A)
     Keypad .             f.         stuff .
                                     stuff \033On      (A)
     Keypad ,             f,         stuff ,
                                     stuff \033Ol      (A)
     Keypad enter         fe         stuff \015
                                     stuff \033OM      (A)