index.d.ts
2.56 KB
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
137
138
139
140
141
142
143
144
145
export = keycode;
export as namespace keycode;
declare const keycode: Keycode;
declare interface CodesMap {
'backspace': number;
'tab': number;
'enter': number;
'shift': number;
'ctrl': number;
'alt': number;
'pause/break': number;
'caps lock': number;
'esc': number;
'space': number;
'page up': number;
'page down': number;
'end': number;
'home': number;
'left': number;
'up': number;
'right': number;
'down': number;
'insert': number;
'delete': number;
'command': number;
'left command': number;
'right command': number;
'numpad *': number;
'numpad +': number;
'numpad -': number;
'numpad .': number;
'numpad /': number;
'num lock': number;
'scroll lock': number;
'my computer': number;
'my calculator': number;
';': number;
'=': number;
',': number;
'-': number;
'.': number;
'/': number;
'`': number;
'[': number;
'\\': number;
']': number;
"'": number;
'a': number;
'b': number;
'c': number;
'd': number;
'e': number;
'f': number;
'g': number;
'h': number;
'i': number;
'j': number;
'k': number;
'l': number;
'm': number;
'n': number;
'o': number;
'p': number;
'q': number;
'r': number;
's': number;
't': number;
'u': number;
'v': number;
'w': number;
'x': number;
'y': number;
'z': number;
'0': number;
'1': number;
'2': number;
'3': number;
'4': number;
'5': number;
'6': number;
'7': number;
'8': number;
'9': number;
'f1': number;
'f2': number;
'f3': number;
'f4': number;
'f5': number;
'f6': number;
'f7': number;
'f8': number;
'f9': number;
'f10': number;
'f11': number;
'f12': number;
'numpad 0': number;
'numpad 1': number;
'numpad 2': number;
'numpad 3': number;
'numpad 4': number;
'numpad 5': number;
'numpad 6': number;
'numpad 7': number;
'numpad 8': number;
'numpad 9': number;
}
declare interface AliasesMap {
'windows': number;
'⇧': number;
'⌥': number;
'⌃': number;
'⌘': number;
'ctl': number;
'control': number;
'option': number;
'pause': number;
'break': number;
'caps': number;
'return': number;
'escape': number;
'spc': number;
'spacebar': number;
'pgup': number;
'pgdn': number;
'ins': number;
'del': number;
'cmd': number;
}
declare interface InverseCodesMap {
[key: number]: string;
}
declare interface Keycode {
(event: Event): string;
(keycode: number): string;
(name: string): number;
codes: CodesMap;
aliases: AliasesMap;
names: InverseCodesMap;
isEventKey: (event: Event, nameOrCode: number | string) => boolean;
}