/
keys.go
351 lines (345 loc) · 5.71 KB
/
keys.go
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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
// Copyright 2013 The Ebitengine Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Code generated by genkeys.go using 'go generate'. DO NOT EDIT.
package ui
import (
"fmt"
)
type Key int
const (
KeyA Key = iota
KeyB
KeyC
KeyD
KeyE
KeyF
KeyG
KeyH
KeyI
KeyJ
KeyK
KeyL
KeyM
KeyN
KeyO
KeyP
KeyQ
KeyR
KeyS
KeyT
KeyU
KeyV
KeyW
KeyX
KeyY
KeyZ
KeyAltLeft
KeyAltRight
KeyArrowDown
KeyArrowLeft
KeyArrowRight
KeyArrowUp
KeyBackquote
KeyBackslash
KeyBackspace
KeyBracketLeft
KeyBracketRight
KeyCapsLock
KeyComma
KeyContextMenu
KeyControlLeft
KeyControlRight
KeyDelete
KeyDigit0
KeyDigit1
KeyDigit2
KeyDigit3
KeyDigit4
KeyDigit5
KeyDigit6
KeyDigit7
KeyDigit8
KeyDigit9
KeyEnd
KeyEnter
KeyEqual
KeyEscape
KeyF1
KeyF2
KeyF3
KeyF4
KeyF5
KeyF6
KeyF7
KeyF8
KeyF9
KeyF10
KeyF11
KeyF12
KeyHome
KeyInsert
KeyMetaLeft
KeyMetaRight
KeyMinus
KeyNumLock
KeyNumpad0
KeyNumpad1
KeyNumpad2
KeyNumpad3
KeyNumpad4
KeyNumpad5
KeyNumpad6
KeyNumpad7
KeyNumpad8
KeyNumpad9
KeyNumpadAdd
KeyNumpadDecimal
KeyNumpadDivide
KeyNumpadEnter
KeyNumpadEqual
KeyNumpadMultiply
KeyNumpadSubtract
KeyPageDown
KeyPageUp
KeyPause
KeyPeriod
KeyPrintScreen
KeyQuote
KeyScrollLock
KeySemicolon
KeyShiftLeft
KeyShiftRight
KeySlash
KeySpace
KeyTab
KeyReserved0
KeyReserved1
KeyReserved2
KeyReserved3
)
func (k Key) String() string {
switch k {
case KeyA:
return "KeyA"
case KeyB:
return "KeyB"
case KeyC:
return "KeyC"
case KeyD:
return "KeyD"
case KeyE:
return "KeyE"
case KeyF:
return "KeyF"
case KeyG:
return "KeyG"
case KeyH:
return "KeyH"
case KeyI:
return "KeyI"
case KeyJ:
return "KeyJ"
case KeyK:
return "KeyK"
case KeyL:
return "KeyL"
case KeyM:
return "KeyM"
case KeyN:
return "KeyN"
case KeyO:
return "KeyO"
case KeyP:
return "KeyP"
case KeyQ:
return "KeyQ"
case KeyR:
return "KeyR"
case KeyS:
return "KeyS"
case KeyT:
return "KeyT"
case KeyU:
return "KeyU"
case KeyV:
return "KeyV"
case KeyW:
return "KeyW"
case KeyX:
return "KeyX"
case KeyY:
return "KeyY"
case KeyZ:
return "KeyZ"
case KeyAltLeft:
return "KeyAltLeft"
case KeyAltRight:
return "KeyAltRight"
case KeyArrowDown:
return "KeyArrowDown"
case KeyArrowLeft:
return "KeyArrowLeft"
case KeyArrowRight:
return "KeyArrowRight"
case KeyArrowUp:
return "KeyArrowUp"
case KeyBackquote:
return "KeyBackquote"
case KeyBackslash:
return "KeyBackslash"
case KeyBackspace:
return "KeyBackspace"
case KeyBracketLeft:
return "KeyBracketLeft"
case KeyBracketRight:
return "KeyBracketRight"
case KeyCapsLock:
return "KeyCapsLock"
case KeyComma:
return "KeyComma"
case KeyContextMenu:
return "KeyContextMenu"
case KeyControlLeft:
return "KeyControlLeft"
case KeyControlRight:
return "KeyControlRight"
case KeyDelete:
return "KeyDelete"
case KeyDigit0:
return "KeyDigit0"
case KeyDigit1:
return "KeyDigit1"
case KeyDigit2:
return "KeyDigit2"
case KeyDigit3:
return "KeyDigit3"
case KeyDigit4:
return "KeyDigit4"
case KeyDigit5:
return "KeyDigit5"
case KeyDigit6:
return "KeyDigit6"
case KeyDigit7:
return "KeyDigit7"
case KeyDigit8:
return "KeyDigit8"
case KeyDigit9:
return "KeyDigit9"
case KeyEnd:
return "KeyEnd"
case KeyEnter:
return "KeyEnter"
case KeyEqual:
return "KeyEqual"
case KeyEscape:
return "KeyEscape"
case KeyF1:
return "KeyF1"
case KeyF2:
return "KeyF2"
case KeyF3:
return "KeyF3"
case KeyF4:
return "KeyF4"
case KeyF5:
return "KeyF5"
case KeyF6:
return "KeyF6"
case KeyF7:
return "KeyF7"
case KeyF8:
return "KeyF8"
case KeyF9:
return "KeyF9"
case KeyF10:
return "KeyF10"
case KeyF11:
return "KeyF11"
case KeyF12:
return "KeyF12"
case KeyHome:
return "KeyHome"
case KeyInsert:
return "KeyInsert"
case KeyMetaLeft:
return "KeyMetaLeft"
case KeyMetaRight:
return "KeyMetaRight"
case KeyMinus:
return "KeyMinus"
case KeyNumLock:
return "KeyNumLock"
case KeyNumpad0:
return "KeyNumpad0"
case KeyNumpad1:
return "KeyNumpad1"
case KeyNumpad2:
return "KeyNumpad2"
case KeyNumpad3:
return "KeyNumpad3"
case KeyNumpad4:
return "KeyNumpad4"
case KeyNumpad5:
return "KeyNumpad5"
case KeyNumpad6:
return "KeyNumpad6"
case KeyNumpad7:
return "KeyNumpad7"
case KeyNumpad8:
return "KeyNumpad8"
case KeyNumpad9:
return "KeyNumpad9"
case KeyNumpadAdd:
return "KeyNumpadAdd"
case KeyNumpadDecimal:
return "KeyNumpadDecimal"
case KeyNumpadDivide:
return "KeyNumpadDivide"
case KeyNumpadEnter:
return "KeyNumpadEnter"
case KeyNumpadEqual:
return "KeyNumpadEqual"
case KeyNumpadMultiply:
return "KeyNumpadMultiply"
case KeyNumpadSubtract:
return "KeyNumpadSubtract"
case KeyPageDown:
return "KeyPageDown"
case KeyPageUp:
return "KeyPageUp"
case KeyPause:
return "KeyPause"
case KeyPeriod:
return "KeyPeriod"
case KeyPrintScreen:
return "KeyPrintScreen"
case KeyQuote:
return "KeyQuote"
case KeyScrollLock:
return "KeyScrollLock"
case KeySemicolon:
return "KeySemicolon"
case KeyShiftLeft:
return "KeyShiftLeft"
case KeyShiftRight:
return "KeyShiftRight"
case KeySlash:
return "KeySlash"
case KeySpace:
return "KeySpace"
case KeyTab:
return "KeyTab"
}
panic(fmt.Sprintf("ui: invalid key: %d", k))
}