83Plus:Software:usb8x/Asm Interface/KBD/KBDGetKey
Synopsis
Name: KBDGetKey
Minimum usb8x version: 0.11
Get a key press from the keyboard
Inputs
None
Outputs
- NC: Success (do no use the values in the registers if carry is returned)
- A: Number of keys remaining in keyboard buffer
- B: Raw key press modifiers
- C: Raw key press keycode
- D: Converted TIOS keyextend code
- E: Converted TIOS key code
Destroys
- HL
Notes
Be sure to initialize the keyboard driver and hardware with [[../KBDInit|KBDInit]] before calling this routine.
The keyboard driver maintains an internal 6-byte key press buffer. The value of register A indicates how many key presses were left in the buffer after the current key was removed.
The values in registers B and C contain the raw key values as returned by the keyboard hardware. They are not processed in any way, so they will not, for example, be affected by the caps lock status. Equates for raw key values are available in usb8x.inc.
The values in register D and E contain keyboard key presses converted to TIOS keys. Register D contains the extended token if it is a two byte key code, otherwise D will be 0. The output of this routine can be used as input to the KeyToString routine to convert the key code to a string for display. TIOS key codes can be found in ti83plus.inc.
See Also
- [[../KBDCheckDirect|KBDCheckDirect]] - Directly check the keyboard matrix