Inspect any keyboard event
Press any key — physical, modifier, or composed — and see event.key, event.code, location, modifier state, and the legacy keyCode/which. Live history of the last 10 presses.
Press any key to populate
How to inspect keys
Modern keyboard events carry layout-independent code, semantic key, and legacy keyCode. This tool surfaces all three plus modifier state, repeat flag, and physical location.
- 01
Focus the page
Click outside any input. Otherwise the typing target swallows the event.
Inputs are treated as UTF-8 throughout the pipeline and validated client-side as you type — nothing dispatches until the value is well-formed.
focusinpututf-8client-sidevalidatedfocus · textpage · setdocument.body
loaded · parsedclient-side - 02
Press a key
Letter, modifier, function — anything fires a keydown.
Each toggle re-computes through a memoised hook, so flipping options never resets your input and the UI stays snappy on large inputs.
pressoptionslivememoisedtogglespress · memoisedkey · liveEnter ↵
options set · memoisedlive - 03
Read event fields
event.code is layout-independent; event.key reflects the current layout.
Randomness — where used — comes from
crypto.getRandomValues, neverMath.random. Heavy work sits inuseMemo.fieldscomputeinstantlocaldeterministiccode · instantKeyA · computedkey: "a" code: KeyA
computed · instantinstant - 04
Combine modifiers
Hold Ctrl/Alt/Shift/Meta to see modifier booleans flip.
Copy writes through
navigator.clipboardand downloads use aBlob— zero network traffic. Same input plus same options always yield the same bytes.modscopydownloadzero-networkreproducibleok · copiedcombo · copiedCtrl+Shift+K
shipped · ready to shipsuccess
Pro tips for everyday utilities
Reach for crypto.getRandomValues
Cryptographically random for IDs, tokens, salts. Math.random is for animation and games, not security.
Mock data with seeds
Faker-style libraries can be seeded so tests are reproducible. Embed the seed in the fixture file.
Reference cards beat memory
Cheatsheets for Vim, Git, Docker, Linux signals are faster than man pages when you’re mid-flow.
Browser APIs vary
Touch events, gamepads, and clipboard differ across vendors. Feature-detect before use.
Persist in the right place
localStorage for user preferences, sessionStorage for transient state, IndexedDB for structured data.
When to inspect keys
Shortcut handlers, accessibility, game input.
Shortcut handlers
Pick event.code vs event.key for the right binding model. Random values come from crypto.getRandomValues — cryptographically secure for tokens, salts, and session IDs. Math.random is deterministic enough for animations but predictable enough to be a security bug.
CSPRNG-backedAccessibility audits
Confirm tabindex and arrow-key handlers fire on the right key. Pair with hashids, ULID, or UUID v7 when you need both random and sortable — useful for primary keys, public-facing IDs, and event log ordering without a sequence column.
a11yGame input
Map WASD by physical key (event.code) regardless of layout. Output is deterministic given the same seed, so fixtures and tests stay reproducible across CI runs and contributor machines. Embed the seed in the fixture file for full replay.
snappyCross-browser checks
Spot differences between Chromium, Firefox, and Safari. Heavy work runs through useMemo so the UI stays snappy on large inputs. Same input + same options yields identical bytes — the kind of stability snapshot tests rely on.
feature-detectedRepeat detection
Use event.repeat to ignore key holds for command actions. Storage tools persist to the right backend: localStorage for user preferences, sessionStorage for transient state, IndexedDB for structured data. Pick the right shelf and quota worries disappear.
deterministicLayout debugging
See what AZERTY or Dvorak users actually send. Browser feature detection: clipboard, fullscreen, gamepad, and Web Bluetooth APIs gracefully fall back when unavailable. No surprise white screens on Safari or older Firefox.
i18nFrequently asked questions
Something missing?
Tell us what you need. We ship the top requests every two weeks.