DEV Community

San
San

Posted on

How to know key codes with worth noting?

**Key codes worth noting
Letters A-Z: (65-90)

keyboardMap[65]; // A
...
keyboardMap[90]; // Z
Digits 0-9: (48-57)

keyboardMap[48]; // 0
...
keyboardMap[57]; // 9
Number Pad 0-9: (96-105)

keyboardMap[96]; // NUMPAD0
...
keyboardMap[105]; // NUMPAD9
Arrow Keys: (37-40)

keyboardMap[37]; // LEFT
keyboardMap[38]; // UP
keyboardMap[39]; // RIGHT
keyboardMap[40]; // DOWN
Tab Key: (9)

keyboardMap[9]; // TAB
Enter Key: (13)

keyboardMap[13]; // ENTER
Spacebar Key: (32)

keyboardMap[32]; // SPACE
OS Specific Key (91) Windows Key (Windows) or Command Key (Mac)

keyboardMap[91]; // OS_KEY
Alt Key: (18)

keyboardMap[18]; // ALT
Control Key: (17)

keyboardMap[17]; // CONTROL
Shift Key: (16)

keyboardMap[16]; // SHIFT
Caps Lock Key: (20)

keyboardMap[20]; // CAPS_LOCK**

Top comments (0)