Yuzool

Dev Tools

JavaScript keycode viewer

Press any key to see what JavaScript gets for it: event.key, event.code, the old keyCode, which side of the keyboard it was on, any modifiers, and a line of code to check for it.

key or code?

UseFor
event.keywhat the key means: "a", "A", "Enter", "ArrowUp". Changes with Shift and the keyboard layout.
event.codewhere the key is: "KeyA" is the same key on QWERTY and AZERTY. Best for game controls (WASD).
event.keyCodean old number, deprecated; avoid it in new code.

How to use it

  1. Press a key (on a phone, tap the box first).
  2. Read its values, and copy the check.

Questions

Why does a key show nothing?

Some keys never reach a web page: the system takes them (such as the Fn key, or Cmd+Tab).

What is event.location?

Which copy of a key it was: left or right Shift, Ctrl and Alt, or the number pad.

Related tools

Open all 35 Dev Tools. Everything runs in your browser; nothing you paste is uploaded.

Settings

History

Snippet