Keyboard Test
Test keyboard key functionality, display key status and key value information in real-time
Key History
What is Keyboard Test?
A keyboard test checks whether key presses are reaching the browser and shows how the browser describes each key event. It helps diagnose cases where a key feels stuck, a shortcut does not work, a laptop keyboard may be damaged, or a new mechanical keyboard needs a quick sanity check. The tool displays practical event data such as key, code, legacy keyCode, key location, repeat state, and modifier keys like Ctrl, Shift, Alt, or Meta. This helps separate hardware problems from layout or software behavior: a physical key position can be reported differently from the character it produces. Browser tests cannot capture operating-system shortcuts such as Ctrl+Alt+Del or Alt+Tab, so absence of those events is normal rather than a keyboard failure.
How to Use
How to use
- Focus your mouse on the test area
- Press any key on your keyboard
- Observe key highlight and info panel
- View key history below
Tips
- Green highlight indicates the key is working properly
- All standard keyboard keys can be tested
- Supports detecting modifier keys (Ctrl, Shift, Alt, Meta)
- Repeated keys will be marked in the info panel
Use Cases
Technical Principle
The browser surfaces keyboard events through the KeyboardEvent interface: each press fires a keydown and a keyup event. KeyboardEvent carries several key properties: key is the character value of the key (affected by layout and Shift state - e.g. a vs A); code is the physical position identifier (layout-independent - KeyA is KeyA on both QWERTY and AZERTY); keyCode is a legacy numeric value (deprecated but still seen in older code); location indicates the key's position (0 standard, 1 left, 2 right, 3 numpad). To detect combinations, listen to the four boolean modifier flags ctrlKey, shiftKey, altKey, metaKey - e.g. on Ctrl+C, ctrlKey=true and key='c'. The firing order is keydown -> keypress (deprecated) -> keyup; while a key is held, keydown keeps firing and event.repeat=true. Game development prefers code (immune to the player switching layouts), while input fields prefer key (which gives the actual character). N-key rollover (NKRO) means the keyboard hardware can register any number of keys simultaneously; ordinary USB keyboards are limited to 6KRO by the USB HID protocol - more than 6 keys held at once starts dropping events. Mechanical keyboards with PS/2 interfaces or specialized drivers can deliver true NKRO.
- KeyboardEvent.key is the character value ('a'/'A'/'Enter'), affected by layout and Shift - use it in input field scenarios.
- KeyboardEvent.code is the physical position identifier ('KeyA'/'Digit1'), layout-independent - use it for games and shortcut bindings.
- location values: 0 standard, 1 left modifier, 2 right modifier, 3 numpad - useful when distinguishing left/right Shift, Ctrl, Alt.
- Combinations: ctrlKey/shiftKey/altKey/metaKey are four booleans indicating modifier state; combine with key to detect Ctrl+C, Cmd+Shift+P, etc.
- event.repeat=true means a held key is auto-repeating; in long-press tests, use this flag to filter out repeated events.
- 6KRO vs NKRO: 6-key rollover is a USB HID protocol limit; mechanical keyboards can reach N-key rollover (NKRO) through PS/2 or a dedicated driver.
Examples
Pressing a Letter Key
Press A -> key: "a", code: "KeyA", keyCode: 65, location: 0 (standard)Pressing a Function Key
Press F1 -> key: "F1", code: "F1", keyCode: 112, location: 0Pressing a Combination
Press Ctrl+C -> detected Ctrl (code: "ControlLeft", location: 1) + C (code: "KeyC", ctrlKey: true)FAQ
Which keys does the test detect?
Almost every physical key the browser receives a keydown for: alphanumeric, modifiers (Shift/Ctrl/Alt/Meta), arrow keys, function keys F1-F24, numpad, multimedia keys (volume, playback) on supported browsers. Each pressed key turns green on the on-screen keyboard so you can spot non-responsive keys.
Why isn't my Fn key registering?
On most laptops, Fn is handled at the firmware level and does not produce a JavaScript keyboard event - that's normal and not a defect. Function-row combinations (Fn+F5, etc.) often produce only the action (volume up) without a key code. Use a desktop keyboard or external keyboard to test those keys.
Does the test work for stuck or chattering keys?
Yes. Press a key once and watch how many keydown events fire. A chattering switch sends multiple events in milliseconds. The page can list raw event timestamps in some builds, which makes the chatter visible.
What's the difference between key, code, and keyCode?
key is the value ("a", "Shift", "Enter"). code is the physical position ("KeyA", "ShiftLeft") - same on every keyboard layout. keyCode is the deprecated numeric ID (still emitted for compatibility). Use 'code' to identify physical keys regardless of language layout.
Can it test n-key rollover (NKRO)?
Partially. The page shows currently-held keys, so you can press several at once and see how many register. USB HID and PS/2 keyboards have different ghosting limits; testing here gives a real-world web result, but a dedicated tester (Aqua's KeyTest, Switch Hitter) is more authoritative for hardcore measurements.
Do dead keys and IME compositions register?
IME composition (Chinese, Japanese, Korean) typically suppresses the underlying key events while you compose. Toggle off the IME and use direct input mode to test individual keys. Dead keys (acute accent, umlaut on European layouts) emit Dead followed by the next key combined.
Is anything sent to a server?
No. Key events are processed entirely in your browser. Nothing is logged or transmitted.