Skip to main content

Crate oxstack_input

Crate oxstack_input 

Source
Expand description

Keyboard input model.

Hardware-agnostic layers on top of a key-matrix scanner:

  1. a board-specific matrix map turns a scanner position into a physical Key (see cardputer);
  2. KeyboardState tracks which keys are held and derives Modifiers, producing a KeyEvent for every change;
  3. KeyEvent::action resolves the printed legend and layer (Shift, Fn) into an Action such as a character or an arrow key.

Everything is const-table or match based, so lookups compile to jump tables in flash, and KeyboardState is a single u64 bit set plus one byte of modifiers.

Modules§

cardputer
M5Stack Cardputer keyboard: 56 keys in 4 rows × 14 columns.

Structs§

KeyEvent
A change in one key’s state, with the modifiers held after the change.
KeyboardState
Held-key tracker. One u64 bit per Key, plus the derived modifiers.
Modifiers
Held modifier keys, as a bit set.

Enums§

Action
What a key press means once legends and layers are applied.
Key
A physical key, named after its primary legend.