Utility Box

Keyboard Event KeyCode Viewer

Press any key to instantly view JavaScript KeyboardEvent values such as key, code, keyCode, and which. Useful for shortcuts, game controls, and web debugging.

Escape
F1
F2
F3
F4
F5
F6
F7
F8
F9
F10
F11
F12
`
1
2
3
4
5
6
7
8
9
0
-
=
Back
Tab
Q
W
E
R
T
Y
U
I
O
P
[
]
\
CapsLock
A
S
D
F
G
H
J
K
L
;
'
Enter
Shift
Z
X
C
V
B
N
M
,
.
/
Shift
Ctrl
Meta
Alt
Space
Alt
Meta
Menu
Ctrl
Num
Num/
Num*
Num-
Num7
Num8
Num9
Num+
Num4
Num5
Num6
Num1
Num2
Num3
NumEnter
Num0
Num.

Options

event.key-
event.code-
event.keyCode-
event.which-
event.location-
event.repeat-
event.ctrlKey-
event.shiftKey-
event.altKey-
event.metaKey-
event.type-

Shortcut Combo: -

Current Key

-

key: -

code: -

Recent Inputs

  1. No key events yet.

keyCode/which are legacy properties. For new code, check key and code together.

Mobile virtual keyboards may limit keyboard event data. For best results, use an external keyboard or focus the input field.

Usage Tips

Check whether your keyboard input is detected correctly

When you press a key, checking what the browser actually receives can help you quickly test keyboard issues or input errors. If a key is not working or a shortcut behaves differently than expected, compare the pressed key and modifier key status together.

#KeyCode #KeyboardEvent #JavaScript #WebDev #ShortcutTester

What is Keyboard Event KeyCode Viewer?

Keyboard Event KeyCode Viewer shows real-time key, code, keyCode, which, and modifier states for debugging keyboard input.

How to Use

  1. 1Open the page and press keys to inspect main and detailed values.
  2. 2Configure keydown/keyup/repeat/default-prevent options.
  3. 3Use history and copy actions for debug notes.

Reference Knowledge

  • event.key represents the actual character or key name produced by the user.
  • event.code represents the physical key position on the keyboard.
  • event.keyCode and event.which are legacy properties, but they are still useful when debugging older code.
  • Modifier states such as Ctrl, Shift, Alt, and Meta help verify shortcut combinations.

FAQ

Q.How do I use the Keyboard KeyCode Viewer?

A.

Open the page and press any key. The tool will show key, code, keyCode, which, and modifier values.

Q.What is the difference between key and code?

A.

key is the actual character or key name, while code refers to the physical key position on the keyboard.

Q.Should I still use keyCode?

A.

keyCode is a legacy property, but it is still useful for debugging older code or compatibility issues.

Q.Can I test shortcut combinations?

A.

Yes. The viewer shows Ctrl, Shift, Alt, and Meta states so you can verify shortcut combinations.

Q.Does it work on mobile?

A.

Mobile virtual keyboards may limit keyboard event data. For best results, use an external keyboard or focus the input field.