Special Keyboard Keys

Compatible with:
DOS Maximite CMM MM150 MM170 MM+ MMX Picromite ArmiteL4 Armite F4 ArmiteH7 CMM2

MMBasic generates a single unique character for the function keys and other special keys on the keyboard. 
These are shown in this table as hexadecimal and decimal numbers:

Keyboard Key Key Code (Hex) Key Code (Decimal)
Up Arrow 80 128
Down Arrow 81 129
Left Arrow 82 130
Right Arrow 83 131
Insert 84 132
Home 86 134
End 87 135
Page Up 88 136
Page Down 89 137
Alt 8B 139
F1 91 145
F2 92 146
F3 93 147
F4 94 148
F5 95 149
F6 96 150
F7 97 151
F8 98 152
F9 99 153
F10 9A 154
F11 9B 155
F12 9C 156
Print Screen (CMM2 KB only) 9D 157
Pause (CMM2 KB only) 9E 158

If the shift key is simultaneously pressed then 40 (hex) is added to the code (this is the equivalent of setting bit 6). For example Shift-F10 will generate DA (hex).
The shift modifier only works with the function keys F1 to F12; it is ignored for the other keys.
MMBasic will translate most VT100 escape codes generated by terminal emulators such as Tera Term and Putty to these codes (excluding the shift and control modifiers). 
This means that a terminal emulator operating over a USB or a serial port opened as console will generate the same key codes as a directly attached keyboard.


Last edited: 26 October, 2020