3 Transmitted Codes

3.1 General

This chapter describes the codes that the terminal sends to a program. The chapter assumes that you are familiar with the character encoding concepts described in Chapter 2.

Key codes generated in VT52 mode are listed if they differ from those generated in the ANSI-compatible (VT200 and VT100) modes.

The terminal can use 15 different national keyboards. This chapter describes significant differences among the keyboards.

3.2 Keyboard Codes

The terminal keyboard (Figure 3-1) consists of a main keypad, an editing keypad, an auxiliary keypad, and the top-row function keys.

3.2.1 Main Keypad

The main keypad consists of standard keys (used to generate letters, numbers, and symbols) and function keys (used to generate special function codes).

3.2.1.1 Standard Keys

The standard keys generate alphanumeric characters, either singly or in combination with other keys.

On the North American keyboard, the standard keys show only ASCII characters and generate only ASCII codes. There are no DEC supplemental characters among the standard keys. This is a special case, since most keyboards have some standard keys that generate DEC supplemental characters as well as ASCII characters.

The standard-key patterns vary among keyboards. Some graphic characters (either special symbols or characters with diacritical marks) may or may not be available as standard keys on particular keyboards. However, you can create any DEC multinational graphic character that is not available on a standard key, by typing a valid compose sequence.

Regardless of which keyboard you use and how you create a graphic character, each character is represented by a unique code. The code is based on the character's position in the code table. You can use all GL characters in both 7-bit (VT52 mode, VT100 mode, or 7-bit host line) and 8-bit (VT200 mode, 8-bit host line) environments. You can only use GR characters in an 8-bit environment.

All keyboards (except the North American Keyboard) have one or more standard keys that send different graphic characters (and corresponding codes). The graphic character sent depends on whether you selected "Typewriter Keys" or "Data Processing Keys" in the Keyboard Set-Up screen. (See Figure 3-2 for an example).

All keys affected by "Typewriter Keys" or "Data Processing Keys" have more than two characters shown on their keycaps. The key sends the character on the right side of the keycap when you select "Data Processing Keys", and the character on the left side of the keycap when you select "Typewriter Keys". You can select either shifted (upper) or unshifted (lower) character codes for these keys in the same way as for other nonalphabetic keys.

3.2.1.2 Function Keys

This section describes the main keypad function keys. The column/row notation used in the descriptions refers to Table 2-1.

Key Function
<X] The <X] (Delete) key sends a DEL character (7/15).
Tab The Tab key sends an HT character (0/9).
Return The Return key sends either a CR character (0/13) or a CR character (0/13) and an LF character (0/10), depending on the set/reset state of line feed/new line mode (LNM). (See Chapter 4).
Ctrl The Ctrl key alone does not send a code. It is always used in combination with another key to send a control code.
Lock The Lock key alone does not send a code. It is used in combination with the "Caps Lock" and "Shift Lock" field selected in the Keyboard Set-Up screen. Lock sets or clears the "Caps Lock" (or "Shift Lock") state.
Shift
(2 keys)
The Shift key alone does not send a code. It is used in combination with other standard keys to generate uppercase characters. Shift is also used in combination with nonalphabetic keys to send the top character shown on those keys.
Space bar The space bar sends an SP character (2/0).
Compose Character The Compose Character key does not send a code. Pressing Compose Character starts a compose sequence, which is used to create characters that cannot be typed directly from the keyboard.

3.2.2 Editing Keypad

The editing keypad includes editing keys and cursor control keys. Table 3-1 defines the codes generated by the editing keys, and Table 3-2 defines the codes sent by the cursor control keys.

3.2.3 Auxiliary Keypad

The characters sent by the auxiliary keypad keys depend on the setting of two features, the operating mode (ANSI or VT52) and the keypad (application or numeric) features. The application keypad feature is usually selected only by the computer, but can be selected in the General Set-Up screen. See Chapter 4 for more information about keypad character selection.

Table 3-3 lists the character codes generated by the auxiliary keypad in ANSI (VT100, VT200) mode and in VT52 mode.

3.2.4 Top-Row Function Keys

There are 20 top-row function keys, F1 through F20. The first five keys (F1 through F5) labeled Hold Screen, Print Screen, Set-Up, Data/Talk, and Break, do not send codes; they are local function keys. Keys F6 through F20 send the codes defined in Table 3-4.

3.2.5 Control Codes

Table 3-5 lists the keys and key combinations used to send control codes. These keys and combinations are valid on all keyboards. The control codes are C0 7-bit control characters; there is no similar mechanism for sending C1 8-bit control characters.

3.3 Enabling and Disabling Auto Repeat

You can enable and disable the auto repeat feature from the keyboard, using the Keyboard Set-Up screen or the DECARM escape sequence (Chapter 4). If the terminal receives the DECARM sequence to turn auto repeat off while an auto repeat is in progress, the key stops auto repeating. If the terminal receives the escape sequence to turn auto repeat on while a key that has been auto repeating is still held down, the key immediately auto repeats. Keys which can auto repeat usually start auto repeating after a delay of 0.5 seconds.

The auto repeat speed is a function of the host transmit speed. This gives a constant repeat rate at all transmit speeds. At speeds of 2400 baud or above, all keys auto repeat at 30 keystrokes per second. For the purpose of the auto repeat feature, the keyboard is divided into the following three groups.

    Group A  Main typing array
    Group B  Cursor keys and keypad keys
    Group C  Top-row function keys and editing keys

Every key in each group auto repeats at the fixed rate set by the transmit speed, regardless of how many codes the key actually sends.

Host Transmit Speed (Baud) Auto Repeat Rate (Keys/Sec)
Group A Group B Group C
>=2400 30 30 30
1200 30 30 24
600 30 20 12
300 30 12 12
150 6 6 6
110 6 6 6
75 6 6 6

In general, the "Transmit Rate Limit" feature (in the Communications Set-Up screen) does not affect auto repeat rates, since all 5 codes can be sent at the limited speed of 150 characters per second at most baud rates. In local mode, keys will auto repeat at 30 keystrokes per second.

The following keys do not auto repeat: Hold Screen, Print Screen, Set-Up, Data/Talk, Break, Compose Character, Shift, Return, Lock, and Ctrl. Shifted or controlled keys will auto repeat.

3.4 Keyboard Lock and Unlock

The following conditions may cause the keyboard to lock.

When the keyboard is locked, all keyboard keys except Hold Screen, Print Screen, Set-Up, Data/Talk, and Break are disabled, and the keyboard Wait indicator turns on.

If the keyboard is locked, any of the following events can unlock it.