How it works
Every key press fires a keydown and a keyup event defined by the W3C UI Events standard. The tester reads event.code, which names the physical key position (for example KeyA or ShiftRight) whatever your layout is, and event.key, the character or function that key produces with your current layout and modifiers.
The on-screen board is a full-size ANSI layout with the extra ISO key next to left Shift. Keys outside it, such as media or language keys, are listed separately. Where the browser supports the Keyboard Map API, letter keys show the labels of your own layout.
event.key and event.code
The same physical key can produce different values. These examples show why both are reported.
| You press | event.key | event.code |
|---|---|---|
| A on a US layout | "a" | "KeyA" |
| A with Shift | "A" | "KeyA" |
| The same key on a French AZERTY layout | "q" | "KeyA" |
| Right Shift | "Shift" | "ShiftRight" |
| 1 on the numeric keypad (Num Lock on) | "1" | "Numpad1" |
Ghosting and rollover
Many keyboards wire keys in a matrix, so some combinations of three or more keys cannot all be detected: a key may not register (blocking) or a key you did not press may appear (ghosting). “Most at once” shows the largest number of keys this keyboard reported down together. Gaming keyboards with n-key rollover report every key; USB keyboards in boot mode often stop at six keys plus modifiers.
Tips
- A key that never lights while others do is likely faulty or blocked by dirt; a key that lights twice from one press may be chattering.
- Test rollover with the combinations you really use, for example W A S D plus Shift and Space in games.
- Your operating system catches some shortcuts before the browser does, so they cannot be tested here.
Standards and sources
- UI Events · W3C
- UI Events KeyboardEvent code values · W3C
- UI Events KeyboardEvent key values · W3C
- KeyboardEvent.code · MDN Web Docs
Last reviewed October 18, 2026
Frequently asked questions
Why does a key not light up?
Either the key or switch is faulty, or the key never reaches the browser: Fn and system shortcuts such as Win+L or Cmd+Tab are handled by the operating system. Try the key in another app to tell the difference.
What is the difference between event.key and event.code?
event.code is the physical position of the key and does not change with the layout; event.key is what the key types right now, which depends on the layout, Shift and other modifiers.
How do I test n-key rollover?
Hold down keys one after another without releasing them. “Most at once” shows the highest number the keyboard reported down together. If a key you hold does not light, the keyboard has reached its limit for that combination.