Instant key detection

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.

Current key press

Waiting...

Press any key to start

event.key

-

Value produced by the key

event.code

-

Physical keyboard position

event.keyCode

-

Legacy numeric value

event.which

-

Legacy alias

event.location

-

Left, right, or numpad hint

event.repeat

-

True when held down

Modifier Keys

Waiting

Shift, Ctrl, Alt, Meta

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.

Related Keyboard Event Guides