The line
CSI ? 1 h → Normal Cursor Mode (DECOM)
probably should read
CSI ? 1 l → Normal Cursor Keys (DECCKM)
There are two escape sequences in each of smkx
and rmkx
because these capabilities are used in curses, i.e., for the keypad
function.
The manual page for ncurses (like others) does not say so explicitly, but the function applies to all of the special keys on the keyboard which have the ability to switch between normal and application mode. This is a well-known feature of smkx
and rmkx
, as for example in the xterm FAQ Why can't I use the cursor keys in (whatever) shell?.
Special keys on the keyboard may include these (depending on the type of terminal):
- numeric keypad (on the extreme right of a PC keyboard)
- editing keypad (6 keys between the main keyboard and the numeric keyboard)
- cursor keys
- function keys (commonly at the top of a PC keyboard)
The VT100 (which does not have function keys or editing keypad) has separate escape sequences for the other two categories. In VT220 (emulated by xterm), the editing keypad's normal/application mode is an extension of the VT100 DECCKM, (documented in XTerm Control Sequences). DEC did not define a corresponding feature for function keys; however if there were some terminal which supported this capability it would probably be used in smkx
and rmkx
.