DECKPAM Keypad Application Mode
Choose what the numeric keypad sends: its digits or application codes.
ESC =
- DEC STD 070
- §6.9 Set Keypad Application Mode, p. 6-66
- VT510
- DECKPAM—Keypad Application Mode
ESC = (DECKPAM) puts the numeric keypad into application mode, and ESC > (DECKPNM) puts it back into numeric mode, the default. In numeric mode the keypad’s keys send the digits, comma, period and minus sign printed on them. In application mode they send SS3 followed by a single character identifying the key.
DECKPNM is defined in DEC STD 070 §6.9, p. 6-67 and in the VT510 manual as DECKPNM—Keypad Numeric Mode.
The same setting is DEC private mode 66, DECNKM: CSI ? 66 h is the same as DECKPAM, and CSI ? 66 l the same as DECKPNM. DEC STD 070 (§6.9, p. 6-68) says it was added to make it simpler to ask for the keypad’s state; the VT510 manual has it as DECNKM. DEC STD 070 requires, from level 2, that this mode and the cursor key mode (DECCKM) be independent of each other.
This site cannot press keys, so the cases check only the mode, through DECRQM for mode 66, and that nothing on the screen changes.
Validation
DECKPAM-1: Application mode
\e=
AB
\e[?66$p # DECRQM: is mode 66 set?
|AB___|
reply \e[?66;1$y
DECKPAM-2: Back to numeric mode
\e=
\e>
\e[?66$p
|_____|
reply \e[?66;2$y
DECKPAM-3: The same setting as mode 66
\e[?66h # DECNKM, set
\e[?66$p
\e[?66l # DECNKM, reset
\e[?66$p
|_____|
reply \e[?66;1$y\e[?66;2$y
DECKPAM-4: Numeric mode to begin with
\e[?66$p
|_____|
reply \e[?66;2$y