feat(keymap): extract pure HID decode into host-testable crate

The Key type, US-QWERTY translate, and the edge-detecting boot-report
parser lived in usb_kbd.rs, unreachable by cargo test (the firmware
crate is pinned to the xtensa target). Move them to a dependency-free
#![no_std] + #![forbid(unsafe_code)] crate so the one path that parses
untrusted device bytes can be exercised on the host.

14 tests, including an ASCII-invariant sweep over all 256 usage IDs
(pins the guarantee the editor's byte==char indexing relies on) and a
never-panics fuzz over arbitrary-length/content reports.
This commit is contained in:
Julien Calixte
2026-07-10 10:36:37 +01:00
parent f373892870
commit 2cd3bba98d
3 changed files with 367 additions and 0 deletions

2
keymap/.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
/target
/Cargo.lock