Keyboard Event Codes
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.
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
History (last 10)
| Time | key | code | which | Ctrl | Shift | Alt | Meta | Loc | Repeat |
|---|---|---|---|---|---|---|---|---|---|
Common keys reference
| event.key | event.code | Note |
|---|---|---|
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
Free books, courses, and software
Get my programming books, course editions, and complete software.
Get the download library →