Keyboard Event Viewer
0 eventsEvery keyboard event appears here, newest first.
Every keyboard event appears here, newest first.
A KeyboardEvent identifies a press in three ways. On a French AZERTY keyboard, the same physical key gives a different key value, the same code, and a keyCode that follows the letter.
keyThe character the layout types, or the key's name (Enter, Shift)qacodeThe physical key, whatever the layoutKeyQKeyQkeyCodeA legacy number, deprecated but still sent8165The location property says which side a paired key is on, or that a key is on the number pad.
With a Chinese, Japanese or Korean input method on, the input method takes the keys first. The page sees key "Process" and keyCode 229, and the text arrives in composition events. Typing ni for a Chinese word:
keydownkey "Process" · keyCode 229compositionstartThe input method starts a wordcompositionupdatedata n, then nikeydownSpace picks a candidatecompositionenddata is the word pickedinputinputType insertCompositionTextEach event carries the modifiers held at that moment. getModifierState() also reports the lock keys.
ShiftshiftKeyControlctrlKeyAltaltKeyMetametaKey (Windows, or Command on a Mac)CapsLockLock state, not whether the key is downNumLockLock state, often unknown on a MacAltGraphRight Alt on many European layoutsScrollLockRare on current keyboardskey is what the key types on the current layout, such as a or A. code is the physical key, such as KeyA, and stays the same on any layout. This keyboard event viewer shows both for every press.
An input method (IME) is handling the key. key reads "Process" and the text comes later in composition and input events. Type in the field to see them.
keyCode, which and charCode are deprecated, but browsers still send them. New code should read key or code.
The keyboard handles Fn itself and sends no key code, so no web page receives it. The key you press with Fn, such as F5 or a volume key, does show up.
The browser keeps some shortcuts for itself: close tab, new tab, new window. Blocking default actions stops most other keys, such as Tab, F5 or /, but not these.
The system repeats a held key. Each repeat is a keydown with repeat true, and one keyup comes on release.
While Command is held, macOS browsers send no keyup for the other keys, and none arrives after Command is released either. Mac keyboard test →
Events are handled in this browser only. The test code does not upload them, and they are cleared when you close the page. Privacy policy →