Keypress Detector
Use this keypress detector to identify the key your browser receives and the event values attached to it.
Quick Answer
A keypress detector listens for keyboard input and reports which key was pressed, which physical key generated it, and whether modifier keys were active.
Live Keypress Detector
Press a key and the detector will show the received key, code, keyCode, which, location, repeat value, and active modifiers.
Capture
Current key
Waiting…
Press any key to capture keydown
event.type
—
keydown or keyup
event.key
—
Character or named key
event.code
—
Physical keyboard position
event.keyCode
—
Deprecated numeric value
event.which
—
Legacy numeric alias
event.location
—
Standard, left, right, or numpad
event.repeat
—
True while a key is held
Modifier keys
—
Shift, Ctrl, Alt, and Meta
Recent Events
Latest 8 events| Type | Key | Code | Modifiers | Repeat |
|---|---|---|---|---|
| Press a key to populate the event history. | ||||
Common Uses
- Check whether a key is being detected by the browser.
- Identify unexpected keyboard shortcut conflicts.
- See the difference between character keys and modifier keys.
- Verify keyboard input before debugging application code.
Event Values to Watch
Detected key
The visible value reported by event.key for the current key press.
Physical code
The event.code value that maps to the physical key position.
Modifiers
Whether Shift, Control, Alt, or Meta was active during the key press.
Frequently Asked Questions
How does a keypress detector work?
It attaches a keyboard event listener in the browser, then displays the KeyboardEvent values from the most recent keydown event.
Can this detect keyboard shortcuts?
Yes. Press a shortcut combination and the detector will show the main key plus active modifier states like Shift, Control, Alt, and Meta.
Why is my key not detected?
Some browser, operating system, or assistive technology shortcuts may be intercepted before the page receives them. Try another key or check whether the browser is focused.