Explore all Mouse & Keyboard Tools

JavaScript KeyCode & Event Inspector – Test Keyboard Key Codes

Press any key to inspect JavaScript KeyboardEvent properties: event.key, event.code, keyCode / which, location, and modifier states with zero lag.

JS Keyboard Event Inspector:DOM Level 3 Events
PRESS ANY KEY ON YOUR KEYBOARD TO INSPECT

Instantly captures JavaScript KeyboardEvent properties (event.key, event.code, keyCode, location) and modifier states.

Recent Key History Stream (Last 10):0 events

No key events recorded yet. Press any key to start inspecting.

RunMacro Bot
⚡ Global Desktop Trigger Engine

Automate Global Desktop Triggers with JavaScript KeyCodes

Turn inspected event.code and virtual keycode values into global hotkey triggers across your entire operating system.

How to Inspect JavaScript Key Codes & Events

1

Press Any Key

Type any key, number, function key, or modifier on your physical keyboard.

2

Read KeyCode Properties

Inspect event.key, event.code, keyCode/which values, and keyboard location in the real-time HUD cards.

3

Copy or Review Stream

Click on any value to copy it directly to your clipboard or review the 10 most recent key events in the table.

Key Features of JavaScript KeyCode Inspector

Full DOM Level 3 Event Coverage

Displays modern standard event.key and event.code alongside legacy keyCode and which integers.

Modifier Key Badges

Real-time active indicators for Ctrl, Shift, Alt/Option, and Meta (Command/Windows) keys.

Physical Location Mapping

Differentiates between Standard, Left, Right, and Numpad instances of keys like Shift, Ctrl, and Enter.

10-Event Historical Stream

Keep track of sequential key combos and keystroke order with precise timestamp logs.

JavaScript KeyboardEvent DOM Level 3 vs Legacy Spec Reference

Standard W3C KeyboardEvent property definitions, legacy deprecation status, and location enum mappings.

Event PropertyType & SpecificationStandard Value ExampleW3C Status & Purpose
event.keyString (DOM Level 3)"h", "Enter", "ArrowUp"Standard (Represents printed character or semantic key value)
event.codeString (DOM Level 3)"KeyH", "Digit1", "NumpadEnter"Standard (Represents physical key position on keyboard layout)
event.keyCode / whichInteger (Legacy)72, 13, 32Deprecated (Inconsistent across non-QWERTY international layouts)
event.locationNumber (0, 1, 2, 3)0 (Standard), 1 (Left), 2 (Right), 3 (Numpad)Standard (Identifies physical origin of duplicated keys like Shift or Enter)

Frequently Asked Questions

Clear answers about using this tool and automating workflows with RunMacro.

What is the difference between event.key and event.code?

event.key represents the character or semantic value produced by the key press (taking into account Shift or keyboard layout modifications, such as 'a' vs 'A'), while event.code represents the physical position of the key on the keyboard hardware (such as 'KeyA'), which remains constant regardless of layout.

Why is event.keyCode deprecated in modern web standards?

event.keyCode and event.which are deprecated in the W3C DOM Level 3 specification because they rely on numeric ASCII-like codes that behave inconsistently across international keyboard layouts (AZERTY, QWERTZ, Dvorak) and mobile virtual keyboards. Developers should use event.key or event.code instead.

Does this inspector capture Function keys (F1–F12) and Space?

Yes. This inspector captures all standard keys including Function keys (F1 through F12), Escape, Backspace, Tab, Space, Enter, and arrow navigation keys with zero lag.

How does RunMacro Macro Recorder use key codes?

RunMacro Macro Recorder uses hardware scan codes (matching event.code) to bind global hotkeys and automate desktop keystroke execution reliably across different software environments and languages.

Related Free Tools

Explore other helpful browser-based utilities in the same category.