JavaScript key codes, live
Press any key. See its event.key, event.code, modifiers, and the deprecated keyCode — plus a copy-ready binding string.
event.key vs event.code — which should shortcuts use?
event.key is the character the keystroke produces ("z", "?", "Enter") — it changes with the keyboard layout.event.code is the physical key position (KeyZ,Slash) — identical on QWERTY, QWERTZ, AZERTY, and Dvorak.keyCode and which are deprecated and inconsistent; don't ship new code on them.
For shortcuts, the right answer is both, chosen per key: letters and digits by position (so ⌘Z stays on the Z keycap in Germany), symbols and named keys by character (so? means the glyph). That policy isTactile's hybrid match mode — the engine behind this page.