blob: fb21f78eef4d722621647a39dd4cacecf8ecdb8f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
|
/**
* Class contains the keycodes for keys on your keyboard.
*
* Useful for auto completion:
*
* ```
* switch (event.key)
* {
* case KeyCode.UP:
* {
* // Up key pressed
* break;
* }
* case KeyCode.DOWN:
* {
* // Down key pressed
* break;
* }
* case KeyCode.LEFT:
* {
* // Left key pressed
* break;
* }
* case KeyCode.RIGHT:
* {
* // Right key pressed
* break;
* }
* default:
* {
* // ignore
* break;
* }
* }
* ```
*/
export class KeyCodes {
public static TAB: number = 9;
public static CAPS_LOCK: number = 20;
public static SHIFT: number = 16;
public static CONTROL: number = 17;
public static SPACE: number = 32;
public static DOWN: number = 40;
public static UP: number = 38;
public static LEFT: number = 37;
public static RIGHT: number = 39;
public static ESCAPE: number = 27;
public static F1: number = 112;
public static F2: number = 113;
public static F3: number = 114;
public static F4: number = 115;
public static F5: number = 116;
public static F6: number = 117;
public static F7: number = 118;
public static F8: number = 119;
public static F9: number = 120;
public static F10: number = 121;
public static F11: number = 122;
public static F12: number = 123;
public static INSERT: number = 45;
public static HOME: number = 36;
public static PAGE_UP: number = 33;
public static PAGE_DOWN: number = 34;
public static DELETE: number = 46;
public static END: number = 35;
public static ENTER: number = 13;
public static BACKSPACE: number = 8;
public static NUMPAD_0: number = 96;
public static NUMPAD_1: number = 97;
public static NUMPAD_2: number = 98;
public static NUMPAD_3: number = 99;
public static NUMPAD_4: number = 100;
public static NUMPAD_5: number = 101;
public static NUMPAD_6: number = 102;
public static NUMPAD_7: number = 103;
public static NUMPAD_8: number = 104;
public static NUMPAD_9: number = 105;
public static NUMPAD_DIVIDE: number = 111;
public static NUMPAD_ADD: number = 107;
public static NUMPAD_ENTER: number = 13;
public static NUMPAD_DECIMAL: number = 110;
public static NUMPAD_SUBTRACT: number = 109;
public static NUMPAD_MULTIPLY: number = 106;
public static SEMICOLON: number = 186;
public static EQUAL: number = 187;
public static COMMA: number = 188;
public static MINUS: number = 189;
public static PERIOD: number = 190;
public static SLASH: number = 191;
public static BACKQUOTE: number = 192;
public static LEFTBRACKET: number = 219;
public static BACKSLASH: number = 220;
public static RIGHTBRACKET: number = 221;
public static QUOTE: number = 222;
public static ALT: number = 18;
public static COMMAND: number = 15;
public static NUMPAD: number = 21;
public static A: number = 65;
public static B: number = 66;
public static C: number = 67;
public static D: number = 68;
public static E: number = 69;
public static F: number = 70;
public static G: number = 71;
public static H: number = 72;
public static I: number = 73;
public static J: number = 74;
public static K: number = 75;
public static L: number = 76;
public static M: number = 77;
public static N: number = 78;
public static O: number = 79;
public static P: number = 80;
public static Q: number = 81;
public static R: number = 82;
public static S: number = 83;
public static T: number = 84;
public static U: number = 85;
public static V: number = 86;
public static W: number = 87;
public static X: number = 88;
public static Y: number = 89;
public static Z: number = 90;
public static NUM_0: number = 48;
public static NUM_1: number = 49;
public static NUM_2: number = 50;
public static NUM_3: number = 51;
public static NUM_4: number = 52;
public static NUM_5: number = 53;
public static NUM_6: number = 54;
public static NUM_7: number = 55;
public static NUM_8: number = 56;
public static NUM_9: number = 57;
public static SUBTRACT: number = 189;
public static ADD: number = 187;
}
|