The include file keycode.h¶
This file contains the mnemonic definitions of the keys defined in Section #5 (“Sent by” Sequences) of the terminal parameter file.
The function keycode(0) returns a negative number which is the complement of the terminal parameter file entry number corresponding to the last key pressed, provided that the key is recognised as one of those defined in “Sent by” Sequences. The inchar(0) function works identically.
The function keycode(1) returns immediately with a positive integer which indicates the key that was pressed to exit the last dialog or input command. The value returned is the entry number in the terminal parameter file which corresponds to the recognised key.
The definitions and the numbers they represent are listed below:
Unshifted function keys |
Shifted function keys |
KEY_F1 1 |
KEY_SF1 17 |
KEY_F2 2 |
KEY_SF2 18 |
KEY_F3 3 |
KEY_SF3 19 |
KEY_F4 4 |
KEY_SF4 20 |
KEY_F5 5 |
KEY_SF5 21 |
KEY_F6 6 |
KEY_SF6 22 |
KEY_F7 7 |
KEY_SF7 23 |
KEY_F8 8 |
KEY_SF8 24 |
KEY_F9 9 |
KEY_SF9 25 |
KEY_F10 10 |
KEY_SF10 26 |
KEY_F11 11 |
KEY_SF11 27 |
KEY_F12 12 |
KEY_SF12 28 |
KEY_F13 13 |
KEY_SF13 29 |
KEY_F14 14 |
KEY_SF14 30 |
KEY_F15 15 |
KEY_SF15 31 |
KEY_F16 16 |
KEY_SF16 32 |
KEY_BS |
33 |
Backspace |
KEY_RESET |
46 |
Reset field |
KEY_LA |
34 |
Left arrow |
KEY_REBUILD |
47 |
Rebuild screen |
KEY_RA |
35 |
Right arrow |
KEY_DEL_CHAR |
48 |
Delete character |
KEY_UA |
36 |
Up arrow |
KEY_INS_CHAR |
49 |
Insert line above |
KEY_DA |
37 |
Down arrow |
KEY_DEL_LINE |
50 |
Delete line |
KEY_HOME |
38 |
Home |
KEY_SPLIT |
51 |
Split line |
KEY_END |
39 |
End |
KEY_JOIN |
52 |
Join lines |
KEY_RETURN |
40 |
Return/Enter |
KEY_SCRUP |
53 |
Scroll up |
KEY_ENTER |
40 |
Return/Enter |
KEY_SCRDN |
54 |
Scroll down |
KEY_TAB |
41 |
Tab |
KEY_PGUP |
55 |
Page up |
KEY_BTAB |
42 |
Backtab |
KEY_PGDN |
56 |
Page down |
KEY_ABORT |
43 |
Cancel |
KEY_EEOF |
57 |
Erase to end of field |
KEY_ESC |
44 |
Escape |
|||
KEY_INSMODE |
45 |
Toggle mode (insert/overtype) |
RELATED TOPICS |