JavaScript Keycode Inspector
Press any key on your keyboard to instantly view event.key, event.code, keyCode, and modifier states.
Modern JavaScript Keyboard Events
While legacy web applications used event.keyCode (which is now deprecated in modern Web Specifications), contemporary JavaScript applications use event.key and event.code:
- event.key: Returns the actual character pressed (e.g.
"a","A","Enter"). - event.code: Returns the physical key position on the keyboard (e.g.
"KeyA","Digit1").