KEYCODE MATRIX // DOM LEVEL 3 KEYBOARDEVENT SPECIFICATION
Technical architecture of physical keyboard scan codes, logical character generation, and legacy keyCode deprecation.
event.key vs. event.code
W3C DOM Level 3 explicitly deprecated the numeric event.keyCode and event.which properties in favor of modern semantic strings:
- event.key (Logical Representation): Reflects the character that will be printed or generated, accounting for keyboard language layout, CapsLock, and active Shift modifiers (e.g.
avsAvså). - event.code (Physical Key Position): Represents the physical key location on the keyboard regardless of operating system language settings (e.g.
KeyQremainsKeyQwhether typed on QWERTY, AZERTY, or Dvorak keyboards). Essential for WASD video game movement controls.
Key Location & Modifier Flags
Modern keyboards contain redundant physical keys mapped to distinct hardware registers:
- event.location 0 (Standard): Standard alphanumeric keys and functional buttons.
- event.location 1 & 2 (Left vs Right): Distinguishes Left Shift/Ctrl/Alt from Right Shift/Ctrl/Alt.
- event.location 3 (Numpad): Numeric keypad buttons that differentiate dedicated numpad digits from top-row number keys.
Airgap Zero-Log Privacy Architecture
The KeyCode Matrix debugger processes all keystroke interrupts strictly within the active browser DOM event pipeline. No keylogger hooks, persistent keystroke caches, or password tracking mechanisms are executed.