jQuery Key Codes and Values for Different Browsers
X

Congrats, You are Subscribed to Receive Updates.

jQuery Key Codes and Values for Different Browsers


 Here is the following list of Keycodes that supports different browsers based on the version . Also jQuery works based on three key event handlers. here is it.
  • event.keyCode
  • event.which
  • event.charCode.

Better get the list of supported keys and its combinations,

Key ASCII Mozilla keycodes IE keycodes Opera keycodes pseudo ASCII codes exceptions
Alphabetic keysA to Z 97/65 to 122/90 ASCII code of uppercase version of the letter65 to 90
Space 32 32 32 32 32
Enter 13 13 13 13 13
Tab 9 9 9 9 9
Esc 27 27 27 27 27
Backspace 8 8 8 8 8
Modifier Keys
Key ASCII Mozilla keycodes IE keycodes Opera keycodes pseudo ASCII codes exceptions
Shift 16 16 16 16 Linux Opera < 9.0: 0
Control 17 17 17 17 Linux Opera < 9.0: 0Mac Opera: 0
Alt 18 18 18 18 Linux Opera < 9.0: 0
Caps Lock 20 20 20 20 Linux Opera: 0
Num Lock 144 144 144 144 Linux Opera < 9.50: 0Win Opera < 9.00: 0
Keyboard Number Keys
Key ASCII Mozilla keycodes IE keycodes Opera keycodes pseudo ASCII codes exceptions
1 ! 49/33 49 49 49 49/33 Mac Gecko < 1.8: 49/0
2 @ 50/64 50 50 50 50/64 Mac Gecko < 1.9: 50/0
3 # 51/35 51 51 51 51/35 Mac Gecko < 1.9: 51/0
4 $ 52/36 52 52 52 52/36 Mac Gecko < 1.9: 52/0
5 % 53/37 53 53 53 53/37 Mac Gecko < 1.9: 53/0
6 ^ 54/94 54 54 54 54/94 Mac Gecko < 1.9: 54/0
7 & 55/38 55 55 55 55/38 Mac Gecko < 1.9: 55/0
8 * 56/42 56 56 56 56/42 Mac Gecko < 1.9: 56/0
9 ( 57/40 57 57 57 57/40 Mac Gecko < 1.9: 57/0
0 ) 48/41 48 48 48 48/41 Mac Gecko < 1.9: 48/0
Symbol Keys
Key ASCII Mozilla keycodes IE keycodes Opera keycodes pseudo ASCII codes exceptions
; : 59/58 59 186 59 59/58 Mac Gecko: 59/0
= + 61/43 61 187 61 61/43 Mac Gecko ≥ 1.9: 61/107Mac Gecko < 1.9: 61/0
, < 44/60 188 188 44 44/60 Mac Gecko: 188/0
– _ 45/95 109 189 45 45/95 Mac Gecko ≥ 1.9: 109/0Mac Gecko < 1.9: 0
. > 46/62 190 190 46 46/62 Mac Gecko: 190/0
/ ? 47/63 191 191 47 47/63 Mac Gecko: 191/0
` ~ 96/126 192 192 96 96/126 Mac Gecko: 192/0
[ { 91/123 219 219 91 91/123
\ | 92/124 220 220 92 92/124 Mac Gecko: 220/0
] } 93/125 221 221 93 93/125
‘ “ 39/34 222 222 39 39/34
Arrow Keys
Key ASCII Mozilla keycodes IE keycodes Opera keycodes pseudo ASCII codes exceptions
left-arrow 37 37 37 37
up-arrow 38 38 38 38
right-arrow 39 39 39 39
down-arrow 40 40 40 40
Special Keys
Key ASCII Mozilla keycodes IE keycodes Opera keycodes pseudo ASCII codes exceptions
Insert 45 45 45 45 Konqueror: 0Opera < 9.0: 0
Delete 46 46 46 46 Konqueror: 127Opera < 9.0: 0
Home 36 36 36 36 Opera < 9.0: 0
End 35 35 35 35 Opera < 9.0: 0
Page Up 33 33 33 33
Page Down 34 34 34 34
Function KeysF1 to F12 112 to 123 112 to 123 112 to 123 112 to 123
Keypad KeysIf Num Lock is on, unshifted/shifted values are returned as shown below.
If Num Lock is off,
Linux browsers reverse the shifted/unshifted values,
while Windows browsers always return the shifted value.
None of my Macintoshs have a keypad, so I don’t know what they do.
Key ASCII Mozilla keycodes IE keycodes Opera keycodes pseudo ASCII codes exceptions
. Del 46/- 110/46 110/46 78/46 78/46 Opera < 9.0: 78/0Linux Opera 11.5: 190/46
0 Ins 48/- 96/45 96/45 48/45 48/45 Opera < 9.0: 48/0
1 End 49/- 97/35 97/35 49/35 49/35 Opera < 9.0: 49/0
2 down-arrow 50/- 98/40 98/40 50/40 50/40
3 Pg Dn 51/- 99/34 99/34 51/34 51/34
4 left-arrow 52/- 100/37 100/37 52/37 52/37
5 53/- 101/12 101/12 53/12 53/12 Linux Opera: 53/0
6 right-arrow 54/- 102/39 102/39 54/39 54/39
7 Home 55/- 103/36 103/36 55/36 55/36 Opera < 9.0: 55/0
8 up-arrow 56/- 104/38 104/38 56/38 56/38
9 Pg Up 57/- 105/33 105/33 57/33 57/33
+ 43 107 107 43 43 Linux Opera 11.5: 61
45 109 109 45 45 Linux Opera 11.5: 109
* 42 106 106 42 42 Linux Opera 11.5: 56
/ 47 111 111 47 47 Linux Opera 11.5: 191
Keypad Enter 13 13 13 13 13
Branded Keys
Key ASCII Mozilla keycodes IE keycodes Opera keycodes pseudo ASCII codes exceptions
Left Apple Command 224 ? 17 ? WebKit ≥ 525: 91
Right Apple Command 224 ? 17 ? WebKit ≥ 525: 93
Left Windows Start 91 91 219 0 Linux Gecko: 0
Right Windows Start 92 92 220 0 Linux Gecko: 0
Windows Menu 93 93 0 0

You can also use jQuery Hotkey plugin for better implementation.   Click Here.

 

commenter

About Varadharaj V

The founder of Kvcodes, Varadharaj V is an ERP Analyst and a Web developer specializing in WordPress(WP), WP Theme development, WP Plugin development, Frontaccounting(FA), Sales, Purchases, Inventory, Ledgers, Payroll & HRM, CRM, FA Core Customization, OpenCart Theme Development, PHP, HTML, CSS, jQuery, Bootstrap development and content SEO.

Comment Below

Your email address will not be published. Required fields are marked *

*

Current ye@r *

Menu

Sidebar

Subscribe E-mail Updates

Congrats, You are Subscribed to Receive Updates.

Advertisement

Category Posts