Table of Keys

The following tables list all of the keys that can be redefined. The tables list the key's full name, its two-character name (called the key code), and the corresponding key used on a Windows keyboard (not all keys listed can be redefined under Windows; see Note below). The key code is used in the terminal database file on UNIX and VMS systems to identify the corresponding key-sequence.

Note: On Windows systems, the alt key sequences, PrtSrcn, and F10 keys are directly handled by Windows and cannot be referenced in COBOL. A list of additional keys that can be redefined in Windows environments follows the table below.
Key Key Code

(terminal db file)    



Host's Backspace ZB BkSp
Host's Line-Kill ZK -
Cntrl-A - Cntrl-Z ^A - ^Z Ctl A-Z
Escape ^[ Esc
Control-\ ^\ Ctl-\
Control-] ^] Ctl-]
Control-^ ^^ Ctl-^
Control-_ ^_ Ctl-_
DEL 127 Ctl-BkSp
F1 - F10 k1 - k0 F1 - F10
F11 - F20 K1 - K0 Shft F1 - F10
Down Arrow kd Down
Home kh Home
Left Arrow kl Left
Right Arrow kr Right
Up Arrow ku Up
Insert Line kA Ctl-Ins
Tab Left kB Shft-Tab
Clear-to-End     kE Ctl-End
Delete Line kL Ctl-Del
Page Down kN PgDn
Page Up kP PgUp
Cancel Kc -
Next Paragraph Kd Ctl-Down
Word Left Kl Ctl-Left
Word Right Kr Ctl-Right
Previous Paragraph Ku Ctl-Up
Exit Kx -
Attention KA -
Bottom KB Ctl-PgDn
Clear KC Ctl-Home
Command (Do) KD -
End KE End
Find KF -
Insert Character KI Ins
Page Left KL -
Mark (Select) KM -
Print KP -
Page Right KR -
Send KS -
Top KT Ctl-PgUp
Save KV -
Delete Character KX StateStateDel
Help K? -

keys 1 - 10

(1-6 on Windows)

U1 - U0

(U1-6 on Windows)

F11-F12; Shft-F11-F12; Ctl-F11-F12

keys 11-20

A1 - A0 Ctl-1 - Ctl-0

The following table lists mouse-action keys that can be referenced by a KEYSTROKE entry; this table has meaning only for graphical systems such as Windows. The table lists the mouse action, the corresponding key code, and the default exception value returned. See Using the Mouse in User Interface Programming for details on mouse handling.

Action Key Code Exception Value
Mouse moved Mv 80
Left button pushed Ml 81
Left button released ML 82
Left button double-clicked M1 83
Middle button pushed Mm 84
Middle button released MM 85
Middle button double-clicked M2 86
Right button pushed Mr 87
Right button released MR 88
Right button double-clicked M3 89

The Host's Backspace and Line-Kill keys are not identified in the terminal database file. They are defined, instead, at the operating system level. The Backspace key is the key used to back up while you are typing command lines (usually either backspace or delete). The Line-Kill key is the one that is used to cancel an entire command line.

Control keys (Control plus another key) are not defined in the terminal database file. They are directly mapped by the runtime system to the corresponding control-key ASCII value. They can be referred to by either their ASCII value or by the key code listed. The DEL key does not have a key code; it can be referred to only by its ASCII value (127).

Some keys may have more than one name. When this occurs, the names have the following precedence:

  1. Host name
  2. Terminal database file name
  3. Control-key name (if applicable)

For example, if a terminal whose left arrow key produces a Control-H is being used, and Control-H is the system's backspace key, that key would be treated as a Host's Backspace key (ZB). If the host's backspace were redefined (by operating system command) to be some other key, then this key would be considered a Left Arrow key (kl). It would be considered a Control-H (^H) only if the terminal database file were edited and the kl definition changed or removed.