Expand description
Keyboard input model.
Hardware-agnostic layers on top of a key-matrix scanner:
- a board-specific matrix map turns a scanner position into a physical
Key(seecardputer); KeyboardStatetracks which keys are held and derivesModifiers, producing aKeyEventfor every change;KeyEvent::actionresolves the printed legend and layer (Shift, Fn) into anActionsuch 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.
- Keyboard
State - Held-key tracker. One
u64bit perKey, plus the derived modifiers. - Modifiers
- Held modifier keys, as a bit set.