web123456

Keycode value comparison table

The keyboard event includes onkeypress onkeydown and onkeyup events, where the onkeypress event is a handler that triggers this event when a key on the keyboard is pressed and released. It is generally used for single-key operations on the keyboard. The onkeydown event is a handler that triggers this event when a key on the keyboard is pressed. It is generally used for shortcut key operations. The onkeyup event is a handler that triggers this event when a key on the keyboard is pressed and released. It is generally used for shortcut key operations.

 

Keycode value for letters and numeric keys (keyCode)
button Key Code button Key Code button Key Code button Key Code
A 65 J 74 S 83 1 49
B 66 K 75 T 84 2 50
C 67 L 76 U 85 3 51
D 68 M 77 V 86 4 52
E 69 N 78 W 87 5 53
F 70 O 79 X 88 6 54
G 71 P 80 Y 89 7 55
H 72 Q 81 Z 90 8 56
I 73 R 82 0 48 9 57

 

Keycode values ​​(keyCode) on the numeric keypad Function key code value (keyCode)
button Key Code button Key Code button Key Code button Key Code
0 96 8 104 F1 112 F9 120
1 97 9 105 F2 113 F10 121
2 98 * 106 F3 114 F11 122
3 99 + 107 F4 115 F12 123
4 100 Enter 108 F5 116    
5 101 - 109 F6 117    
6 102 . 110 F7 118    
7 103 / 111 F8 119    

 

Control key code value (keyCode)
button Key Code button Key Code button Key Code button Key Code
BackSpace 8 Esc 27 Right Arrow 39 -_ 189
Tab 9 Spacebar 32 Dw Arrow 40 .> 190
Clear 12 Page Up 33 Insert 45 /? 191
Enter 13 Page Down 34 Delete 46 `~ 192
Shift 16 End 35 Num Lock 144 [{ 219
Control 17 Home 36 ;: 186 \| 220
Alt 18 Left Arrow 37 =+ 187 ]} 221
Cape Lock 20 Up Arrow 38 ,< 188 '" 222

 

Multimedia keycode value (keyCode)
button Key Code button Key Code
Volume up 175 Browser 172
Volume down 174 mail 180
stop 179 search 170
Mute 173 collect 171

Get keyboard key values ​​online (keycode, ASCII code)

Reference article link:

/951201193-wzc/p/