Keyboard Event Viewer
Press any key and see the keyCode, key, code, which, and modifier state in real-time.
Press any key on your keyboard...
Press any key to begin capturing keyboard events.
Related tools
Keyboard Shortcut VisualizerCode
Visualize keyboard shortcuts for VS Code, Vim, and Emacs on an interactive layout.
JSON to TypeScriptCode
Generate TypeScript interfaces or types from JSON input.
JSON to Go StructCode
Generate Go structs from JSON with proper json tags.
JSON to Python DataclassCode
Generate Python dataclass code from JSON with type hints.
JSON to Java POJOCode
Generate Java POJO classes from JSON with getters, setters, and constructors.
JSON to Rust StructCode
Generate Rust structs from JSON with serde derive macros.
About Keyboard Event Viewer
See the JavaScript keyboard event properties for any key you press — key, code, keyCode, and modifier flags. Essential when wiring up shortcuts and key handlers.
How to use
- Click into the tool and press any key or combination.
- Read the event.key, event.code, and keyCode values.
- Use the exact values in your event-handling code.
Frequently asked questions
- Should I use key or code?
- Use event.key for the character produced and event.code for the physical key, which is layout-independent.
- Why is keyCode shown if it is deprecated?
- keyCode is legacy but still appears in older code; the tool shows it for reference while recommending key/code.