Device Tests

Keycode Tester

Live

Inspect event.key, event.code, legacy keyCode, location, modifiers, and repeat state for any key.

About Keycode Tester

See the exact KeyboardEvent values produced by a key press. The live inspector separates the layout-aware event.key value from the physical event.code position, reports the deprecated numeric keyCode/which value, identifies left, right, or numpad location, and highlights Ctrl, Alt, Shift, Meta, Repeat, and Composing flags. A short event-history table makes consecutive keys easy to compare, and nothing leaves the focused browser panel.

Set up Keycode Tester

Workspace

Device capture

Focus the capture panel to inspect supported device signals in this browser.

Focus this panel and use your device. Events remain in this browser session.

This workspace stays in your browser session.

API/WebMCP returns capability metadata; events are captured only in the browser.

Keycode Tester: capability

Choose the values that apply, then start test.

What the browser records

Capture focused keydown events and display their key, code, keyCode/which, location, modifier, repeat, and composition properties.

How it works

While listening, the focused inspector reads standard KeyboardEvent properties from each keydown event. event.key represents the interpreted value, event.code represents the physical position, location distinguishes standard, left, right, and numpad sources, and modifier flags describe the event state. keyCode and which are shown for legacy debugging but should not be used for new implementations.

Examples

Keycode Tester: Describe capability

Example input
{
    "session_action": "describe"
}
Expected result
{
    "capability": {
        "requires_browser": true,
        "captures": [
            "keyboard"
        ],
        "storage": "none",
        "listener_scope": "focused capture zone while running"
    },
    "session_action": "describe"
}

Privacy

This tool does not store your inputs or results on UtilityPages.org.

Frequently asked questions

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

event.key is the value produced after keyboard layout and modifiers, such as A or a. event.code identifies the physical position, such as KeyA, regardless of the active layout.

Should new code use keyCode?

No. keyCode and which are deprecated and retained here for troubleshooting older applications. Prefer event.key for meaning and event.code for physical position.

What does KeyboardEvent.location mean?

Location 0 is standard, 1 is left, 2 is right, and 3 is the numeric keypad. It helps distinguish keys such as left and right Shift or top-row and numpad digits.

Why might a shortcut not reach the tester?

The browser or operating system can intercept reserved shortcuts before the webpage receives an event. Test ordinary keys and modifiers separately when diagnosing shortcut behavior.