About Keyboard Event & KeyCode Inspector — Detailed Guide
The KeyCode Info and Keyboard Event Tester captures JavaScript `KeyboardEvent` attributes in real time whenever you press any physical key. It displays both modern properties (`event.key`, `event.code`) and legacy properties (`event.keyCode`, `event.which`).
Featuring an interactive full-keyboard matrix, the tool highlights triggered keys in real time, tracks key event history, and verifies keyboard switch health—making it ideal for debugging web hotkeys and testing hardware switches.
Key Features & Capabilities
- Instant display of event.key, event.code, event.keyCode, and event.which upon keydown
- Live tracking of modifier keys (Shift, Ctrl, Alt, Meta / Command / Windows)
- Interactive full-sized virtual keyboard highlighting pressed keys and verifying switch health
- Reports physical key location (Standard, Left, Right, Numpad) with one-click property copying
How to Use
- 1
Click anywhere on the tool page to ensure browser window focus.
- 2
Press any physical key or modifier combination (e.g., Shift+K, Escape, Enter).
- 3
Inspect the real-time event attributes on the dashboard and click to copy.
Common Use Cases
- → Implementing global web hotkeys (e.g. Esc to close drawers, Ctrl+Enter to submit forms)
- → Testing mechanical keyboards for phantom ghosting, chatter, or unresponsive switches
- → Resolving cross-platform modifier key discrepancies between Windows and macOS systems
Related Tools
Meta Tag Generator
Generate SEO meta tags, Open Graph, and Twitter Card tags for high-ranking social previews.
.gitignore Generator
Generate comprehensive, community-standard .gitignore files for languages, frameworks, and IDEs.
License Generator
Generate open-source LICENSE files for MIT, Apache 2.0, GPL, BSD, and ISC licenses.
README Generator
Build professional Markdown README templates with customizable badges, sections, and architecture.
Conventional Commit
Interactive generator for Conventional Commits with type, scope, breaking changes, and description.
SemVer Calculator
Calculate semantic versioning ranges, evaluate caret/tilde compatibility, and compare versions.
Frequently Asked Questions & Privacy
Why is `event.keyCode` deprecated in modern web standards?
`keyCode` returns inconsistent numeric values across operating systems and international keyboard layouts. Modern standards mandate using `e.key` (character) and `e.code` (physical location).
What is the exact difference between `e.key` and `e.code`?
`e.code` identifies the physical hardware key on the keyboard (e.g., `"KeyA"`), regardless of layout or shift state. `e.key` identifies the resulting character (e.g., `"a"` or `"A"`).