claude/input-module-keyboard-events-379361 #6
Loading…
Reference in New Issue
No description provided.
Delete Branch "claude/input-module-keyboard-events-379361"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Turn a keycode + modifiers into a character. The input module delivers HID usage keycodes but nothing mapped them to characters; rather than hand-maintain layout tables, vendor the X11 xkeyboard-config database and compile it to native Zig at build time (no X11 runtime), the way make-initial-ramdisk.py packs the ramdisk. - tools/make-xkeyboard-config.py: `fetch` downloads the pinned xkeyboard-config release (2.44, sha256-verified), resolves the include graph for the configured layouts, and vendors only the reached symbols files + keysymdef.h + COPYING + PROVENANCE into library/xkeyboard-config/vendor/. `generate` parses that (keycodes via a HID->xkb-name table, symbols with include/augment/override and per-key type, keysymdef for keysym->Unicode) and emits generated/layouts.zig deterministically. - library/xkeyboard-config/xkeyboard-config.zig: the API over the generated data — map(layout, hid_usage, mods) -> { keysym, character }, byName, and the level-selection semantics (the generated tables stay pure data). Host tests assert US letters/digits with Shift/Caps, GB £ vs US # on Shift+3, and French AZERTY q-where-US-has-a — the end-to-end proof of the parse->emit->lookup path. - build.zig: `xkeyboard-config` + `layouts` modules, the test wired into `zig build test`, and a `zig build gen-xkeyboard-config` convenience step. - Layouts: us, gb, de, fr, es, dvorak. Scope (documented): group 1, no dead-key composition, curated key types. Standalone library; wiring it into the input path to fill KeyEvent.character is a documented follow-up. zig build test green (incl. the new keymap tests); regeneration is byte-identical; full QEMU suite 48/48 (unaffected — no kernel/runtime/service change).