HogarHerramientasInformación del código clave

Información del código clave

Depurador de eventos de teclado JavaScript

Presiona cualquier tecla

Muestra evento JavaScript KeyCode, Code y más.

Use these tools directly in Chrome

Install the DailyDevTools extension — access all tools from your browser toolbar

Add to Chrome

What is Keycode Info?

JavaScript keyboard event handling requires knowing the exact key codes, key values, and event properties for each keystroke. DailyDevTools' Keycode Info tool shows you every property of a keyboard event in real-time as you press any key — including event.key, event.code, event.keyCode, event.which, event.charCode, and modifier key states — making it the fastest way to debug keyboard interactions.

How to use Keycode Info

  1. 1Click inside the key detection area to focus it
  2. 2Press any key — the tool immediately shows all properties of the keyboard event
  3. 3View event.key (the logical key value), event.code (the physical key location), and event.keyCode (the legacy numeric code)
  4. 4See which modifier keys were held: Ctrl, Shift, Alt, Meta (⌘ on Mac)

Frequently asked questions

What is the difference between event.key and event.keyCode?
event.key returns a human-readable string like 'Enter', 'ArrowUp', or 'a'. event.keyCode is a legacy numeric code (13 for Enter, 38 for ArrowUp). Modern code should use event.key; keyCode is deprecated.
What is event.code vs event.key?
event.code identifies the physical key location on the keyboard ('KeyA', 'ShiftLeft') regardless of layout. event.key returns the character produced ('a' or 'A'). Use code for game controls, key for text input.
Why do some keys show different values on Mac vs Windows?
The Meta key is ⌘ Command on Mac and ⊞ Windows key on Windows. Function keys and some special keys may produce different event.key values across operating systems and keyboard layouts.

Comments