Skip to main content

oxstack_input/
lib.rs

1//! Keyboard input model.
2//!
3//! Hardware-agnostic layers on top of a key-matrix scanner:
4//!
5//! 1. a board-specific matrix map turns a scanner position into a physical
6//!    [`Key`] (see [`cardputer`]);
7//! 2. [`KeyboardState`] tracks which keys are held and derives
8//!    [`Modifiers`], producing a [`KeyEvent`] for every change;
9//! 3. [`KeyEvent::action`] resolves the printed legend and layer (Shift, Fn)
10//!    into an [`Action`] such as a character or an arrow key.
11//!
12//! Everything is `const`-table or `match` based, so lookups compile to
13//! jump tables in flash, and [`KeyboardState`] is a single `u64` bit set
14//! plus one byte of modifiers.
15#![no_std]
16#![warn(missing_docs)]
17
18#[cfg(doctest)]
19#[doc = include_str!("../README.md")]
20struct ReadmeDoctests;
21
22pub mod cardputer;
23mod key;
24mod state;
25
26pub use key::{Action, Key, Modifiers};
27pub use state::{KeyEvent, KeyboardState};