KCML key codes
The KEYIN function can return either regular keys corresponding to the normal keyboard characters in the terminals code page or function keys for special keys used for editing. The distinction is blurred by the fact that keys like RETURN, BACKSPACE and keys invoked with CTRL are all considered to be regular keys. However such special keys are all between HEX(00) and HEX(1F). As KCML5 supports the 8 bit ANSI Latin 1 code page by default the regular keys can have any value above HEX(20) and may be greater than HEX(80) in some locales e.g. HEX(F6) for Ö on a German keyboard.
KCML virtual key coding allows for up to 32 numbered function keys (HEX(00) to HEX(1F). On Kclient with a 12 key keyboard to get all of these keys requires the use of SHIFT and CTRL.
Function keys also include some special keys for word processing no longer found on modern keyboards. The editing function keys are coded thus
| Code | TERMINFO
Keyword |
Explanation |
|---|---|---|
| HEX(42) | prev | |
| HEX(43) | next | |
| HEX(4A) | insert | |
| HEX(49) | delete | |
| HEX(46) | north | |
| HEX(45) | south | |
| HEX(4C) | east | |
| HEX(4D) | west | |
| HEX(4F) | dectab | Obsolete, often CTRL-T |
| HEX(48) | pferase | Clears rest of the line, usually CTRL-E |
| HEX(50) | shiftcancel | Usually SHIFT-HOME |
| HEX(52) | shiftprev | |
| HEX(53) | shiftnext | |
| HEX(5A) | shiftinsert | |
| HEX(59) | shiftdelete | |
| HEX(56) | shiftnorth | |
| HEX(55) | shiftsouth | |
| HEX(5C) | shifteast | |
| HEX(5D) | shiftwest | |
| HEX(5F) | recall | Obsolete |
| HEX(61) | Autoinsert | CTRL-A |
| HEX(62) | Paste | CTRL-V |
| HEX(63) | Mark | CTRL-K |
| HEX(7B) | cuatab | This is sent by the TAB key in CUA mode |
| HEX(7C) | gl | usually CTRL-G |
| HEX(7D) | shiftgl | usually CTRL-Z |
| HEX(7E) | tab | This is actually sent by SHIFT TAB in CUA mode |
| HEX(7F) | shifttab | This is sent by the Esc key in CUA mode and SHIFT TAB key otherwise. |
| HEX(F0) | Cancel | Home |
Kclient operates in CUA mode by default though it is possible to change the TERMINFO database entry for it to revert to the KCML3 mode. In this mode TAB behaves differently and the Esc key sends HEX(7F) while SHIFT TAB sends what used to be TAB i.e. HEX(7E). A new HEX(7B) key is sent by TAB.
Certain keys were used by the old pre-KCML4 editor which are ambiguous with an 8 bit code page.
| Code | TERMINFO
Keyword |
Explanation |
|---|---|---|
| HEX(81) | clear | |
| HEX(82) | execute | CTRL-X |
| HEX(84) | continue | CTRL-F |
| HEX(A1) | load | |
| HEX(E5) | shifterase | CTRL-BACKSPACE |
The mouse in KClient can be sensed using KEYIN when it will send the following function keys
| Left Click | Left Double Click | Left Drag | Right Click | Right Double Click | Right Drag |
|---|---|---|---|---|---|
| 0xF1 at DOWN event. 0xF2 at UP event. | 0xF1 at DOWN event. 0xF2 at UP event. Followed by 0xF3. | 0xF1 at DOWN event. 0xF7 while dragging. 0xF2 at UP event. | 0xF4 at DOWN event. 0xF5 at UP event. | 0xF4 at DOWN event. 0xF5 at UP event. Followed by 0xF6. | 0xF4 at DOWN event. 0xF7 while dragging. 0xF5 at UP event. |