Keyboard Event Guide: Key Names, Codes and Modifiers
Understand what a keydown event reports and why key and code are not the same thing.
What is the Keyboard Event Tester?
Click the button to arm a key listener, then press any key and this tool shows that key's name, its physical code, and which modifier keys were held down. It is useful when a shortcut behaves unexpectedly or when you need the exact code for a key. Nothing is recorded beyond the single keypress shown, and the listener only starts after you click.
How to use it
- Click Arm Listener.
- Press any key on your keyboard.
- Read the key, code and modifiers shown for that keypress.
Worked example
With no sample values, the tool first shows a listening message after the button is clicked, and each key pressed afterwards replaces it with that key's name, code and modifiers.
Why do two keyboards report different keys for one position?
Because the key value follows the active layout, while the code follows the physical position, so layouts change one and not the other.
Frequently asked questions
What is the difference between key and code?
Key is the character or action produced, which can change with layout, while code names the physical key position, which stays the same.
Does it record what I type?
No. It only shows the most recent keypress in the result area and keeps no log of your typing.