ZapKit

Keyboard event tester

Find the exact key values for a keyboard shortcut you're coding, or check that every key on a new or repaired keyboard works.

What is a keyboard event tester?

A keyboard event tester shows the information a web browser receives when you press a key. Developers use it to write keyboard shortcuts and game controls correctly, and anyone can use it to check that a keyboard works before buying, after spilling something, or when a key seems dead.

Press a key to see event.key, event.code, the legacy keyCode, its location and active modifiers, plus whether it's auto-repeating. An on-screen keyboard highlights keys while held and marks each one that has worked, and an event log lists recent key presses and releases.

How to use the Keyboard event tester

  1. 1.Press any key

    Its key, code and other values appear instantly.

  2. 2.Watch the keyboard

    Keys light up while held and turn green once tested.

  3. 3.Read the log

    The last 30 key down and up events are listed.

Example: one key, two values

Pressing Shift and 2 on a US keyboard:

event.key
"@"
event.code
Digit2
Modifiers
Shift

A shortcut bound to code Digit2 works on every layout; one bound to "@" depends on the layout.

key versus code

event.key is the character or action produced, which depends on the keyboard layout and Shift: on a US layout Shift+2 gives "@". event.code is the physical key's position, "Digit2", whatever the layout. Use key for typed text and code for game controls and position-based shortcuts.

keyCode is deprecated but still common in older code. location tells left from right Shift, Ctrl and Alt, and number-pad keys from the main row. Blocking browser shortcuts lets you test keys like F5 and Ctrl+S without the browser acting on them.

Frequently asked questions

Why doesn't a key register?

Some keys, like Fn or certain media keys, are handled by the system and never reach the browser.

Why is the Windows key shown as Meta?

Browsers report Windows and Command keys as Meta.

Is anything I type recorded?

No. Presses are shown on this page and nowhere else.

Does it work with non-US layouts?

Yes. event.key follows your layout; the on-screen keyboard shows US positions.

More Developer tools