@rpascene/shared 0.30.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (177) hide show
  1. package/README.md +9 -0
  2. package/dist/es/baseDB.mjs +109 -0
  3. package/dist/es/build/copy-static.mjs +29 -0
  4. package/dist/es/common.mjs +37 -0
  5. package/dist/es/constants/example-code.mjs +202 -0
  6. package/dist/es/constants/index.mjs +74 -0
  7. package/dist/es/env/basic.mjs +6 -0
  8. package/dist/es/env/constants.mjs +97 -0
  9. package/dist/es/env/decide-model-config.mjs +172 -0
  10. package/dist/es/env/global-config-manager.mjs +82 -0
  11. package/dist/es/env/helper.mjs +45 -0
  12. package/dist/es/env/index.mjs +5 -0
  13. package/dist/es/env/init-debug.mjs +18 -0
  14. package/dist/es/env/model-config-manager.mjs +99 -0
  15. package/dist/es/env/parse.mjs +69 -0
  16. package/dist/es/env/types.mjs +265 -0
  17. package/dist/es/env/utils.mjs +18 -0
  18. package/dist/es/extractor/constants.mjs +2 -0
  19. package/dist/es/extractor/cs_postmessage.mjs +61 -0
  20. package/dist/es/extractor/customLocator.mjs +646 -0
  21. package/dist/es/extractor/debug.mjs +6 -0
  22. package/dist/es/extractor/dom-util.mjs +92 -0
  23. package/dist/es/extractor/index.mjs +7 -0
  24. package/dist/es/extractor/locator.mjs +95 -0
  25. package/dist/es/extractor/tree.mjs +81 -0
  26. package/dist/es/extractor/util.mjs +244 -0
  27. package/dist/es/extractor/web-extractor.mjs +361 -0
  28. package/dist/es/img/box-select.mjs +184 -0
  29. package/dist/es/img/draw-box.mjs +42 -0
  30. package/dist/es/img/get-jimp.mjs +10 -0
  31. package/dist/es/img/get-photon.mjs +19 -0
  32. package/dist/es/img/get-sharp.mjs +11 -0
  33. package/dist/es/img/index.mjs +5 -0
  34. package/dist/es/img/info.mjs +32 -0
  35. package/dist/es/img/transform.mjs +192 -0
  36. package/dist/es/index.mjs +3 -0
  37. package/dist/es/logger.mjs +61 -0
  38. package/dist/es/node/fs.mjs +44 -0
  39. package/dist/es/node/index.mjs +1 -0
  40. package/dist/es/polyfills/async-hooks.mjs +2 -0
  41. package/dist/es/polyfills/index.mjs +1 -0
  42. package/dist/es/types/index.mjs +3 -0
  43. package/dist/es/us-keyboard-layout.mjs +1414 -0
  44. package/dist/es/us-keyboard-layout.mjs.LICENSE.txt +5 -0
  45. package/dist/es/utils.mjs +66 -0
  46. package/dist/lib/baseDB.js +149 -0
  47. package/dist/lib/build/copy-static.js +77 -0
  48. package/dist/lib/common.js +93 -0
  49. package/dist/lib/constants/example-code.js +239 -0
  50. package/dist/lib/constants/index.js +153 -0
  51. package/dist/lib/env/basic.js +40 -0
  52. package/dist/lib/env/constants.js +143 -0
  53. package/dist/lib/env/decide-model-config.js +212 -0
  54. package/dist/lib/env/global-config-manager.js +116 -0
  55. package/dist/lib/env/helper.js +85 -0
  56. package/dist/lib/env/index.js +94 -0
  57. package/dist/lib/env/init-debug.js +52 -0
  58. package/dist/lib/env/model-config-manager.js +133 -0
  59. package/dist/lib/env/parse.js +106 -0
  60. package/dist/lib/env/types.js +650 -0
  61. package/dist/lib/env/utils.js +61 -0
  62. package/dist/lib/extractor/constants.js +42 -0
  63. package/dist/lib/extractor/cs_postmessage.js +98 -0
  64. package/dist/lib/extractor/customLocator.js +698 -0
  65. package/dist/lib/extractor/debug.js +12 -0
  66. package/dist/lib/extractor/dom-util.js +150 -0
  67. package/dist/lib/extractor/index.js +153 -0
  68. package/dist/lib/extractor/locator.js +141 -0
  69. package/dist/lib/extractor/tree.js +127 -0
  70. package/dist/lib/extractor/util.js +335 -0
  71. package/dist/lib/extractor/web-extractor.js +407 -0
  72. package/dist/lib/img/box-select.js +232 -0
  73. package/dist/lib/img/draw-box.js +89 -0
  74. package/dist/lib/img/get-jimp.js +72 -0
  75. package/dist/lib/img/get-photon.js +76 -0
  76. package/dist/lib/img/get-sharp.js +63 -0
  77. package/dist/lib/img/index.js +102 -0
  78. package/dist/lib/img/info.js +86 -0
  79. package/dist/lib/img/transform.js +279 -0
  80. package/dist/lib/index.js +43 -0
  81. package/dist/lib/logger.js +114 -0
  82. package/dist/lib/node/fs.js +97 -0
  83. package/dist/lib/node/index.js +60 -0
  84. package/dist/lib/polyfills/async-hooks.js +36 -0
  85. package/dist/lib/polyfills/index.js +60 -0
  86. package/dist/lib/types/index.js +37 -0
  87. package/dist/lib/us-keyboard-layout.js +1457 -0
  88. package/dist/lib/us-keyboard-layout.js.LICENSE.txt +5 -0
  89. package/dist/lib/utils.js +136 -0
  90. package/dist/types/baseDB.d.ts +25 -0
  91. package/dist/types/build/copy-static.d.ts +31 -0
  92. package/dist/types/common.d.ts +12 -0
  93. package/dist/types/constants/example-code.d.ts +2 -0
  94. package/dist/types/constants/index.d.ts +23 -0
  95. package/dist/types/env/basic.d.ts +6 -0
  96. package/dist/types/env/constants.d.ts +40 -0
  97. package/dist/types/env/decide-model-config.d.ts +14 -0
  98. package/dist/types/env/global-config-manager.d.ts +32 -0
  99. package/dist/types/env/helper.d.ts +6 -0
  100. package/dist/types/env/index.d.ts +4 -0
  101. package/dist/types/env/init-debug.d.ts +1 -0
  102. package/dist/types/env/model-config-manager.d.ts +24 -0
  103. package/dist/types/env/parse.d.ts +12 -0
  104. package/dist/types/env/types.d.ts +295 -0
  105. package/dist/types/env/utils.d.ts +7 -0
  106. package/dist/types/extractor/constants.d.ts +1 -0
  107. package/dist/types/extractor/cs_postmessage.d.ts +2 -0
  108. package/dist/types/extractor/customLocator.d.ts +69 -0
  109. package/dist/types/extractor/debug.d.ts +1 -0
  110. package/dist/types/extractor/dom-util.d.ts +26 -0
  111. package/dist/types/extractor/index.d.ts +36 -0
  112. package/dist/types/extractor/locator.d.ts +7 -0
  113. package/dist/types/extractor/tree.d.ts +9 -0
  114. package/dist/types/extractor/util.d.ts +43 -0
  115. package/dist/types/extractor/web-extractor.d.ts +19 -0
  116. package/dist/types/img/box-select.d.ts +25 -0
  117. package/dist/types/img/draw-box.d.ts +15 -0
  118. package/dist/types/img/get-jimp.d.ts +2 -0
  119. package/dist/types/img/get-photon.d.ts +8 -0
  120. package/dist/types/img/get-sharp.d.ts +3 -0
  121. package/dist/types/img/index.d.ts +4 -0
  122. package/dist/types/img/info.d.ts +29 -0
  123. package/dist/types/img/transform.d.ts +88 -0
  124. package/dist/types/index.d.ts +3 -0
  125. package/dist/types/logger.d.ts +4 -0
  126. package/dist/types/node/fs.d.ts +15 -0
  127. package/dist/types/node/index.d.ts +1 -0
  128. package/dist/types/polyfills/async-hooks.d.ts +6 -0
  129. package/dist/types/polyfills/index.d.ts +4 -0
  130. package/dist/types/types/index.d.ts +37 -0
  131. package/dist/types/us-keyboard-layout.d.ts +32 -0
  132. package/dist/types/utils.d.ts +22 -0
  133. package/package.json +102 -0
  134. package/src/baseDB.ts +158 -0
  135. package/src/build/copy-static.ts +62 -0
  136. package/src/common.ts +67 -0
  137. package/src/constants/example-code.ts +202 -0
  138. package/src/constants/index.ts +81 -0
  139. package/src/env/basic.ts +12 -0
  140. package/src/env/constants.ts +291 -0
  141. package/src/env/decide-model-config.ts +319 -0
  142. package/src/env/global-config-manager.ts +174 -0
  143. package/src/env/helper.ts +80 -0
  144. package/src/env/index.ts +4 -0
  145. package/src/env/init-debug.ts +29 -0
  146. package/src/env/model-config-manager.ts +145 -0
  147. package/src/env/parse.ts +131 -0
  148. package/src/env/types.ts +573 -0
  149. package/src/env/utils.ts +39 -0
  150. package/src/extractor/constants.ts +5 -0
  151. package/src/extractor/cs_postmessage.ts +101 -0
  152. package/src/extractor/customLocator.ts +1138 -0
  153. package/src/extractor/debug.ts +10 -0
  154. package/src/extractor/dom-util.ts +141 -0
  155. package/src/extractor/index.ts +54 -0
  156. package/src/extractor/locator.ts +179 -0
  157. package/src/extractor/tree.ts +179 -0
  158. package/src/extractor/util.ts +468 -0
  159. package/src/extractor/web-extractor.ts +559 -0
  160. package/src/img/box-select.ts +346 -0
  161. package/src/img/draw-box.ts +60 -0
  162. package/src/img/get-jimp.ts +12 -0
  163. package/src/img/get-photon.ts +48 -0
  164. package/src/img/get-sharp.ts +18 -0
  165. package/src/img/index.ts +24 -0
  166. package/src/img/info.ts +79 -0
  167. package/src/img/jimp.d.ts +4 -0
  168. package/src/img/transform.ts +396 -0
  169. package/src/index.ts +6 -0
  170. package/src/logger.ts +93 -0
  171. package/src/node/fs.ts +84 -0
  172. package/src/node/index.ts +1 -0
  173. package/src/polyfills/async-hooks.ts +6 -0
  174. package/src/polyfills/index.ts +4 -0
  175. package/src/types/index.ts +53 -0
  176. package/src/us-keyboard-layout.ts +723 -0
  177. package/src/utils.ts +127 -0
