showing results for - "javascript keyboard enum"
Marie
25 Sep 2019
1KeyCode = {
2      BACKSPACE: 8,
3      TAB: 9,
4      ENTER: 13,
5      SHIFT: 16,
6      CTRL: 17,
7      ALT: 18,
8      PAUSE: 19,
9      CAPS_LOCK: 20,
10      ESCAPE: 27,
11      SPACE: 32,
12      PAGE_UP: 33,
13      PAGE_DOWN: 34,
14      END: 35,
15      HOME: 36,
16      LEFT_ARROW: 37,
17      UP_ARROW: 38,
18      RIGHT_ARROW: 39,
19      DOWN_ARROW: 40,
20      INSERT: 45,
21      DELETE: 46,
22      KEY_0: 48,
23      KEY_1: 49,
24      KEY_2: 50,
25      KEY_3: 51,
26      KEY_4: 52,
27      KEY_5: 53,
28      KEY_6: 54,
29      KEY_7: 55,
30      KEY_8: 56,
31      KEY_9: 57,
32      KEY_A: 65,
33      KEY_B: 66,
34      KEY_C: 67,
35      KEY_D: 68,
36      KEY_E: 69,
37      KEY_F: 70,
38      KEY_G: 71,
39      KEY_H: 72,
40      KEY_I: 73,
41      KEY_J: 74,
42      KEY_K: 75,
43      KEY_L: 76,
44      KEY_M: 77,
45      KEY_N: 78,
46      KEY_O: 79,
47      KEY_P: 80,
48      KEY_Q: 81,
49      KEY_R: 82,
50      KEY_S: 83,
51      KEY_T: 84,
52      KEY_U: 85,
53      KEY_V: 86,
54      KEY_W: 87,
55      KEY_X: 88,
56      KEY_Y: 89,
57      KEY_Z: 90,
58      LEFT_META: 91,
59      RIGHT_META: 92,
60      SELECT: 93,
61      NUMPAD_0: 96,
62      NUMPAD_1: 97,
63      NUMPAD_2: 98,
64      NUMPAD_3: 99,
65      NUMPAD_4: 100,
66      NUMPAD_5: 101,
67      NUMPAD_6: 102,
68      NUMPAD_7: 103,
69      NUMPAD_8: 104,
70      NUMPAD_9: 105,
71      MULTIPLY: 106,
72      ADD: 107,
73      SUBTRACT: 109,
74      DECIMAL: 110,
75      DIVIDE: 111,
76      F1: 112,
77      F2: 113,
78      F3: 114,
79      F4: 115,
80      F5: 116,
81      F6: 117,
82      F7: 118,
83      F8: 119,
84      F9: 120,
85      F10: 121,
86      F11: 122,
87      F12: 123,
88      NUM_LOCK: 144,
89      SCROLL_LOCK: 145,
90      SEMICOLON: 186,
91      EQUALS: 187,
92      COMMA: 188,
93      DASH: 189,
94      PERIOD: 190,
95      FORWARD_SLASH: 191,
96      GRAVE_ACCENT: 192,
97      OPEN_BRACKET: 219,
98      BACK_SLASH: 220,
99      CLOSE_BRACKET: 221,
100      SINGLE_QUOTE: 222
101    };
102
103Ecample:
104
105if (event.which == KeyCode.TAB) { 
106  console.log("Tab was pressed");
107}