ToolActToolAct

Keyboard Test

Test keyboard key functionality, display key status and key value information in real-time

Esc
F1
F2
F3
F4
F5
F6
F7
F8
F9
F10
F11
F12
`
1
2
3
4
5
6
7
8
9
0
-
=
Backspace
Tab
Q
W
E
R
T
Y
U
I
O
P
[
]
\
Caps
A
S
D
F
G
H
J
K
L
;
'
Enter
Shift
Z
X
C
V
B
N
M
,
.
/
Shift
Ctrl
Win
Alt
Space
Alt
Win
Menu
Ctrl

Key History

Press any key to start testing...

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

  1. Focus your mouse on the test area
  2. Press any key on your keyboard
  3. Observe key highlight and info panel
  4. 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

Diagnose stuck or unreliable keysPress keys and watch the virtual keyboard light up from real keydown and keyup events. The current key panel exposes key, code, keyCode, which, location, modifier state, and repeat status, so a key that double-fires, chatters, or only registers at the bottom of the stroke can be compared against a known-good switch before assuming the whole board is bad.
Check left/right modifier and numpad behaviorBecause the tool displays the KeyboardEvent location, it can distinguish standard, left, right, and numpad positions where the browser provides that information. That helps when testing shortcut-heavy workflows that depend on left Control vs right Control, right Alt for AltGr, or a numpad Enter that the OS maps to a different scan code than the main Enter.
Capture a short key event historyThe last 50 non-repeat key presses are kept in a visible history, making it easier to compare what you intended to press with what the browser actually received. Clear and reset controls let you run focused tests without refreshing the page, and the keypress log is rendered only on the local page, so any sensitive typed content stays in this tab.
Verify N-key rollover and anti-ghosting on gaming keyboardsHold several letter keys at once and watch the active key panel light up in real time. A keyboard that only registers some of the pressed keys fails the anti-ghosting or N-key rollover claim, since USB HID is normally capped at 6KRO while PS/2 or n-key rollover boards report all 104 keys; missing letters during a WASD plus Shift combo is the classic symptom.
Distinguish browser layout from physical keymapCompare the displayed key value against the reported code to detect mismatches such as a Dvorak layout producing QWERTY codes, or a non-US keyboard still emitting US-centric values from a stale layout in the OS. This is helpful when diagnosing why a shortcut works in the OS shell but not inside a web app that listens to code instead of key.

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: 0

Pressing 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.