Show key, code, keyCode and modifiers for each keypress.
The Keyboard Event Viewer shows what the browser reports when you press a key. It lists key, code, the deprecated keyCode, location, modifiers and the repeat flag, and keeps a short history of recent presses. Use it when you write keyboard shortcuts, debug game controls or handle international layouts.
When you press a key, the browser fires a keydown event on the focused element, carrying several properties. event.key is the value the key produces, such as a, A, Enter or ArrowLeft, and it depends on layout and modifier state. event.code identifies the physical key, such as KeyA or Digit1, regardless of layout, which makes it the right choice for game-style controls. event.keyCode is an older numeric code that is deprecated but still seen in legacy code. event.location tells whether a key is standard, left, right or on the numpad, which separates the two Shift keys or the numpad digits from the top row. event.repeat is true when the key is held down and the browser sends repeated events.
key is the value the key produces and depends on layout and modifiers. code names the physical key position and is independent of the layout.
It is a legacy numeric property with inconsistent values across browsers and layouts. Modern code should use key or code.
0 is Standard, 1 is Left, 2 is Right and 3 is Numpad, as the page shows next to the number.
Virtual keyboards often do not send reliable key and code values, so results can be empty or generic.
No. It only listens to key presses while the capture area has focus, and the history stays in the page.
The 20 most recent, not counting repeated events from holding a key.