Keyboard Inspector Pro
Full keydown/keyup analysis · hold duration · modifier detection · event stream
————————| # | Event | Key | Code | ts (ms) | Hold (ms) | Delay (ms) |
|---|---|---|---|---|---|---|
| Enable inspector and press keys to see events | ||||||
⚠Results are estimates based on browser event timing. Actual hardware values may vary due to OS scheduling and browser overhead.
The Keyboard Inspector Pro is a real-time key event analyzer that shows every detail of each keypress: the exact key name, physical code, legacy keyCode, hold duration, inter-key delay, repeat status, and all modifier states. Perfect for debugging keyboard issues, testing macros, or understanding how games read your input.
Understanding Key Events: key vs code vs keyCode
When you press a key, the browser fires events with three different identifiers that serve different purposes:
- key: The logical value produced — changes with Shift and keyboard layout. Pressing Shift+A gives "A", pressing A alone gives "a".
- code: The physical key location — never changes regardless of layout. Pressing the A key on any layout always gives "KeyA".
- keyCode: Deprecated numeric code — legacy property kept for compatibility. Games often still use these numeric values for input mapping.
For game developers: use event.code for WASD movement (layout-independent) and event.key for text input.
What the Hold Duration Tells You
Hold duration is the time between keydown and keyup events in milliseconds. This reveals your actual keystroke timing:
- 10–50ms: Extremely fast gaming taps — common in rhythm games and CS2 counter-strafing
- 50–150ms: Normal gaming keypresses
- 150–300ms: Deliberate presses — typing, normal gaming movement
- <5ms: Possible switch bounce/chatter — contact switches re-firing
How to Diagnose Keyboard Problems
Use the event stream to identify specific issues:
- Double keydown without keyup: Switch chatter — the mechanical contacts are bouncing, registering as multiple presses
- Missing keyup events: Stuck keys — check for debris under the keycap or switch stem binding
- Wrong key values: Incorrect keyboard layout set in your OS — check Windows language/input settings
- High delay between keys: CPU load or browser tab throttling — ensure page is focused and no heavy background processes
Gaming Use Case: If a game isn't registering a specific key, use the inspector to confirm the OS is actually receiving the event. If the key shows up here but not in-game, the issue is the game's input mapping — not your keyboard hardware.
Frequently Asked Questions — Keyboard Inspector Pro
"key" represents the logical character the key produces (e.g., "a", "A", "Enter") and changes with modifier keys and language layout. "code" represents the physical location of the key on the keyboard regardless of layout (e.g., "KeyA", "ShiftLeft") and never changes. "keyCode" is a deprecated numeric code from older browsers (e.g., 65 for A). For modern development, always use "key" for characters and "code" for physical key detection.
The repeat flag is true when a keydown event is being fired repeatedly because the key is being held down and the OS key-repeat function is generating additional events. Most keyboards start repeating after an initial delay (~500ms) and then fire at ~30Hz. Repeat events have the same key/code values as the original keydown but can be filtered out using "if (event.repeat) return;" for games that only need the initial keypress.
Use the event stream to look for: (1) Missing keyup events — indicates sticky keys or switch bounce; (2) Unexpected keyCode values — indicates key remapping or a different keyboard layout than expected; (3) Hold time inconsistencies — very short hold times may indicate switch chatter (double-firing); (4) Double keydown events without keyup — indicates switch debounce failure common in faulty mechanical switches.
For a brief tap, keyboard hold duration (the time between keydown and keyup) is typically 50–150ms for normal typing. Gamers making quick inputs may achieve 30–60ms hold times. Hold durations below 10ms may trigger switch chatter/bounce detection in some keyboards. The hold time shown in the inspector reflects actual physical key press duration including any switch debounce time.
The "keyCode" property (now deprecated) was designed around the US QWERTY layout and returns layout-independent codes for most keys, but varies for special characters. For example, the ";" key returns keyCode 186 on US QWERTY but different values on French AZERTY or German QWERTZ layouts. This is why modern applications use "code" (physical key location) for shortcuts and "key" (actual character) for text input.
The inspector cannot directly identify switch type, but you can infer it through timing. Optical switches (e.g., Razer Optical, Gateron IR) typically show near-zero debounce time and very consistent response times because there is no physical contact bounce. Mechanical contact switches may show slight variation. Extremely short and consistent intervals between keydown and the first repeat event can suggest an optical switch.
Yes. The inspector captures all standard keyboard events including macro keys, media keys, and function keys. However, some macro keys that are handled entirely by the keyboard hardware or its driver software may not send standard keydown/keyup events to the browser. Media control keys (Play, Pause, Volume) send events with special key values like "MediaPlayPause" and "AudioVolumeUp" which will appear in the stream.