@@ -0,0 +1,1414 @@
1
+ /*! For license information please see us-keyboard-layout.mjs.LICENSE.txt */
2
+ /**
3
+ * @license
4
+ * Copyright 2017 Google Inc.
5
+ * SPDX-License-Identifier: Apache-2.0
6
+ */ const _keyDefinitions = {
7
+ 0: {
8
+ keyCode: 48,
9
+ key: '0',
10
+ code: 'Digit0'
11
+ },
12
+ 1: {
13
+ keyCode: 49,
14
+ key: '1',
15
+ code: 'Digit1'
16
+ },
17
+ 2: {
18
+ keyCode: 50,
19
+ key: '2',
20
+ code: 'Digit2'
21
+ },
22
+ 3: {
23
+ keyCode: 51,
24
+ key: '3',
25
+ code: 'Digit3'
26
+ },
27
+ 4: {
28
+ keyCode: 52,
29
+ key: '4',
30
+ code: 'Digit4'
31
+ },
32
+ 5: {
33
+ keyCode: 53,
34
+ key: '5',
35
+ code: 'Digit5'
36
+ },
37
+ 6: {
38
+ keyCode: 54,
39
+ key: '6',
40
+ code: 'Digit6'
41
+ },
42
+ 7: {
43
+ keyCode: 55,
44
+ key: '7',
45
+ code: 'Digit7'
46
+ },
47
+ 8: {
48
+ keyCode: 56,
49
+ key: '8',
50
+ code: 'Digit8'
51
+ },
52
+ 9: {
53
+ keyCode: 57,
54
+ key: '9',
55
+ code: 'Digit9'
56
+ },
57
+ Power: {
58
+ key: 'Power',
59
+ code: 'Power'
60
+ },
61
+ Eject: {
62
+ key: 'Eject',
63
+ code: 'Eject'
64
+ },
65
+ Abort: {
66
+ keyCode: 3,
67
+ code: 'Abort',
68
+ key: 'Cancel'
69
+ },
70
+ Help: {
71
+ keyCode: 6,
72
+ code: 'Help',
73
+ key: 'Help'
74
+ },
75
+ Backspace: {
76
+ keyCode: 8,
77
+ code: 'Backspace',
78
+ key: 'Backspace'
79
+ },
80
+ Tab: {
81
+ keyCode: 9,
82
+ code: 'Tab',
83
+ key: 'Tab'
84
+ },
85
+ Numpad5: {
86
+ keyCode: 12,
87
+ shiftKeyCode: 101,
88
+ key: 'Clear',
89
+ code: 'Numpad5',
90
+ shiftKey: '5',
91
+ location: 3
92
+ },
93
+ NumpadEnter: {
94
+ keyCode: 13,
95
+ code: 'NumpadEnter',
96
+ key: 'Enter',
97
+ text: '\r',
98
+ location: 3
99
+ },
100
+ Enter: {
101
+ keyCode: 13,
102
+ code: 'Enter',
103
+ key: 'Enter',
104
+ text: '\r'
105
+ },
106
+ '\r': {
107
+ keyCode: 13,
108
+ code: 'Enter',
109
+ key: 'Enter',
110
+ text: '\r'
111
+ },
112
+ '\n': {
113
+ keyCode: 13,
114
+ code: 'Enter',
115
+ key: 'Enter',
116
+ text: '\r'
117
+ },
118
+ ShiftLeft: {
119
+ keyCode: 16,
120
+ code: 'ShiftLeft',
121
+ key: 'Shift',
122
+ location: 1
123
+ },
124
+ ShiftRight: {
125
+ keyCode: 16,
126
+ code: 'ShiftRight',
127
+ key: 'Shift',
128
+ location: 2
129
+ },
130
+ ControlLeft: {
131
+ keyCode: 17,
132
+ code: 'ControlLeft',
133
+ key: 'Control',
134
+ location: 1
135
+ },
136
+ ControlRight: {
137
+ keyCode: 17,
138
+ code: 'ControlRight',
139
+ key: 'Control',
140
+ location: 2
141
+ },
142
+ AltLeft: {
143
+ keyCode: 18,
144
+ code: 'AltLeft',
145
+ key: 'Alt',
146
+ location: 1
147
+ },
148
+ AltRight: {
149
+ keyCode: 18,
150
+ code: 'AltRight',
151
+ key: 'Alt',
152
+ location: 2
153
+ },
154
+ Pause: {
155
+ keyCode: 19,
156
+ code: 'Pause',
157
+ key: 'Pause'
158
+ },
159
+ CapsLock: {
160
+ keyCode: 20,
161
+ code: 'CapsLock',
162
+ key: 'CapsLock'
163
+ },
164
+ Escape: {
165
+ keyCode: 27,
166
+ code: 'Escape',
167
+ key: 'Escape'
168
+ },
169
+ Convert: {
170
+ keyCode: 28,
171
+ code: 'Convert',
172
+ key: 'Convert'
173
+ },
174
+ NonConvert: {
175
+ keyCode: 29,
176
+ code: 'NonConvert',
177
+ key: 'NonConvert'
178
+ },
179
+ Space: {
180
+ keyCode: 32,
181
+ code: 'Space',
182
+ key: ' '
183
+ },
184
+ Numpad9: {
185
+ keyCode: 33,
186
+ shiftKeyCode: 105,
187
+ key: 'PageUp',
188
+ code: 'Numpad9',
189
+ shiftKey: '9',
190
+ location: 3
191
+ },
192
+ PageUp: {
193
+ keyCode: 33,
194
+ code: 'PageUp',
195
+ key: 'PageUp'
196
+ },
197
+ Numpad3: {
198
+ keyCode: 34,
199
+ shiftKeyCode: 99,
200
+ key: 'PageDown',
201
+ code: 'Numpad3',
202
+ shiftKey: '3',
203
+ location: 3
204
+ },
205
+ PageDown: {
206
+ keyCode: 34,
207
+ code: 'PageDown',
208
+ key: 'PageDown'
209
+ },
210
+ End: {
211
+ keyCode: 35,
212
+ code: 'End',
213
+ key: 'End'
214
+ },
215
+ Numpad1: {
216
+ keyCode: 35,
217
+ shiftKeyCode: 97,
218
+ key: 'End',
219
+ code: 'Numpad1',
220
+ shiftKey: '1',
221
+ location: 3
222
+ },
223
+ Home: {
224
+ keyCode: 36,
225
+ code: 'Home',
226
+ key: 'Home'
227
+ },
228
+ Numpad7: {
229
+ keyCode: 36,
230
+ shiftKeyCode: 103,
231
+ key: 'Home',
232
+ code: 'Numpad7',
233
+ shiftKey: '7',
234
+ location: 3
235
+ },
236
+ ArrowLeft: {
237
+ keyCode: 37,
238
+ code: 'ArrowLeft',
239
+ key: 'ArrowLeft'
240
+ },
241
+ Numpad4: {
242
+ keyCode: 37,
243
+ shiftKeyCode: 100,
244
+ key: 'ArrowLeft',
245
+ code: 'Numpad4',
246
+ shiftKey: '4',
247
+ location: 3
248
+ },
249
+ Numpad8: {
250
+ keyCode: 38,
251
+ shiftKeyCode: 104,
252
+ key: 'ArrowUp',
253
+ code: 'Numpad8',
254
+ shiftKey: '8',
255
+ location: 3
256
+ },
257
+ ArrowUp: {
258
+ keyCode: 38,
259
+ code: 'ArrowUp',
260
+ key: 'ArrowUp'
261
+ },
262
+ ArrowRight: {
263
+ keyCode: 39,
264
+ code: 'ArrowRight',
265
+ key: 'ArrowRight'
266
+ },
267
+ Numpad6: {
268
+ keyCode: 39,
269
+ shiftKeyCode: 102,
270
+ key: 'ArrowRight',
271
+ code: 'Numpad6',
272
+ shiftKey: '6',
273
+ location: 3
274
+ },
275
+ Numpad2: {
276
+ keyCode: 40,
277
+ shiftKeyCode: 98,
278
+ key: 'ArrowDown',
279
+ code: 'Numpad2',
280
+ shiftKey: '2',
281
+ location: 3
282
+ },
283
+ ArrowDown: {
284
+ keyCode: 40,
285
+ code: 'ArrowDown',
286
+ key: 'ArrowDown'
287
+ },
288
+ Select: {
289
+ keyCode: 41,
290
+ code: 'Select',
291
+ key: 'Select'
292
+ },
293
+ Open: {
294
+ keyCode: 43,
295
+ code: 'Open',
296
+ key: 'Execute'
297
+ },
298
+ PrintScreen: {
299
+ keyCode: 44,
300
+ code: 'PrintScreen',
301
+ key: 'PrintScreen'
302
+ },
303
+ Insert: {
304
+ keyCode: 45,
305
+ code: 'Insert',
306
+ key: 'Insert'
307
+ },
308
+ Numpad0: {
309
+ keyCode: 45,
310
+ shiftKeyCode: 96,
311
+ key: 'Insert',
312
+ code: 'Numpad0',
313
+ shiftKey: '0',
314
+ location: 3
315
+ },
316
+ Delete: {
317
+ keyCode: 46,
318
+ code: 'Delete',
319
+ key: 'Delete'
320
+ },
321
+ NumpadDecimal: {
322
+ keyCode: 46,
323
+ shiftKeyCode: 110,
324
+ code: 'NumpadDecimal',
325
+ key: '\u0000',
326
+ shiftKey: '.',
327
+ location: 3
328
+ },
329
+ Digit0: {
330
+ keyCode: 48,
331
+ code: 'Digit0',
332
+ shiftKey: ')',
333
+ key: '0'
334
+ },
335
+ Digit1: {
336
+ keyCode: 49,
337
+ code: 'Digit1',
338
+ shiftKey: '!',
339
+ key: '1'
340
+ },
341
+ Digit2: {
342
+ keyCode: 50,
343
+ code: 'Digit2',
344
+ shiftKey: '@',
345
+ key: '2'
346
+ },
347
+ Digit3: {
348
+ keyCode: 51,
349
+ code: 'Digit3',
350
+ shiftKey: '#',
351
+ key: '3'
352
+ },
353
+ Digit4: {
354
+ keyCode: 52,
355
+ code: 'Digit4',
356
+ shiftKey: '$',
357
+ key: '4'
358
+ },
359
+ Digit5: {
360
+ keyCode: 53,
361
+ code: 'Digit5',
362
+ shiftKey: '%',
363
+ key: '5'
364
+ },
365
+ Digit6: {
366
+ keyCode: 54,
367
+ code: 'Digit6',
368
+ shiftKey: '^',
369
+ key: '6'
370
+ },
371
+ Digit7: {
372
+ keyCode: 55,
373
+ code: 'Digit7',
374
+ shiftKey: '&',
375
+ key: '7'
376
+ },
377
+ Digit8: {
378
+ keyCode: 56,
379
+ code: 'Digit8',
380
+ shiftKey: '*',
381
+ key: '8'
382
+ },
383
+ Digit9: {
384
+ keyCode: 57,
385
+ code: 'Digit9',
386
+ shiftKey: '(',
387
+ key: '9'
388
+ },
389
+ KeyA: {
390
+ keyCode: 65,
391
+ code: 'KeyA',
392
+ shiftKey: 'A',
393
+ key: 'a'
394
+ },
395
+ KeyB: {
396
+ keyCode: 66,
397
+ code: 'KeyB',
398
+ shiftKey: 'B',
399
+ key: 'b'
400
+ },
401
+ KeyC: {
402
+ keyCode: 67,
403
+ code: 'KeyC',
404
+ shiftKey: 'C',
405
+ key: 'c'
406
+ },
407
+ KeyD: {
408
+ keyCode: 68,
409
+ code: 'KeyD',
410
+ shiftKey: 'D',
411
+ key: 'd'
412
+ },
413
+ KeyE: {
414
+ keyCode: 69,
415
+ code: 'KeyE',
416
+ shiftKey: 'E',
417
+ key: 'e'
418
+ },
419
+ KeyF: {
420
+ keyCode: 70,
421
+ code: 'KeyF',
422
+ shiftKey: 'F',
423
+ key: 'f'
424
+ },
425
+ KeyG: {
426
+ keyCode: 71,
427
+ code: 'KeyG',
428
+ shiftKey: 'G',
429
+ key: 'g'
430
+ },
431
+ KeyH: {
432
+ keyCode: 72,
433
+ code: 'KeyH',
434
+ shiftKey: 'H',
435
+ key: 'h'
436
+ },
437
+ KeyI: {
438
+ keyCode: 73,
439
+ code: 'KeyI',
440
+ shiftKey: 'I',
441
+ key: 'i'
442
+ },
443
+ KeyJ: {
444
+ keyCode: 74,
445
+ code: 'KeyJ',
446
+ shiftKey: 'J',
447
+ key: 'j'
448
+ },
449
+ KeyK: {
450
+ keyCode: 75,
451
+ code: 'KeyK',
452
+ shiftKey: 'K',
453
+ key: 'k'
454
+ },
455
+ KeyL: {
456
+ keyCode: 76,
457
+ code: 'KeyL',
458
+ shiftKey: 'L',
459
+ key: 'l'
460
+ },
461
+ KeyM: {
462
+ keyCode: 77,
463
+ code: 'KeyM',
464
+ shiftKey: 'M',
465
+ key: 'm'
466
+ },
467
+ KeyN: {
468
+ keyCode: 78,
469
+ code: 'KeyN',
470
+ shiftKey: 'N',
471
+ key: 'n'
472
+ },
473
+ KeyO: {
474
+ keyCode: 79,
475
+ code: 'KeyO',
476
+ shiftKey: 'O',
477
+ key: 'o'
478
+ },
479
+ KeyP: {
480
+ keyCode: 80,
481
+ code: 'KeyP',
482
+ shiftKey: 'P',
483
+ key: 'p'
484
+ },
485
+ KeyQ: {
486
+ keyCode: 81,
487
+ code: 'KeyQ',
488
+ shiftKey: 'Q',
489
+ key: 'q'
490
+ },
491
+ KeyR: {
492
+ keyCode: 82,
493
+ code: 'KeyR',
494
+ shiftKey: 'R',
495
+ key: 'r'
496
+ },
497
+ KeyS: {
498
+ keyCode: 83,
499
+ code: 'KeyS',
500
+ shiftKey: 'S',
501
+ key: 's'
502
+ },
503
+ KeyT: {
504
+ keyCode: 84,
505
+ code: 'KeyT',
506
+ shiftKey: 'T',
507
+ key: 't'
508
+ },
509
+ KeyU: {
510
+ keyCode: 85,
511
+ code: 'KeyU',
512
+ shiftKey: 'U',
513
+ key: 'u'
514
+ },
515
+ KeyV: {
516
+ keyCode: 86,
517
+ code: 'KeyV',
518
+ shiftKey: 'V',
519
+ key: 'v'
520
+ },
521
+ KeyW: {
522
+ keyCode: 87,
523
+ code: 'KeyW',
524
+ shiftKey: 'W',
525
+ key: 'w'
526
+ },
527
+ KeyX: {
528
+ keyCode: 88,
529
+ code: 'KeyX',
530
+ shiftKey: 'X',
531
+ key: 'x'
532
+ },
533
+ KeyY: {
534
+ keyCode: 89,
535
+ code: 'KeyY',
536
+ shiftKey: 'Y',
537
+ key: 'y'
538
+ },
539
+ KeyZ: {
540
+ keyCode: 90,
541
+ code: 'KeyZ',
542
+ shiftKey: 'Z',
543
+ key: 'z'
544
+ },
545
+ MetaLeft: {
546
+ keyCode: 91,
547
+ code: 'MetaLeft',
548
+ key: 'Meta',
549
+ location: 1
550
+ },
551
+ MetaRight: {
552
+ keyCode: 92,
553
+ code: 'MetaRight',
554
+ key: 'Meta',
555
+ location: 2
556
+ },
557
+ ContextMenu: {
558
+ keyCode: 93,
559
+ code: 'ContextMenu',
560
+ key: 'ContextMenu'
561
+ },
562
+ NumpadMultiply: {
563
+ keyCode: 106,
564
+ code: 'NumpadMultiply',
565
+ key: '*',
566
+ location: 3
567
+ },
568
+ NumpadAdd: {
569
+ keyCode: 107,
570
+ code: 'NumpadAdd',
571
+ key: '+',
572
+ location: 3
573
+ },
574
+ NumpadSubtract: {
575
+ keyCode: 109,
576
+ code: 'NumpadSubtract',
577
+ key: '-',
578
+ location: 3
579
+ },
580
+ NumpadDivide: {
581
+ keyCode: 111,
582
+ code: 'NumpadDivide',
583
+ key: '/',
584
+ location: 3
585
+ },
586
+ F1: {
587
+ keyCode: 112,
588
+ code: 'F1',
589
+ key: 'F1'
590
+ },
591
+ F2: {
592
+ keyCode: 113,
593
+ code: 'F2',
594
+ key: 'F2'
595
+ },
596
+ F3: {
597
+ keyCode: 114,
598
+ code: 'F3',
599
+ key: 'F3'
600
+ },
601
+ F4: {
602
+ keyCode: 115,
603
+ code: 'F4',
604
+ key: 'F4'
605
+ },
606
+ F5: {
607
+ keyCode: 116,
608
+ code: 'F5',
609
+ key: 'F5'
610
+ },
611
+ F6: {
612
+ keyCode: 117,
613
+ code: 'F6',
614
+ key: 'F6'
615
+ },
616
+ F7: {
617
+ keyCode: 118,
618
+ code: 'F7',
619
+ key: 'F7'
620
+ },
621
+ F8: {
622
+ keyCode: 119,
623
+ code: 'F8',
624
+ key: 'F8'
625
+ },
626
+ F9: {
627
+ keyCode: 120,
628
+ code: 'F9',
629
+ key: 'F9'
630
+ },
631
+ F10: {
632
+ keyCode: 121,
633
+ code: 'F10',
634
+ key: 'F10'
635
+ },
636
+ F11: {
637
+ keyCode: 122,
638
+ code: 'F11',
639
+ key: 'F11'
640
+ },
641
+ F12: {
642
+ keyCode: 123,
643
+ code: 'F12',
644
+ key: 'F12'
645
+ },
646
+ F13: {
647
+ keyCode: 124,
648
+ code: 'F13',
649
+ key: 'F13'
650
+ },
651
+ F14: {
652
+ keyCode: 125,
653
+ code: 'F14',
654
+ key: 'F14'
655
+ },
656
+ F15: {
657
+ keyCode: 126,
658
+ code: 'F15',
659
+ key: 'F15'
660
+ },
661
+ F16: {
662
+ keyCode: 127,
663
+ code: 'F16',
664
+ key: 'F16'
665
+ },
666
+ F17: {
667
+ keyCode: 128,
668
+ code: 'F17',
669
+ key: 'F17'
670
+ },
671
+ F18: {
672
+ keyCode: 129,
673
+ code: 'F18',
674
+ key: 'F18'
675
+ },
676
+ F19: {
677
+ keyCode: 130,
678
+ code: 'F19',
679
+ key: 'F19'
680
+ },
681
+ F20: {
682
+ keyCode: 131,
683
+ code: 'F20',
684
+ key: 'F20'
685
+ },
686
+ F21: {
687
+ keyCode: 132,
688
+ code: 'F21',
689
+ key: 'F21'
690
+ },
691
+ F22: {
692
+ keyCode: 133,
693
+ code: 'F22',
694
+ key: 'F22'
695
+ },
696
+ F23: {
697
+ keyCode: 134,
698
+ code: 'F23',
699
+ key: 'F23'
700
+ },
701
+ F24: {
702
+ keyCode: 135,
703
+ code: 'F24',
704
+ key: 'F24'
705
+ },
706
+ NumLock: {
707
+ keyCode: 144,
708
+ code: 'NumLock',
709
+ key: 'NumLock'
710
+ },
711
+ ScrollLock: {
712
+ keyCode: 145,
713
+ code: 'ScrollLock',
714
+ key: 'ScrollLock'
715
+ },
716
+ AudioVolumeMute: {
717
+ keyCode: 173,
718
+ code: 'AudioVolumeMute',
719
+ key: 'AudioVolumeMute'
720
+ },
721
+ AudioVolumeDown: {
722
+ keyCode: 174,
723
+ code: 'AudioVolumeDown',
724
+ key: 'AudioVolumeDown'
725
+ },
726
+ AudioVolumeUp: {
727
+ keyCode: 175,
728
+ code: 'AudioVolumeUp',
729
+ key: 'AudioVolumeUp'
730
+ },
731
+ MediaTrackNext: {
732
+ keyCode: 176,
733
+ code: 'MediaTrackNext',
734
+ key: 'MediaTrackNext'
735
+ },
736
+ MediaTrackPrevious: {
737
+ keyCode: 177,
738
+ code: 'MediaTrackPrevious',
739
+ key: 'MediaTrackPrevious'
740
+ },
741
+ MediaStop: {
742
+ keyCode: 178,
743
+ code: 'MediaStop',
744
+ key: 'MediaStop'
745
+ },
746
+ MediaPlayPause: {
747
+ keyCode: 179,
748
+ code: 'MediaPlayPause',
749
+ key: 'MediaPlayPause'
750
+ },
751
+ Semicolon: {
752
+ keyCode: 186,
753
+ code: 'Semicolon',
754
+ shiftKey: ':',
755
+ key: ';'
756
+ },
757
+ Equal: {
758
+ keyCode: 187,
759
+ code: 'Equal',
760
+ shiftKey: '+',
761
+ key: '='
762
+ },
763
+ NumpadEqual: {
764
+ keyCode: 187,
765
+ code: 'NumpadEqual',
766
+ key: '=',
767
+ location: 3
768
+ },
769
+ Comma: {
770
+ keyCode: 188,
771
+ code: 'Comma',
772
+ shiftKey: '<',
773
+ key: ','
774
+ },
775
+ Minus: {
776
+ keyCode: 189,
777
+ code: 'Minus',
778
+ shiftKey: '_',
779
+ key: '-'
780
+ },
781
+ Period: {
782
+ keyCode: 190,
783
+ code: 'Period',
784
+ shiftKey: '>',
785
+ key: '.'
786
+ },
787
+ Slash: {
788
+ keyCode: 191,
789
+ code: 'Slash',
790
+ shiftKey: '?',
791
+ key: '/'
792
+ },
793
+ Backquote: {
794
+ keyCode: 192,
795
+ code: 'Backquote',
796
+ shiftKey: '~',
797
+ key: '`'
798
+ },
799
+ BracketLeft: {
800
+ keyCode: 219,
801
+ code: 'BracketLeft',
802
+ shiftKey: '{',
803
+ key: '['
804
+ },
805
+ Backslash: {
806
+ keyCode: 220,
807
+ code: 'Backslash',
808
+ shiftKey: '|',
809
+ key: '\\'
810
+ },
811
+ BracketRight: {
812
+ keyCode: 221,
813
+ code: 'BracketRight',
814
+ shiftKey: '}',
815
+ key: ']'
816
+ },
817
+ Quote: {
818
+ keyCode: 222,
819
+ code: 'Quote',
820
+ shiftKey: '"',
821
+ key: "'"
822
+ },
823
+ AltGraph: {
824
+ keyCode: 225,
825
+ code: 'AltGraph',
826
+ key: 'AltGraph'
827
+ },
828
+ Props: {
829
+ keyCode: 247,
830
+ code: 'Props',
831
+ key: 'CrSel'
832
+ },
833
+ Cancel: {
834
+ keyCode: 3,
835
+ key: 'Cancel',
836
+ code: 'Abort'
837
+ },
838
+ Clear: {
839
+ keyCode: 12,
840
+ key: 'Clear',
841
+ code: 'Numpad5',
842
+ location: 3
843
+ },
844
+ Shift: {
845
+ keyCode: 16,
846
+ key: 'Shift',
847
+ code: 'ShiftLeft',
848
+ location: 1
849
+ },
850
+ Control: {
851
+ keyCode: 17,
852
+ key: 'Control',
853
+ code: 'ControlLeft',
854
+ location: 1
855
+ },
856
+ Alt: {
857
+ keyCode: 18,
858
+ key: 'Alt',
859
+ code: 'AltLeft',
860
+ location: 1
861
+ },
862
+ Accept: {
863
+ keyCode: 30,
864
+ key: 'Accept'
865
+ },
866
+ ModeChange: {
867
+ keyCode: 31,
868
+ key: 'ModeChange'
869
+ },
870
+ ' ': {
871
+ keyCode: 32,
872
+ key: ' ',
873
+ code: 'Space'
874
+ },
875
+ Print: {
876
+ keyCode: 42,
877
+ key: 'Print'
878
+ },
879
+ Execute: {
880
+ keyCode: 43,
881
+ key: 'Execute',
882
+ code: 'Open'
883
+ },
884
+ '\u0000': {
885
+ keyCode: 46,
886
+ key: '\u0000',
887
+ code: 'NumpadDecimal',
888
+ location: 3
889
+ },
890
+ a: {
891
+ keyCode: 65,
892
+ key: 'a',
893
+ code: 'KeyA'
894
+ },
895
+ b: {
896
+ keyCode: 66,
897
+ key: 'b',
898
+ code: 'KeyB'
899
+ },
900
+ c: {
901
+ keyCode: 67,
902
+ key: 'c',
903
+ code: 'KeyC'
904
+ },
905
+ d: {
906
+ keyCode: 68,
907
+ key: 'd',
908
+ code: 'KeyD'
909
+ },
910
+ e: {
911
+ keyCode: 69,
912
+ key: 'e',
913
+ code: 'KeyE'
914
+ },
915
+ f: {
916
+ keyCode: 70,
917
+ key: 'f',
918
+ code: 'KeyF'
919
+ },
920
+ g: {
921
+ keyCode: 71,
922
+ key: 'g',
923
+ code: 'KeyG'
924
+ },
925
+ h: {
926
+ keyCode: 72,
927
+ key: 'h',
928
+ code: 'KeyH'
929
+ },
930
+ i: {
931
+ keyCode: 73,
932
+ key: 'i',
933
+ code: 'KeyI'
934
+ },
935
+ j: {
936
+ keyCode: 74,
937
+ key: 'j',
938
+ code: 'KeyJ'
939
+ },
940
+ k: {
941
+ keyCode: 75,
942
+ key: 'k',
943
+ code: 'KeyK'
944
+ },
945
+ l: {
946
+ keyCode: 76,
947
+ key: 'l',
948
+ code: 'KeyL'
949
+ },
950
+ m: {
951
+ keyCode: 77,
952
+ key: 'm',
953
+ code: 'KeyM'
954
+ },
955
+ n: {
956
+ keyCode: 78,
957
+ key: 'n',
958
+ code: 'KeyN'
959
+ },
960
+ o: {
961
+ keyCode: 79,
962
+ key: 'o',
963
+ code: 'KeyO'
964
+ },
965
+ p: {
966
+ keyCode: 80,
967
+ key: 'p',
968
+ code: 'KeyP'
969
+ },
970
+ q: {
971
+ keyCode: 81,
972
+ key: 'q',
973
+ code: 'KeyQ'
974
+ },
975
+ r: {
976
+ keyCode: 82,
977
+ key: 'r',
978
+ code: 'KeyR'
979
+ },
980
+ s: {
981
+ keyCode: 83,
982
+ key: 's',
983
+ code: 'KeyS'
984
+ },
985
+ t: {
986
+ keyCode: 84,
987
+ key: 't',
988
+ code: 'KeyT'
989
+ },
990
+ u: {
991
+ keyCode: 85,
992
+ key: 'u',
993
+ code: 'KeyU'
994
+ },
995
+ v: {
996
+ keyCode: 86,
997
+ key: 'v',
998
+ code: 'KeyV'
999
+ },
1000
+ w: {
1001
+ keyCode: 87,
1002
+ key: 'w',
1003
+ code: 'KeyW'
1004
+ },
1005
+ x: {
1006
+ keyCode: 88,
1007
+ key: 'x',
1008
+ code: 'KeyX'
1009
+ },
1010
+ y: {
1011
+ keyCode: 89,
1012
+ key: 'y',
1013
+ code: 'KeyY'
1014
+ },
1015
+ z: {
1016
+ keyCode: 90,
1017
+ key: 'z',
1018
+ code: 'KeyZ'
1019
+ },
1020
+ Meta: {
1021
+ keyCode: 91,
1022
+ key: 'Meta',
1023
+ code: 'MetaLeft',
1024
+ location: 1
1025
+ },
1026
+ '*': {
1027
+ keyCode: 106,
1028
+ key: '*',
1029
+ code: 'NumpadMultiply',
1030
+ location: 3
1031
+ },
1032
+ '+': {
1033
+ keyCode: 107,
1034
+ key: '+',
1035
+ code: 'NumpadAdd',
1036
+ location: 3
1037
+ },
1038
+ '-': {
1039
+ keyCode: 109,
1040
+ key: '-',
1041
+ code: 'NumpadSubtract',
1042
+ location: 3
1043
+ },
1044
+ '/': {
1045
+ keyCode: 111,
1046
+ key: '/',
1047
+ code: 'NumpadDivide',
1048
+ location: 3
1049
+ },
1050
+ ';': {
1051
+ keyCode: 186,
1052
+ key: ';',
1053
+ code: 'Semicolon'
1054
+ },
1055
+ '=': {
1056
+ keyCode: 187,
1057
+ key: '=',
1058
+ code: 'Equal'
1059
+ },
1060
+ ',': {
1061
+ keyCode: 188,
1062
+ key: ',',
1063
+ code: 'Comma'
1064
+ },
1065
+ '.': {
1066
+ keyCode: 190,
1067
+ key: '.',
1068
+ code: 'Period'
1069
+ },
1070
+ '`': {
1071
+ keyCode: 192,
1072
+ key: '`',
1073
+ code: 'Backquote'
1074
+ },
1075
+ '[': {
1076
+ keyCode: 219,
1077
+ key: '[',
1078
+ code: 'BracketLeft'
1079
+ },
1080
+ '\\': {
1081
+ keyCode: 220,
1082
+ key: '\\',
1083
+ code: 'Backslash'
1084
+ },
1085
+ ']': {
1086
+ keyCode: 221,
1087
+ key: ']',
1088
+ code: 'BracketRight'
1089
+ },
1090
+ "'": {
1091
+ keyCode: 222,
1092
+ key: "'",
1093
+ code: 'Quote'
1094
+ },
1095
+ Attn: {
1096
+ keyCode: 246,
1097
+ key: 'Attn'
1098
+ },
1099
+ CrSel: {
1100
+ keyCode: 247,
1101
+ key: 'CrSel',
1102
+ code: 'Props'
1103
+ },
1104
+ ExSel: {
1105
+ keyCode: 248,
1106
+ key: 'ExSel'
1107
+ },
1108
+ EraseEof: {
1109
+ keyCode: 249,
1110
+ key: 'EraseEof'
1111
+ },
1112
+ Play: {
1113
+ keyCode: 250,
1114
+ key: 'Play'
1115
+ },
1116
+ ZoomOut: {
1117
+ keyCode: 251,
1118
+ key: 'ZoomOut'
1119
+ },
1120
+ ')': {
1121
+ keyCode: 48,
1122
+ key: ')',
1123
+ code: 'Digit0'
1124
+ },
1125
+ '!': {
1126
+ keyCode: 49,
1127
+ key: '!',
1128
+ code: 'Digit1'
1129
+ },
1130
+ '@': {
1131
+ keyCode: 50,
1132
+ key: '@',
1133
+ code: 'Digit2'
1134
+ },
1135
+ '#': {
1136
+ keyCode: 51,
1137
+ key: '#',
1138
+ code: 'Digit3'
1139
+ },
1140
+ $: {
1141
+ keyCode: 52,
1142
+ key: '$',
1143
+ code: 'Digit4'
1144
+ },
1145
+ '%': {
1146
+ keyCode: 53,
1147
+ key: '%',
1148
+ code: 'Digit5'
1149
+ },
1150
+ '^': {
1151
+ keyCode: 54,
1152
+ key: '^',
1153
+ code: 'Digit6'
1154
+ },
1155
+ '&': {
1156
+ keyCode: 55,
1157
+ key: '&',
1158
+ code: 'Digit7'
1159
+ },
1160
+ '(': {
1161
+ keyCode: 57,
1162
+ key: '(',
1163
+ code: 'Digit9'
1164
+ },
1165
+ A: {
1166
+ keyCode: 65,
1167
+ key: 'A',
1168
+ code: 'KeyA'
1169
+ },
1170
+ B: {
1171
+ keyCode: 66,
1172
+ key: 'B',
1173
+ code: 'KeyB'
1174
+ },
1175
+ C: {
1176
+ keyCode: 67,
1177
+ key: 'C',
1178
+ code: 'KeyC'
1179
+ },
1180
+ D: {
1181
+ keyCode: 68,
1182
+ key: 'D',
1183
+ code: 'KeyD'
1184
+ },
1185
+ E: {
1186
+ keyCode: 69,
1187
+ key: 'E',
1188
+ code: 'KeyE'
1189
+ },
1190
+ F: {
1191
+ keyCode: 70,
1192
+ key: 'F',
1193
+ code: 'KeyF'
1194
+ },
1195
+ G: {
1196
+ keyCode: 71,
1197
+ key: 'G',
1198
+ code: 'KeyG'
1199
+ },
1200
+ H: {
1201
+ keyCode: 72,
1202
+ key: 'H',
1203
+ code: 'KeyH'
1204
+ },
1205
+ I: {
1206
+ keyCode: 73,
1207
+ key: 'I',
1208
+ code: 'KeyI'
1209
+ },
1210
+ J: {
1211
+ keyCode: 74,
1212
+ key: 'J',
1213
+ code: 'KeyJ'
1214
+ },
1215
+ K: {
1216
+ keyCode: 75,
1217
+ key: 'K',
1218
+ code: 'KeyK'
1219
+ },
1220
+ L: {
1221
+ keyCode: 76,
1222
+ key: 'L',
1223
+ code: 'KeyL'
1224
+ },
1225
+ M: {
1226
+ keyCode: 77,
1227
+ key: 'M',
1228
+ code: 'KeyM'
1229
+ },
1230
+ N: {
1231
+ keyCode: 78,
1232
+ key: 'N',
1233
+ code: 'KeyN'
1234
+ },
1235
+ O: {
1236
+ keyCode: 79,
1237
+ key: 'O',
1238
+ code: 'KeyO'
1239
+ },
1240
+ P: {
1241
+ keyCode: 80,
1242
+ key: 'P',
1243
+ code: 'KeyP'
1244
+ },
1245
+ Q: {
1246
+ keyCode: 81,
1247
+ key: 'Q',
1248
+ code: 'KeyQ'
1249
+ },
1250
+ R: {
1251
+ keyCode: 82,
1252
+ key: 'R',
1253
+ code: 'KeyR'
1254
+ },
1255
+ S: {
1256
+ keyCode: 83,
1257
+ key: 'S',
1258
+ code: 'KeyS'
1259
+ },
1260
+ T: {
1261
+ keyCode: 84,
1262
+ key: 'T',
1263
+ code: 'KeyT'
1264
+ },
1265
+ U: {
1266
+ keyCode: 85,
1267
+ key: 'U',
1268
+ code: 'KeyU'
1269
+ },
1270
+ V: {
1271
+ keyCode: 86,
1272
+ key: 'V',
1273
+ code: 'KeyV'
1274
+ },
1275
+ W: {
1276
+ keyCode: 87,
1277
+ key: 'W',
1278
+ code: 'KeyW'
1279
+ },
1280
+ X: {
1281
+ keyCode: 88,
1282
+ key: 'X',
1283
+ code: 'KeyX'
1284
+ },
1285
+ Y: {
1286
+ keyCode: 89,
1287
+ key: 'Y',
1288
+ code: 'KeyY'
1289
+ },
1290
+ Z: {
1291
+ keyCode: 90,
1292
+ key: 'Z',
1293
+ code: 'KeyZ'
1294
+ },
1295
+ ':': {
1296
+ keyCode: 186,
1297
+ key: ':',
1298
+ code: 'Semicolon'
1299
+ },
1300
+ '<': {
1301
+ keyCode: 188,
1302
+ key: '<',
1303
+ code: 'Comma'
1304
+ },
1305
+ _: {
1306
+ keyCode: 189,
1307
+ key: '_',
1308
+ code: 'Minus'
1309
+ },
1310
+ '>': {
1311
+ keyCode: 190,
1312
+ key: '>',
1313
+ code: 'Period'
1314
+ },
1315
+ '?': {
1316
+ keyCode: 191,
1317
+ key: '?',
1318
+ code: 'Slash'
1319
+ },
1320
+ '~': {
1321
+ keyCode: 192,
1322
+ key: '~',
1323
+ code: 'Backquote'
1324
+ },
1325
+ '{': {
1326
+ keyCode: 219,
1327
+ key: '{',
1328
+ code: 'BracketLeft'
1329
+ },
1330
+ '|': {
1331
+ keyCode: 220,
1332
+ key: '|',
1333
+ code: 'Backslash'
1334
+ },
1335
+ '}': {
1336
+ keyCode: 221,
1337
+ key: '}',
1338
+ code: 'BracketRight'
1339
+ },
1340
+ '"': {
1341
+ keyCode: 222,
1342
+ key: '"',
1343
+ code: 'Quote'
1344
+ },
1345
+ SoftLeft: {
1346
+ key: 'SoftLeft',
1347
+ code: 'SoftLeft',
1348
+ location: 4
1349
+ },
1350
+ SoftRight: {
1351
+ key: 'SoftRight',
1352
+ code: 'SoftRight',
1353
+ location: 4
1354
+ },
1355
+ Camera: {
1356
+ keyCode: 44,
1357
+ key: 'Camera',
1358
+ code: 'Camera',
1359
+ location: 4
1360
+ },
1361
+ Call: {
1362
+ key: 'Call',
1363
+ code: 'Call',
1364
+ location: 4
1365
+ },
1366
+ EndCall: {
1367
+ keyCode: 95,
1368
+ key: 'EndCall',
1369
+ code: 'EndCall',
1370
+ location: 4
1371
+ },
1372
+ VolumeDown: {
1373
+ keyCode: 182,
1374
+ key: 'VolumeDown',
1375
+ code: 'VolumeDown',
1376
+ location: 4
1377
+ },
1378
+ VolumeUp: {
1379
+ keyCode: 183,
1380
+ key: 'VolumeUp',
1381
+ code: 'VolumeUp',
1382
+ location: 4
1383
+ }
1384
+ };
1385
+ const lowerCaseKeyDefinitions = Object.entries(_keyDefinitions).reduce((acc, [key, definition])=>{
1386
+ const lowerKey = key.toLowerCase();
1387
+ if (lowerKey !== key) acc[lowerKey] = definition;
1388
+ return acc;
1389
+ }, {});
1390
+ const getKeyDefinition = (key)=>{
1391
+ const lowerKey = key.toLowerCase();
1392
+ if (lowerCaseKeyDefinitions[lowerKey]) return lowerCaseKeyDefinitions[lowerKey].key;
1393
+ return key;
1394
+ };
1395
+ const isMac = 'undefined' != typeof window ? /Mac|iPod|iPhone|iPad/.test(window.navigator.platform) : 'darwin' === process.platform;
1396
+ const keyMap = {
1397
+ return: _keyDefinitions.Enter.key,
1398
+ enter: _keyDefinitions.Enter.key,
1399
+ ctrl: isMac ? _keyDefinitions.Meta.key : _keyDefinitions.Control.key,
1400
+ shift: _keyDefinitions.Shift.key,
1401
+ alt: _keyDefinitions.Alt.key,
1402
+ space: _keyDefinitions.Space.key,
1403
+ 'page down': _keyDefinitions.PageDown.key,
1404
+ pagedown: _keyDefinitions.PageDown.key,
1405
+ 'page up': _keyDefinitions.PageUp.key,
1406
+ pageup: _keyDefinitions.PageUp.key
1407
+ };
1408
+ function transformHotkeyInput(keyInput) {
1409
+ if (keyMap[keyInput.toLowerCase()]) return [
1410
+ getKeyDefinition(keyMap[keyInput.toLowerCase()])
1411
+ ];
1412
+ return keyInput.split(' ').map((key)=>getKeyDefinition(keyMap[key.toLowerCase()] || key));
1413
+ }
1414
+ export { _keyDefinitions, getKeyDefinition, isMac, transformHotkeyInput };