-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathparser-short.js
More file actions
3246 lines (3230 loc) · 170 KB
/
parser-short.js
File metadata and controls
3246 lines (3230 loc) · 170 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
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
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
import { toHex, joinHex, readIntLE, errDataExpected, errUnexpectedEnd, formatByteSequence } from "./utils.js";
const usagePages = {
0x00: "Undefined",
0x01: "Generic Desktop Page",
0x02: "Simulation Controls Page",
0x03: "VR Controls Page",
0x04: "Sport Controls Page",
0x05: "Game Controls Page",
0x06: "Generic Device Controls Page",
0x07: "Keyboard/Keypad Page",
0x08: "LED Page",
0x09: "Button Page",
0x0A: "Ordinal Page",
0x0B: "Telephony Device Page",
0x0C: "Consumer Page",
0x0D: "Digitizers Page",
0x0E: "Haptics Page",
0x0F: "Physical Input Device Page",
0x10: "Unicode Page",
0x11: "SoC Page",
0x12: "Eye and Head Trackers Page",
0x14: "Auxiliary Display Page",
0x20: "Sensors Page",
0x40: "Medical Instrument Page",
0x41: "Braille Display Page",
0x59: "Lighting and Illumination Page",
0x80: "Monitor Page",
0x81: "Monitor Enumerated Page",
0x82: "VESA Virtual Controls Page",
0x84: "Power Page",
0x85: "Battery System Page",
0x8C: "Barcode Scanner Page",
0x8D: "Scale Page",
0x8E: "Magnetic Stripe Reader Page",
0x90: "Camera Control Page",
0x91: "Arcade Page",
0x92: "Gaming Device Page",
0xF1D0: "FIDO Alliance Page",
};
const collectionTypes = {
0x00: "Physical",
0x01: "Application",
0x02: "Logical",
0x03: "Report",
0x04: "Named Array",
0x05: "Usage Switch",
0x06: "Usage Modifier"
};
function getUsage(usagePage, usageId) {
if (usagePage === null) {
return null
}
switch (usagePage) {
case 0x01:
switch (usageId) {
case 0x00: return "Undefined";
case 0x01: return "Pointer";
case 0x02: return "Mouse";
case 0x04: return "Joystick";
case 0x05: return "Gamepad";
case 0x06: return "Keyboard";
case 0x07: return "Keypad";
case 0x08: return "Multi-axis Controller";
case 0x09: return "Tablet PC System Controls";
case 0x0A: return "Water Cooling Device";
case 0x0B: return "Computer Chassis Device";
case 0x0C: return "Wireless Radio Controls";
case 0x0D: return "Portable Device Control";
case 0x0E: return "System Multi-Axis Controller";
case 0x0F: return "Spatial Controller";
case 0x10: return "Assistive Control";
case 0x11: return "Device Dock";
case 0x12: return "Dockable Device";
case 0x13: return "Call State Management Control";
case 0x30: return "X";
case 0x31: return "Y";
case 0x32: return "Z";
case 0x33: return "Rx";
case 0x34: return "Ry";
case 0x35: return "Rz";
case 0x36: return "Slider";
case 0x37: return "Dial";
case 0x38: return "Wheel";
case 0x39: return "Hat Switch";
case 0x3A: return "Counted Buffer";
case 0x3B: return "Byte Count";
case 0x3C: return "Motion Wakeup";
case 0x3D: return "Start";
case 0x3E: return "Select";
case 0x40: return "Vx";
case 0x41: return "Vy";
case 0x42: return "Vz";
case 0x43: return "Vbrx";
case 0x44: return "Vbry";
case 0x45: return "Vbrz";
case 0x46: return "Vno";
case 0x47: return "Feature Notification";
case 0x48: return "Resolution Multiplier";
case 0x49: return "Qx";
case 0x4A: return "Qy";
case 0x4B: return "Qz";
case 0x4C: return "Qw";
case 0x80: return "System Control";
case 0x81: return "System Power Down";
case 0x82: return "System Sleep";
case 0x83: return "System Wake Up";
case 0x84: return "System Context Menu";
case 0x85: return "System Main Menu";
case 0x86: return "System App Menu";
case 0x87: return "System Menu Help";
case 0x88: return "System Menu Exit";
case 0x89: return "System Menu Select";
case 0x8A: return "System Menu Right";
case 0x8B: return "System Menu Left";
case 0x8C: return "System Menu Up";
case 0x8D: return "System Menu Down";
case 0x8E: return "System Cold Restart";
case 0x8F: return "System Warm Restart";
case 0x90: return "D-pad Up";
case 0x91: return "D-pad Down";
case 0x92: return "D-pad Right";
case 0x93: return "D-pad Left";
case 0x94: return "Index Trigger";
case 0x95: return "Palm Trigger";
case 0x96: return "Thumbstick";
case 0x97: return "System Function Shift";
case 0x98: return "System Function Shift Lock";
case 0x99: return "System Function Shift Lock Indicator";
case 0x9A: return "System Dismiss Notification";
case 0x9B: return "System Do Not Disturb";
case 0xA0: return "System Dock";
case 0xA1: return "System Undock";
case 0xA2: return "System Setup";
case 0xA3: return "System Break";
case 0xA4: return "System Debugger Break";
case 0xA5: return "Application Break";
case 0xA6: return "Application Debugger Break";
case 0xA7: return "System Speaker Mute";
case 0xA8: return "System Hibernate";
case 0xA9: return "System Microphone Mute";
case 0xAA: return "System Accessibility Binding";
case 0xB0: return "System Display Invert";
case 0xB1: return "System Display Internal";
case 0xB2: return "System Display External";
case 0xB3: return "System Display Both";
case 0xB4: return "System Display Dual";
case 0xB5: return "System Display Toggle Int/Ext Mode";
case 0xB6: return "System Display Swap Primary/Secondary";
case 0xB7: return "System Display Toggle LCD Autoscale";
case 0xC0: return "Sensor Zone";
case 0xC1: return "RPM";
case 0xC2: return "Coolant Level";
case 0xC3: return "Coolant Critical Level";
case 0xC4: return "Coolant Pump";
case 0xC5: return "Chassis Enclosure";
case 0xC6: return "Wireless Radio Button";
case 0xC7: return "Wireless Radio LED";
case 0xC8: return "Wireless Radio Slider Switch";
case 0xC9: return "System Display Rotation Lock Button";
case 0xCA: return "System Display Rotation Lock Slider Switch";
case 0xCB: return "Control Enable";
case 0xD0: return "Dockable Device Unique ID";
case 0xD1: return "Dockable Device Vendor ID";
case 0xD2: return "Dockable Device Primary Usage Page";
case 0xD3: return "Dockable Device Primary Usage ID";
case 0xD4: return "Dockable Device Docking State";
case 0xD5: return "Dockable Device Display Occlusion";
case 0xD6: return "Dockable Device Object Type";
case 0xE0: return "Call Active LED";
case 0xE1: return "Call Mute Toggle";
case 0xE2: return "Call Mute LED";
default:
return "Reserved"
};
case 0x02:
switch (usageId) {
case 0x00: return "Undefined";
case 0x01: return "Flight Simulation Device";
case 0x02: return "Automobile Simulation Device";
case 0x03: return "Tank Simulation Device";
case 0x04: return "Spaceship Simulation Device";
case 0x05: return "Submarine Simulation Device";
case 0x06: return "Sailing Simulation Device";
case 0x07: return "Motorcycle Simulation Device";
case 0x08: return "Sports Simulation Device";
case 0x09: return "Airplane Simulation Device";
case 0x0A: return "Helicopter Simulation Device";
case 0x0B: return "Magic Carpet Simulation Device";
case 0x0C: return "Bicycle Simulation Device";
case 0x20: return "Flight Control Stick";
case 0x21: return "Flight Stick";
case 0x22: return "Cyclic Control";
case 0x23: return "Cyclic Trim";
case 0x24: return "Flight Yoke";
case 0x25: return "Track Control";
case 0xB0: return "Aileron";
case 0xB1: return "Aileron Trim";
case 0xB2: return "Anti-Torque Control";
case 0xB3: return "Autopilot Enable";
case 0xB4: return "Chaff Release";
case 0xB5: return "Collective Control";
case 0xB6: return "Dive Brake";
case 0xB7: return "Electronic Countermeasures";
case 0xB8: return "Elevator";
case 0xB9: return "Elevator Trim";
case 0xBA: return "Rudder";
case 0xBB: return "Throttle";
case 0xBC: return "Flight Communications";
case 0xBD: return "Flare Release";
case 0xBE: return "Landing Gear";
case 0xBF: return "Toe Brake";
case 0xC0: return "Trigger";
case 0xC1: return "Weapons Arm";
case 0xC2: return "Weapons Select";
case 0x61: return "";
case 0xC3: return "Wing Flaps";
case 0xC4: return "Accelerator";
case 0xC5: return "Brake";
case 0xC6: return "Clutch";
case 0xC7: return "Shifter";
case 0xC8: return "Steering";
case 0xC9: return "Turret Direction";
case 0xCA: return "Barrel Elevation";
case 0xCB: return "Dive Plane";
case 0xCC: return "Ballast";
case 0xCD: return "Bicycle Crank";
case 0xCE: return "Handle Bars";
case 0xCF: return "Front Brake";
case 0xD0: return "Rear Brake";
default: return "Reserved";
}
case 0x03:
switch (usageId) {
case 0x00: return "Undefined";
case 0x01: return "Belt";
case 0x02: return "Body Suit";
case 0x03: return "Flexor";
case 0x04: return "Glove";
case 0x05: return "Head Tracker";
case 0x06: return "Head Mounted Display";
case 0x07: return "Hand Tracker";
case 0x08: return "Oculometer";
case 0x09: return "Vest";
case 0x0A: return "Animatronic Device";
case 0x20: return "Stereo Enable";
case 0x21: return "Display Enable";
default: return "Reserved";
}
case 0x04:
switch (usageId) {
case 0x00: return "Undefined";
case 0x01: return "Baseball Bat";
case 0x02: return "Golf Club";
case 0x03: return "Rowing Machine";
case 0x04: return "Treadmill";
case 0x30: return "Oar";
case 0x31: return "Slope";
case 0x32: return "Rate";
case 0x33: return "Stick Speed";
case 0x34: return "Stick Face Angle";
case 0x35: return "Stick Heel Toe";
case 0x36: return "Stick Follow Through";
case 0x37: return "Stick Tempo";
case 0x38: return "Stick Type";
case 0x39: return "Stick Height";
case 0x50: return "Putter";
case 0x51: return "1 Iron";
case 0x52: return "2 Iron";
case 0x53: return "3 Iron";
case 0x54: return "4 Iron";
case 0x55: return "5 Iron";
case 0x56: return "6 Iron";
case 0x57: return "7 Iron";
case 0x58: return "8 Iron";
case 0x59: return "9 Iron";
case 0x5A: return "10 Iron";
case 0x5B: return "11 Iron";
case 0x5C: return "Sand Wedge";
case 0x5D: return "Loft Wedge";
case 0x5E: return "Power Wedge";
case 0x5F: return "1 Wood";
case 0x60: return "3 Wood";
case 0x61: return "5 Wood";
case 0x62: return "7 Wood";
case 0x63: return "9 Wood";
default: return "Reserved";
}
case 0x05:
switch (usageId) {
case 0x00: return "Undefined";
case 0x01: return "3D Game Controller";
case 0x02: return "Pinball Device";
case 0x03: return "Gun Device";
case 0x20: return "Point of View";
case 0x21: return "Turn Right Left";
case 0x22: return "Pitch Forward Backward";
case 0x23: return "Roll Right Left";
case 0x24: return "Move Right Left";
case 0x25: return "Move Forward Backward";
case 0x26: return "Move Up Down";
case 0x27: return "Lean Right Left";
case 0x28: return "Lean Forward Backward";
case 0x29: return "Height of POV";
case 0x2A: return "Flipper";
case 0x2B: return "Secondary Flipper";
case 0x2C: return "Bump";
case 0x2D: return "New Game";
case 0x2E: return "Shoot Ball";
case 0x2F: return "Player";
case 0x30: return "Gun Bolt";
case 0x31: return "Gun Clip";
case 0x32: return "Gun Selector";
case 0x33: return "Gun Single Shot";
case 0x34: return "Gun Burst";
case 0x35: return "Gun Automatic";
case 0x36: return "Gun Safety";
case 0x37: return "Gamepad Fire Jump";
case 0x39: return "Gamepad Trigger";
case 0x3A: return "Form-fitting Gamepad";
default: return "Reserved";
}
case 0x06:
switch (usageId) {
case 0x00: return "Undefined";
case 0x01: return "Background Nonuser Controls";
case 0x20: return "Battery Strength";
case 0x21: return "Wireless Channel";
case 0x22: return "Wireless ID";
case 0x23: return "Discover Wireless Control";
case 0x24: return "Security Code Character Entered";
case 0x25: return "Security Code Character Erased";
case 0x26: return "Security Code Cleared";
case 0x27: return "Sequence ID";
case 0x28: return "Sequence ID Reset";
case 0x29: return "RF Signal Strength";
case 0x2A: return "Software Version";
case 0x2B: return "Protocol Version";
case 0x2C: return "Hardware Version";
case 0x2D: return "Major";
case 0x2E: return "Minor";
case 0x2F: return "Revision";
case 0x30: return "Handedness";
case 0x31: return "Either Hand";
case 0x32: return "Left Hand";
case 0x33: return "Right Hand";
case 0x34: return "Both Hands";
case 0x40: return "Grip Pose Offset";
case 0x41: return "Pointer Pose Offset";
default: return "Reserved";
}
case 0x07:
switch (usageId) {
case 0x01: return "Keyboard ErrorRollOver";
case 0x02: return "Keyboard POSTFail";
case 0x03: return "Keyboard ErrorUndefined";
case 0x04: return "Keyboard a and A";
case 0x05: return "Keyboard b and B";
case 0x06: return "Keyboard c and C";
case 0x07: return "Keyboard d and D";
case 0x08: return "Keyboard e and E";
case 0x09: return "Keyboard f and F";
case 0x0A: return "Keyboard g and G";
case 0x0B: return "Keyboard h and H";
case 0x0C: return "Keyboard i and I";
case 0x0D: return "Keyboard j and J";
case 0x0E: return "Keyboard k and K";
case 0x0F: return "Keyboard l and L";
case 0x10: return "Keyboard m and M";
case 0x11: return "Keyboard n and N";
case 0x12: return "Keyboard o and O";
case 0x13: return "Keyboard p and P";
case 0x14: return "Keyboard q and Q";
case 0x15: return "Keyboard r and R";
case 0x16: return "Keyboard s and S";
case 0x17: return "Keyboard t and T";
case 0x18: return "Keyboard u and U";
case 0x19: return "Keyboard v and V";
case 0x1A: return "Keyboard w and W2";
case 0x1B: return "Keyboard x and X";
case 0x1C: return "Keyboard y and Y";
case 0x1D: return "Keyboard z and Z";
case 0x1E: return "Keyboard 1 and !";
case 0x1F: return "Keyboard 2 and @";
case 0x20: return "Keyboard 3 and #";
case 0x21: return "Keyboard 4 and $";
case 0x22: return "Keyboard 5 and %";
case 0x23: return "Keyboard 6 and ∧";
case 0x24: return "Keyboard 7 and &";
case 0x25: return "Keyboard 8 and *";
case 0x26: return "Keyboard 9 and (";
case 0x27: return "Keyboard 0 and )";
case 0x28: return "Keyboard Return (ENTER)3";
case 0x29: return "Keyboard ESCAPE";
case 0x2A: return "Keyboard DELETE (Backspace)4";
case 0x2B: return "Keyboard Tab";
case 0x2C: return "Keyboard Spacebar";
case 0x2D: return "Keyboard - and _";
case 0x2E: return "Keyboard = and +";
case 0x2F: return "Keyboard [ and {";
case 0x30: return "Keyboard ] and }";
case 0x31: return "Keyboard \\ and |";
case 0x32: return "Keyboard Non-US # and ˜";
case 0x33: return "Keyboard ; and :";
case 0x34: return "Keyboard ' and \"";
case 0x35: return "Keyboard Grave Accent and Tilde2";
case 0x36: return "Keyboard , and <";
case 0x37: return "Keyboard . and >";
case 0x38: return "Keyboard and ?";
case 0x39: return "Keyboard Caps Lock6";
case 0x3A: return "Keyboard F1";
case 0x3B: return "Keyboard F2";
case 0x3C: return "Keyboard F3";
case 0x3D: return "Keyboard F4";
case 0x3E: return "Keyboard F5";
case 0x3F: return "Keyboard F6";
case 0x40: return "Keyboard F7";
case 0x41: return "Keyboard F8";
case 0x42: return "Keyboard F9";
case 0x43: return "Keyboard F10";
case 0x44: return "Keyboard F11";
case 0x45: return "Keyboard F12";
case 0x46: return "Keyboard PrintScreen";
case 0x47: return "Keyboard Scroll Lock";
case 0x48: return "Keyboard Pause";
case 0x49: return "Keyboard Insert";
case 0x4A: return "Keyboard Home";
case 0x4B: return "Keyboard PageUp";
case 0x4C: return "Keyboard Delete Forward,8";
case 0x4D: return "Keyboard End";
case 0x4E: return "Keyboard PageDown";
case 0x4F: return "Keyboard RightArrow";
case 0x50: return "Keyboard LeftArrow";
case 0x51: return "Keyboard DownArrow";
case 0x52: return "Keyboard UpArrow";
case 0x53: return "Keypad Num Lock and Clear";
case 0x54: return "Keypad";
case 0x55: return "Keypad *";
case 0x56: return "Keypad -";
case 0x57: return "Keypad +";
case 0x58: return "Keypad ENTER";
case 0x59: return "Keypad 1 and End";
case 0x5A: return "Keypad 2 and Down Arrow";
case 0x5B: return "Keypad 3 and PageDn";
case 0x5C: return "Keypad 4 and Left Arrow";
case 0x5D: return "Keypad 5";
case 0x5E: return "Keypad 6 and Right Arrow";
case 0x5F: return "Keypad 7 and Home";
case 0x60: return "Keypad 8 and Up Arrow";
case 0x61: return "Keypad 9 and PageUp";
case 0x62: return "Keypad 0 and Insert";
case 0x63: return "Keypad . and Delete";
case 0x64: return "Keyboard Non-US \and |";
case 0x65: return "Keyboard Application";
case 0x66: return "Keyboard Power";
case 0x67: return "Keypad =";
case 0x68: return "Keyboard F13";
case 0x69: return "Keyboard F14";
case 0x6A: return "Keyboard F15";
case 0x6B: return "Keyboard F16";
case 0x6C: return "Keyboard F17";
case 0x6D: return "Keyboard F18";
case 0x6E: return "Keyboard F19";
case 0x6F: return "Keyboard F20";
case 0x70: return "Keyboard F21";
case 0x71: return "Keyboard F22";
case 0x72: return "Keyboard F23";
case 0x73: return "Keyboard F24";
case 0x74: return "Keyboard Execute";
case 0x75: return "Keyboard Help";
case 0x76: return "Keyboard Menu";
case 0x77: return "Keyboard Select";
case 0x78: return "Keyboard Stop";
case 0x79: return "Keyboard Again";
case 0x7A: return "Keyboard Undo";
case 0x7B: return "Keyboard Cut";
case 0x7C: return "Keyboard Copy";
case 0x7D: return "Keyboard Paste";
case 0x7E: return "Keyboard Find";
case 0x7F: return "Keyboard Mute";
case 0x80: return "Keyboard Volume Up";
case 0x81: return "Keyboard Volume Down";
case 0x82: return "Keyboard Locking Caps Lock";
case 0x83: return "Keyboard Locking Num Lock";
case 0x84: return "Keyboard Locking Scroll Lock";
case 0x85: return "Keypad Comma";
case 0x86: return "Keypad Equal Sign";
case 0x87: return "Keyboard International1";
case 0x88: return "Keyboard International2";
case 0x89: return "Keyboard International3";
case 0x8A: return "Keyboard International4";
case 0x8B: return "Keyboard International5";
case 0x8C: return "Keyboard International6";
case 0x8D: return "Keyboard International7";
case 0x8E: return "Keyboard International8";
case 0x8F: return "Keyboard International9";
case 0x90: return "Keyboard LANG1";
case 0x91: return "Keyboard LANG2";
case 0x92: return "Keyboard LANG3";
case 0x93: return "Keyboard LANG4";
case 0x94: return "Keyboard LANG5";
case 0x95: return "Keyboard LANG6";
case 0x96: return "Keyboard LANG7";
case 0x97: return "Keyboard LANG8";
case 0x98: return "Keyboard LANG9";
case 0x99: return "Keyboard Alternate Erase";
case 0x9A: return "Keyboard SysReq Attention";
case 0x9B: return "Keyboard Cancel";
case 0x9C: return "Keyboard Clear";
case 0x9D: return "Keyboard Prior";
case 0x9E: return "Keyboard Return";
case 0x9F: return "Keyboard Separator";
case 0xA0: return "Keyboard Out";
case 0xA1: return "Keyboard Oper";
case 0xA2: return "Keyboard Clear Again";
case 0xA3: return "Keyboard CrSel Props";
case 0xA4: return "Keyboard ExSel";
case 0xB0: return "Keypad 00";
case 0xB1: return "Keypad 000";
case 0xB2: return "Thousands Separator";
case 0xB3: return "Decimal Separator";
case 0xB4: return "Currency Unit";
case 0xB5: return "Currency Sub-unit";
case 0xB6: return "Keypad (";
case 0xB7: return "Keypad )";
case 0xB8: return "Keypad {";
case 0xB9: return "Keypad }";
case 0xBA: return "Keypad Tab";
case 0xBB: return "Keypad Backspace";
case 0xBC: return "Keypad A";
case 0xBD: return "Keypad B";
case 0xBE: return "Keypad C";
case 0xBF: return "Keypad D";
case 0xC0: return "Keypad E";
case 0xC1: return "Keypad F";
case 0xC2: return "Keypad XOR";
case 0xC3: return "Keypad ∧";
case 0xC4: return "Keypad %";
case 0xC5: return "Keypad <";
case 0xC6: return "Keypad >";
case 0xC7: return "Keypad &";
case 0xC8: return "Keypad &&";
case 0xC9: return "Keypad |";
case 0xCA: return "Keypad ||";
case 0xCB: return "Keypad :";
case 0xCC: return "Keypad #";
case 0xCD: return "Keypad Space";
case 0xCE: return "Keypad @";
case 0xCF: return "Keypad !";
case 0xD0: return "Keypad Memory Store";
case 0xD1: return "Keypad Memory Recall";
case 0xD2: return "Keypad Memory Clear";
case 0xD3: return "Keypad Memory Add";
case 0xD4: return "Keypad Memory Subtract";
case 0xD5: return "Keypad Memory Multiply";
case 0xD6: return "Keypad Memory Divide";
case 0xD7: return "Keypad + -";
case 0xD8: return "Keypad Clear";
case 0xD9: return "Keypad Clear Entry";
case 0xDA: return "Keypad Binary";
case 0xDB: return "Keypad Octal";
case 0xDC: return "Keypad Decimal";
case 0xDD: return "Keypad Hexadecimal";
case 0xE0: return "Keyboard LeftControl";
case 0xE1: return "Keyboard LeftShift";
case 0xE2: return "Keyboard LeftAlt";
case 0xE3: return "Keyboard Left GUI";
case 0xE4: return "Keyboard RightControl";
case 0xE5: return "Keyboard RightShift";
case 0xE6: return "Keyboard RightAlt";
case 0xE7: return "Keyboard Right GUI";
default: return "Reserved";
}
case 0x08:
switch (usageId) {
case 0x00: return "Undefined";
case 0x01: return "Num Lock";
case 0x02: return "Caps Lock";
case 0x03: return "Scroll Lock";
case 0x04: return "Compose";
case 0x05: return "Kana";
case 0x06: return "Power";
case 0x07: return "Shift";
case 0x08: return "Do Not Disturb";
case 0x09: return "Mute";
case 0x0A: return "Tone Enable";
case 0x0B: return "High Cut Filter";
case 0x0C: return "Low Cut Filter";
case 0x0D: return "Equalizer Enable";
case 0x0E: return "Sound Field On";
case 0x0F: return "Surround On";
case 0x10: return "Repeat";
case 0x11: return "Stereo";
case 0x12: return "Sampling Rate Detect";
case 0x13: return "Spinning";
case 0x14: return "CAV";
case 0x15: return "CLV";
case 0x16: return "Recording Format Detect";
case 0x17: return "Off-Hook";
case 0x18: return "Ring";
case 0x19: return "Message Waiting";
case 0x1A: return "Data Mode";
case 0x1B: return "Battery Operation";
case 0x1C: return "Battery OK";
case 0x1D: return "Battery Low";
case 0x1E: return "Speaker";
case 0x1F: return "Headset";
case 0x20: return "Hold";
case 0x21: return "Microphone";
case 0x22: return "Coverage";
case 0x23: return "Night Mode";
case 0x24: return "Send Calls";
case 0x25: return "Call Pickup";
case 0x26: return "Conference";
case 0x27: return "Stand-by";
case 0x28: return "Camera On";
case 0x29: return "Camera Off";
case 0x2A: return "On-Line";
case 0x2B: return "Off-Line";
case 0x2C: return "Busy";
case 0x2D: return "Ready";
case 0x2E: return "Paper-Out";
case 0x2F: return "Paper-Jam";
case 0x30: return "Remote";
case 0x31: return "Forward";
case 0x32: return "Reverse";
case 0x33: return "Stop";
case 0x34: return "Rewind";
case 0x35: return "Fast Forward";
case 0x36: return "Play";
case 0x37: return "Pause";
case 0x38: return "Record";
case 0x39: return "Error";
case 0x3A: return "Usage Selected Indicator";
case 0x3B: return "Usage In Use Indicator";
case 0x3C: return "Usage Multi Mode Indicator";
case 0x3D: return "Indicator On";
case 0x3E: return "Indicator Flash";
case 0x3F: return "Indicator Slow Blink";
case 0x40: return "Indicator Fast Blink";
case 0x41: return "Indicator Off";
case 0x42: return "Flash On Time";
case 0x43: return "Slow Blink On Time";
case 0x44: return "Slow Blink Off Time";
case 0x45: return "Fast Blink On Time";
case 0x46: return "Fast Blink Off Time";
case 0x47: return "Usage Indicator Color";
case 0x48: return "Indicator Red";
case 0x49: return "Indicator Green";
case 0x4A: return "Indicator Amber";
case 0x4B: return "Generic Indicator";
case 0x4C: return "System Suspend";
case 0x4D: return "External Power Connected";
case 0x4E: return "Indicator Blue";
case 0x4F: return "Indicator Orange";
case 0x50: return "Good Status";
case 0x51: return "Warning Status";
case 0x52: return "RGB LED";
case 0x53: return "Red LED Channel";
case 0x54: return "Blue LED Channel";
case 0x55: return "Green LED Channel";
case 0x56: return "LED Intensity";
case 0x57: return "System Microphone Mute";
case 0x60: return "Player Indicator";
case 0x61: return "Player 1";
case 0x62: return "Player 2";
case 0x63: return "Player 3";
case 0x64: return "Player 4";
case 0x65: return "Player 5";
case 0x66: return "Player 6";
case 0x67: return "Player 7";
case 0x68: return "Player 8";
default: return "Reserved";
}
case 0x09:
switch (usageId) {
case 0x00: return "No Button Pressed";
case 0x01: return "Button 1 (primary trigger)";
case 0x02: return "Button 2 (secondary)";
case 0x03: return "Button 3 (tertiary)";
case 0x04: return "Button 4 See Note";
default: return `Button ${usageId}`;
}
case 0x0A:
switch (usageId) {
case 0x00: return "Reserved";
case 0x01: return "Instance 1";
case 0x02: return "Instance 2";
case 0x03: return "Instance 3";
case 0x04: return "Instance 4";
default: return `Instance ${usageId}`;
}
case 0x0B:
switch (usageId) {
case 0x00: return "Undefined";
case 0x01: return "Phone";
case 0x02: return "Answering Machine";
case 0x03: return "Message Controls";
case 0x04: return "Handset";
case 0x05: return "Headset";
case 0x06: return "Telephony Key Pad";
case 0x07: return "Programmable Button";
case 0x20: return "Hook Switch";
case 0x21: return "Flash";
case 0x22: return "Feature";
case 0x23: return "Hold";
case 0x24: return "Redial";
case 0x25: return "Transfer";
case 0x26: return "Drop";
case 0x27: return "Park";
case 0x28: return "Forward Calls";
case 0x29: return "Alternate Function";
case 0x2A: return "Line";
case 0x2B: return "Speaker Phone";
case 0x2C: return "Conference";
case 0x2D: return "Ring Enable";
case 0x2E: return "Ring Select";
case 0x2F: return "Phone Mute";
case 0x30: return "Caller ID";
case 0x31: return "Send";
case 0x50: return "Speed Dial";
case 0x51: return "Store Number";
case 0x52: return "Recall Number";
case 0x53: return "Phone Directory";
case 0x70: return "Voice Mail";
case 0x71: return "Screen Calls";
case 0x72: return "Do Not Disturb";
case 0x73: return "Message";
case 0x74: return "Answer On Off";
case 0x90: return "Inside Dial Tone";
case 0x91: return "Outside Dial Tone";
case 0x92: return "Inside Ring Tone";
case 0x93: return "Outside Ring Tone";
case 0x94: return "Priority Ring Tone";
case 0x95: return "Inside Ringback";
case 0x96: return "Priority Ringback";
case 0x97: return "Line Busy Tone";
case 0x98: return "Reorder Tone";
case 0x99: return "Call Waiting Tone";
case 0x9A: return "Confirmation Tone 1";
case 0x9B: return "Confirmation Tone 2";
case 0x9C: return "Tones Off";
case 0x9D: return "Outside Ringback";
case 0x9E: return "Ringer";
case 0xB0: return "Phone Key 0";
case 0xB1: return "Phone Key 1";
case 0xB2: return "Phone Key 2";
case 0xB3: return "Phone Key 3";
case 0xB4: return "Phone Key 4";
case 0xB5: return "Phone Key 5";
case 0xB6: return "Phone Key 6";
case 0xB7: return "Phone Key 7";
case 0xB8: return "Phone Key 8";
case 0xB9: return "Phone Key 9";
case 0xBA: return "Phone Key Star";
case 0xBB: return "Phone Key Pound";
case 0xBC: return "Phone Key A";
case 0xBD: return "Phone Key B";
case 0xBE: return "Phone Key C";
case 0xBF: return "Phone Key D";
case 0xC0: return "Phone Call History Key";
case 0xC1: return "Phone Caller ID Key";
case 0xC2: return "Phone Settings Key";
case 0xF0: return "Host Control";
case 0xF1: return "Host Available";
case 0xF2: return "Host Call Active";
case 0xF3: return "Activate Handset Audio";
case 0xF4: return "Ring Type";
case 0xF5: return "Re-dialable Phone Number";
case 0xF8: return "Stop Ring Tone";
case 0xF9: return "PSTN Ring Tone";
case 0xFA: return "Host Ring Tone";
case 0xFB: return "Alert Sound Error";
case 0xFC: return "Alert Sound Confirm";
case 0xFD: return "Alert Sound Notification";
case 0xFE: return "Silent Ring";
case 0x108: return "Email Message Waiting";
case 0x109: return "Voicemail Message Waiting";
case 0x10A: return "Host Hold";
case 0x110: return "Incoming Call History Count";
case 0x111: return "Outgoing Call History Count";
case 0x112: return "Incoming Call History";
case 0x113: return "Outgoing Call History";
case 0x114: return "Phone Locale";
case 0x140: return "Phone Time Second";
case 0x141: return "Phone Time Minute";
case 0x142: return "Phone Time Hour";
case 0x143: return "Phone Date Day";
case 0x144: return "Phone Date Month";
case 0x145: return "Phone Date Year";
case 0x146: return "Handset Nickname";
case 0x147: return "Address Book ID";
case 0x14A: return "Call Duration";
case 0x14B: return "Dual Mode Phone";
default: return "Reserved";
}
case 0x0C:
switch (usageId) {
case 0x00: return "Undefined";
case 0x01: return "Consumer Control";
case 0x02: return "Numeric Key Pad";
case 0x03: return "Programmable Buttons";
case 0x04: return "Microphone";
case 0x05: return "Headphone";
case 0x06: return "Graphic Equalizer";
case 0x20: return "+10";
case 0x21: return "+100";
case 0x22: return "AM PM";
case 0x30: return "Power";
case 0x31: return "Reset";
case 0x32: return "Sleep";
case 0x33: return "Sleep After";
case 0x34: return "Sleep Mode";
case 0x35: return "Illumination";
case 0x36: return "Function Buttons";
case 0x40: return "Menu";
case 0x41: return "Menu Pick";
case 0x42: return "Menu Up";
case 0x43: return "Menu Down";
case 0x44: return "Menu Left";
case 0x45: return "Menu Right";
case 0x46: return "Menu Escape";
case 0x47: return "Menu Value Increase";
case 0x48: return "Menu Value Decrease";
case 0x60: return "Data On Screen";
case 0x61: return "Closed Caption";
case 0x62: return "Closed Caption Select";
case 0x63: return "VCR TV";
case 0x64: return "Broadcast Mode";
case 0x65: return "Snapshot";
case 0x66: return "Still";
case 0x67: return "Picture-in-Picture Toggle";
case 0x68: return "Picture-in-Picture Swap";
case 0x69: return "Red Menu Button";
case 0x6A: return "Green Menu Button";
case 0x6B: return "Blue Menu Button";
case 0x6C: return "Yellow Menu Button";
case 0x6D: return "Aspect";
case 0x6E: return "3D Mode Select";
case 0x6F: return "Display Brightness Increment";
case 0x70: return "Display Brightness Decrement";
case 0x71: return "Display Brightness";
case 0x72: return "Display Backlight Toggle";
case 0x73: return "Display Set Brightness to Minimum";
case 0x74: return "Display Set Brightness to Maximum";
case 0x75: return "Display Set Auto Brightness";
case 0x76: return "Camera Access Enabled";
case 0x77: return "Camera Access Disabled";
case 0x78: return "Camera Access Toggle";
case 0x79: return "Keyboard Brightness Increment";
case 0x7A: return "Keyboard Brightness Decrement";
case 0x7B: return "Keyboard Backlight Set Level";
case 0x7C: return "Keyboard Backlight";
case 0x7D: return "Keyboard Backlight Set Minimum";
case 0x7E: return "Keyboard Backlight Set Maximum";
case 0x7F: return "Keyboard Backlight Auto";
case 0x80: return "Selection";
case 0x81: return "Assign Selection";
case 0x82: return "Mode Step";
case 0x83: return "Recall Last";
case 0x84: return "Enter Channel";
case 0x85: return "Order Movie";
case 0x86: return "Channel";
case 0x87: return "Media Selection";
case 0x88: return "Media Select Computer";
case 0x89: return "Media Select TV";
case 0x8A: return "Media Select WWW";
case 0x8B: return "Media Select DVD";
case 0x8C: return "Media Select Telephone";
case 0x8D: return "Media Select Program Guide";
case 0x8E: return "Media Select Video Phone";
case 0x8F: return "Media Select Games";
case 0x90: return "Media Select Messages";
case 0x91: return "Media Select CD";
case 0x92: return "Media Select VCR";
case 0x93: return "Media Select Tuner";
case 0x94: return "Quit";
case 0x95: return "Help";
case 0x96: return "Media Select Tape";
case 0x97: return "Media Select Cable";
case 0x98: return "Media Select Satellite";
case 0x99: return "Media Select Security";
case 0x9A: return "Media Select Home";
case 0x9B: return "Media Select Call";
case 0x9C: return "Channel Increment";
case 0x9D: return "Channel Decrement";
case 0x9E: return "Media Select SAP";
case 0xA0: return "VCR Plus";
case 0xA1: return "Once";
case 0xA2: return "Daily";
case 0xA3: return "Weekly";
case 0xA4: return "Monthly";
case 0xB0: return "Play";
case 0xB1: return "Pause";
case 0xB2: return "Record";
case 0xB3: return "Fast Forward";
case 0xB4: return "Rewind";
case 0xB5: return "Scan Next Track";
case 0xB6: return "Scan Previous Track";
case 0xB7: return "Stop";
case 0xB8: return "Eject";
case 0xB9: return "Random Play";
case 0xBA: return "Select Disc";
case 0xBB: return "Enter Disc";
case 0xBC: return "Repeat";
case 0xBD: return "Tracking";
case 0xBE: return "Track Normal";
case 0xBF: return "Slow Tracking";
case 0xC0: return "Frame Forward";
case 0xC1: return "Frame Back";
case 0xC2: return "Mark";
case 0xC3: return "Clear Mark";
case 0xC4: return "Repeat From Mark";
case 0xC5: return "Return To Mark";
case 0xC6: return "Search Mark Forward";
case 0xC7: return "Search Mark Backwards";
case 0xC8: return "Counter Reset";
case 0xC9: return "Show Counter";
case 0xCA: return "Tracking Increment";
case 0xCB: return "Tracking Decrement";
case 0xCC: return "Stop Eject";
case 0xCD: return "Play Pause";
case 0xCE: return "Play Skip";
case 0xCF: return "Voice Command";
case 0xD0: return "Invoke Capture Interface";
case 0xD1: return "Start or Stop Game Recording";
case 0xD2: return "Historical Game Capture";
case 0xD3: return "Capture Game Screenshot";
case 0xD4: return "Show or Hide Recording Indicator";
case 0xD5: return "Start or Stop Microphone Capture";
case 0xD6: return "Start or Stop Camera Capture";
case 0xD7: return "Start or Stop Game Broadcast";
case 0xD8: return "Start or Stop Voice Dictation Session";
case 0xD9: return "Invoke Dismiss Emoji Picker";
case 0xE0: return "Volume";
case 0xE1: return "Balance";
case 0xE2: return "Mute";
case 0xE3: return "Bass";
case 0xE4: return "Treble";
case 0xE5: return "Bass Boost";
case 0xE6: return "Surround Mode";
case 0xE7: return "Loudness";
case 0xE8: return "MPX";
case 0xE9: return "Volume Increment";
case 0xEA: return "Volume Decrement";
case 0xF0: return "Speed Select";
case 0xF1: return "Playback Speed";
case 0xF2: return "Standard Play";
case 0xF3: return "Long Play";
case 0xF4: return "Extended Play";
case 0xF5: return "Slow";
case 0x100: return "Fan Enable";
case 0x101: return "Fan Speed";
case 0x102: return "Light Enable";
case 0x103: return "Light Illumination Level";
case 0x104: return "Climate Control Enable";
case 0x105: return "Room Temperature";
case 0x106: return "Security Enable";
case 0x107: return "Fire Alarm";
case 0x108: return "Police Alarm";
case 0x109: return "Proximity";
case 0x10A: return "Motion";
case 0x10B: return "Duress Alarm";
case 0x10C: return "Holdup Alarm";
case 0x10D: return "Medical Alarm";
case 0x150: return "Balance Right";
case 0x151: return "Balance Left";
case 0x152: return "Bass Increment";
case 0x153: return "Bass Decrement";
case 0x154: return "Treble Increment";
case 0x155: return "Treble Decrement";
case 0x160: return "Speaker System";
case 0x161: return "Channel Left";
case 0x162: return "Channel Right";
case 0x163: return "Channel Center";
case 0x164: return "Channel Front";
case 0x165: return "Channel Center Front";
case 0x166: return "Channel Side";
case 0x167: return "Channel Surround";
case 0x168: return "Channel Low Frequency Enhancement";
case 0x169: return "Channel Top";
case 0x16A: return "Channel Unknown";
case 0x170: return "Sub-channel";
case 0x171: return "Sub-channel Increment";
case 0x172: return "Sub-channel Decrement";
case 0x173: return "Alternate Audio Increment";
case 0x174: return "Alternate Audio Decrement";
case 0x180: return "Application Launch Buttons";
case 0x181: return "AL Launch Button Configuration Tool";
case 0x182: return "AL Programmable Button Configuration";
case 0x183: return "AL Consumer Control Configuration";
case 0x184: return "AL Word Processor";
case 0x185: return "AL Text Editor";
case 0x186: return "AL Spreadsheet";
case 0x187: return "AL Graphics Editor";
case 0x188: return "AL Presentation App";
case 0x189: return "AL Database App";