unit neo6502keys

Neo6502 library for reading keyboard state using hid scancodes

author: bocianu bocianu@gmail.com


Set of constans and helpers for reading Neo6502 keyboard, using hid scancodes. More about Neo6502:
https://www.olimex.com/Products/Retro-Computers/Neo6502/open-source-hardware
https://www.neo6502.com/

API documentation can be found here:
https://github.com/paulscottrobson/neo6502-firmware/wiki

It's work in progress, so please report any bugs you will find.

Types:

name:type:description:
TKeyrecord
  • code: byte;
  • ctrl: boolean;
  • shift: boolean;
  • alt: boolean;
  • meta: boolean;

end;
Structure used to store information about last pressed key

Interface:

name:description:
ReadKeyboard

procedure ReadKeyboard(var ukey:TKey);


It reads status of all keys and returns code of last key pressed and state of modifier keys (Shift, Alt, Ctrl)
    parameters:
  • ukey (TKey) - key data structure to which the result will be written
IsKeyDown

function IsKeyDown(ukey:TKey):boolean;


Returns the state of the particular key with required modifiers.
Example: IsKeyDown(KEY_S,MOD_CTRL or MOD_SHIFT);
    parameters:
  • ukey (TKey) - key data structure containing keycode and expected modifiers.
  • returns:
  • (boolean) - returns true if key is down with required modifier keys