Keyboard Event Codes

← All tools

Click the capture area and press any key. See event.key, event.code, modifier states, location, and repeat — like keycode.info, fully in your browser.

~~~
Click here, then press any key

Space, arrows, Tab, and Page keys are prevented from scrolling while this area is focused.

event.key

event.code

event.which (deprecated)

event.keyCode (deprecated)

Modifiers

CtrlShiftAltMeta
event.location
event.repeat

History (last 10)

TimekeycodewhichCtrlShiftAltMetaLocRepeat

Common keys reference

event.keyevent.codeNote
~~~

About this tool

event.key is the character or key name ("a", "Enter", "ArrowUp"). It varies with keyboard layout — AZERTY and QWERTY can differ.

event.code is the physical key on the keyboard ("KeyA", "Digit1") — layout-independent and preferred for games and shortcuts.

keyCode / which are legacy numeric codes from the DOM Level 3 era. They are deprecated — use key or code instead. Numpad keys often share keyCode values with main keyboard keys.

~~~

Read more