Go to the first, previous, next, last section, table of contents.


Keypad and Function Keys

Many terminals have arrow and function keys that transmit specific character sequences to the computer. Since the precise sequences used depend on the terminal, termcap defines capabilities used to say what the sequences are. Unlike most termcap string-valued capabilities, these are not strings of commands to be sent to the terminal, rather strings that are received from the terminal.

Programs that expect to use keypad keys should check, initially, for a `ks' capability and send it, to make the keypad actually transmit. Such programs should also send the `ke' string when exiting.

`ks'
String of commands to make the keypad keys transmit. If this capability is not provided, but the others in this section are, programs may assume that the keypad keys always transmit.
`ke'
String of commands to make the keypad keys work locally. This capability is provided only if `ks' is.
`kl'
String of input characters sent by typing the left-arrow key. If this capability is missing, you cannot expect the terminal to have a left-arrow key that transmits anything to the computer.
`kr'
String of input characters sent by typing the right-arrow key.
`ku'
String of input characters sent by typing the up-arrow key.
`kd'
String of input characters sent by typing the down-arrow key.
`kh'
String of input characters sent by typing the "home-position" key.
`K1' ... `K5'
Strings of input characters sent by the five other keys in a 3-by-3 array that includes the arrow keys, if the keyboard has such a 3-by-3 array. Note that one of these keys may be the "home-position" key, in which case one of these capabilities will have the same value as the `kh' key.
`k0'
String of input characters sent by function key 10 (or 0, if the terminal has one labeled 0).
`k1' ... `k9'
Strings of input characters sent by function keys 1 through 9, provided for those function keys that exist.
`kn'
Number: the number of numbered function keys, if there are more than 10.
`l0' ... `l9'
Strings which are the labels appearing on the keyboard on the keys described by the capabilities `k0' ... `l9'. These capabilities should be left undefined if the labels are `f0' or `f10' and `f1' ... `f9'.
`kH'
String of input characters sent by the "home down" key, if there is one.
`kb'
String of input characters sent by the "backspace" key, if there is one.
`ka'
String of input characters sent by the "clear all tabs" key, if there is one.
`kt'
String of input characters sent by the "clear tab stop this column" key, if there is one.
`kC'
String of input characters sent by the "clear screen" key, if there is one.
`kD'
String of input characters sent by the "delete character" key, if there is one.
`kL'
String of input characters sent by the "delete line" key, if there is one.
`kM'
String of input characters sent by the "exit insert mode" key, if there is one.
`kE'
String of input characters sent by the "clear to end of line" key, if there is one.
`kS'
String of input characters sent by the "clear to end of screen" key, if there is one.
`kI'
String of input characters sent by the "insert character" or "enter insert mode" key, if there is one.
`kA'
String of input characters sent by the "insert line" key, if there is one.
`kN'
String of input characters sent by the "next page" key, if there is one.
`kP'
String of input characters sent by the "previous page" key, if there is one.
`kF'
String of input characters sent by the "scroll forward" key, if there is one.
`kR'
String of input characters sent by the "scroll reverse" key, if there is one.
`kT'
String of input characters sent by the "set tab stop in this column" key, if there is one.
`ko'
String listing the other function keys the terminal has. This is a very obsolete way of describing the same information found in the `kH' ... `kT' keys. The string contains a list of two-character termcap capability names, separated by commas. The meaning is that for each capability name listed, the terminal has a key which sends the string which is the value of that capability. For example, the value `:ko=cl,ll,sf,sr:' says that the terminal has four function keys which mean "clear screen", "home down", "scroll forward" and "scroll reverse".


Go to the first, previous, next, last section, table of contents.