Keyboard Event Viewer

Press any key to see the values a web page receives: key, code, keyCode, which, location, repeat and active modifiers, with a short history.

Use the tool

Why this tool exists

When you write keyboard shortcuts or game controls, you need the exact values the browser reports, and they are confusing. key gives the character produced, code gives the physical key, and the old keyCode and which are deprecated yet still common in legacy code. International layouts make it worse: the same physical key can produce different characters.

This viewer shows all of those values the moment you press or release a key. It also shows whether the key is on the left, right or numpad, whether it is repeating and which of Ctrl, Shift, Alt and Meta are held. A list keeps the last twelve presses. It is an easy way to check what your own keyboard layout produces before you hard-code a handler. Nothing is recorded or sent anywhere.

How to use it

  1. Click on the page, away from any text box.
  2. Press a key and read the key, code, keyCode and other values.
  3. Hold modifiers like Shift or Ctrl to see them listed.
  4. Check the History list for your last presses.

Frequently asked questions

What is the difference between key and code?

key is the value the key produces, such as a or A, and depends on layout and modifiers. code identifies the physical key, such as KeyA, and stays the same across layouts. Use code for game controls and key for text.

Why is keyCode crossed out in documentation?

It is deprecated because its values were inconsistent between browsers and layouts. It is shown here because older scripts still use it, but new code should use key or code.

Why does pressing a key do nothing?

The page ignores key events when focus is inside a text field or select box. Click on an empty part of the page first. Some keys captured by the system, such as the Windows key, may not reach the browser.

Does it record what I type?

No. Events are shown on screen and kept only in the page's memory for the short history. Nothing is stored or uploaded. Avoid typing passwords anyway.