User Rating 0.0
Total Usage 2 times
Status: Active
Click here & press any key combination
Ready
Waiting for input...
event.code-
event.key-
event.which-
event.location-
CtrlAltShiftMeta
Recent Events0 captured
KeyCodeWhichLoc
    Is this tool helpful?

    Your feedback helps us improve.

    About

    Precise keyboard input handling is the backbone of robust web applications, data entry interfaces, and browser-based games. Developers often struggle with the discrepancies between physical key positions (Hardware Scan Codes) and the characters they generate (Logical Values). This distinction is exacerbated by different operating systems (Windows vs. macOS) and international keyboard layouts (ANSI vs. ISO vs. JIS).

    This tool solves the ambiguity by capturing the three critical layers of a key press event in real-time:

    • Physical Location (event.code). The hardware key identifier. Immutable regardless of language layout. Critical for game controls (e.g., WASD).
    • Character Value (event.key). The resulting character, affected by modifier keys like Shift or AltGraph.
    • Legacy Index (keyCode). The integer value used in older codebases, now deprecated but often required for maintaining legacy systems.

    Use the log below to inspect "dead keys", composed characters (IME), and modifier sequences. The comprehensive reference table provides a master list of standard definitions.

    keyboard events javascript keycodes input debugging game controls accessibility hotkeys

    Formulas

    When detecting input, prioritizing the modern event.code is recommended for layout-independent consistency. The hierarchy of properties is defined as follows:

    {
    key = Generated Character (e.g., "A", "@")code = Physical Button (e.g., "KeyA", "Digit2")location = Key Region (0=Std, 1=Left, 2=Right, 3=Numpad)

    To detect a specific combination, such as Ctrl + Shift + Z, logical checks are required rather than a single code:

    isRedo = event.ctrlKey kAND event.shiftKey kAND event.code === "KeyZ"

    Reference Data

    CategoryPhysical Code (event.code)Key Value (event.key)Legacy (which)Description
    System & UIEscapeEscape27Cancel / Abort
    EnterEnter13Submit / Return
    Space 32Space Bar
    TabTab9Tabulator (Focus Next)
    CapsLockCapsLock20Capital Lock Toggle
    ModifiersShiftLeftShift16Left Shift Modifier
    ShiftRightShift16Right Shift Modifier
    ControlLeftControl17Left Control (Command)
    ControlRightControl17Right Control
    AltLeftAlt18Left Alt (Option)
    MetaLeftMeta91OS Key (Windows/Apple)
    NavigationArrowUpArrowUp38Cursor Up
    ArrowDownArrowDown40Cursor Down
    ArrowLeftArrowLeft37Cursor Left
    ArrowRightArrowRight39Cursor Right
    HomeHome36Go to Start
    EndEnd35Go to End
    EditingBackspaceBackspace8Delete Backward
    DeleteDelete46Delete Forward
    InsertInsert45Toggle Insert Mode
    Digits (Top)Digit00 / )48Digit 0
    Digit11 / !49Digit 1
    Digit22 / @50Digit 2
    Digit55 / %53Digit 5
    Digit99 / (57Digit 9
    LettersKeyAa / A65Latin A
    KeyZz / Z90Latin Z
    KeyWw / W87Latin W
    KeyMm / M77Latin M
    SymbolsBackquote` / ~192Grave Accent
    Minus- / _189Hyphen
    Equal= / +187Equal Sign
    BracketLeft[ / {219Open Bracket
    BracketRight] / }221Close Bracket
    Backslash\ / |220Backslash
    NumpadNumpad0096Num 0 (Insert)
    NumpadMultiply*106Num Asterisk
    NumpadAdd+107Num Plus
    NumpadSubtract-109Num Minus
    NumLockNumLock144Number Lock
    FunctionF1F1112Help (Usually)
    F5F5116Refresh
    F11F11122Fullscreen
    F12F12123DevTools
    PrintScreenPrintScreen44Screen Capture

    Frequently Asked Questions

    The "Unidentified" value often appears when the browser cannot map a physical key press to a standard value. This is common with specialized keys on gaming keyboards, media controllers, or when an Input Method Editor (IME) is actively composing a character (e.g., waiting for a second keystroke to create an accented letter).
    While they both produce the same numbers visually (e.g., '1'), they send different `event.code` values (`Digit1` vs. `Numpad1`). Game developers often distinguish these to allow players to use the Numpad for different actions than the top row numbers.
    Yes, by using `event.preventDefault()` within your event listener. However, some system-level security keys (like Ctrl+Alt+Del on Windows or Command+Tab on macOS) cannot be intercepted by a web page.
    Yes. The `event.code` will show the physical position (e.g., "KeyQ" for the top-left letter key), while `event.key` will show the actual character produced by your layout (e.g., "a" on AZERTY). This separation allows developers to support all keyboard layouts simultaneously.
    Dead keys are modifier keys that do not generate a character immediately but modify the *next* character pressed. For example, pressing `Alt`+`e` on a Mac prepares an accent, and the next vowel pressed will appear with that accent. The `event.key` for the initial press is often "Dead".