MMBasic generates a single unique character for the function keys and other special keys on the keyboard.
These are shown in the table as hexadecimal and decimal numbers:
|Keyboard Key||Key Code (Hex)||Key Code (Decimal)|
If the control key is simultaneously pressed then 20 (hex) is added to the code (this is the equivalent of setting bit 5). If the shift key is simultaneously pressed then 40 (hex) is added to the code (this is the equivalent of setting bit 6). If both are pressed 60 (hex) is added. For example Control-PageDown will generate A9 (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. This is particularly useful when using the EDIT command.
The KEYDOWN function makes it easy to tell if the user is holding down a key like an arrow key.