Open NZSmartie opened 8 years ago
The Buttons usage page implements a "hacked" Python enum.Enum
class.
When Enum
s are created, the class is treated as final and does not allow adding more members to Enum
s, I mean, why not?
In the case of the Button usage page, there are 2^16 buttons (a lot) and I'm not prepared to fill up the memory with Button instances that'll never be used. So they're created when requested and should behave like normal python enums.
The
Button
usage page implements a "hacked" Pythonenum.Enum
class. When Enums are created, the class is treated as final and does not allow adding more members to Enums, I mean, why not?
I may create a UsagePage metaclass that will automate creating members for the enums at request if the subclass implements a class method (for example def __createmember__(cls, name):
)
in case there are more usage pages like Button
I may create a UsagePage metaclass that will automate creating members for the enums at request if the subclass implements a class method (for example def createmember(cls, name):) in case there are more usage pages like Button
Also, will be useful when parsing devices and their vendor defined usage page isn't defined
In da0bda0
Approved HID Usage Table Review Request 61 was also added for convenience
According to the latest specification pages, x86 and x87 are reserved for Power Devices but there usage has not yet been defined and are essentially reserved for future versions.
According to the latest specification pages, x86 and x87 are reserved for Power Devices but there usage has not yet been defined and are essentially reserved for future versions.
Updated, thank you again!
Usage Pages implemented:
0x01
- GenericDesktop0x02
- Simulation0x03
- Virtual Reality0x04
- Sport0x05
- Game0x06
- Generic Device0x07
- Keyboard0x08
- LEDs0x09
- Button0x0A
- Ordinal0x0B
- Telephony0x0C
- Consumer0x0D
- Digitizer0x0F
- Physical Interface Device (PID) page0x10
- Unicode0x14
- Alphanumeric Display0x40
- Medial Instruments0x80-0x83
- Monitor Pages0x84
- Power Device Page (Thank you @kabili207 #13)0x85
- Battery System Page (Thank you @kabili207 #13)0x86-0x87
- Reserved0x8C
- Bar Code Scanner0x8D
- Scale0x8E
- Magnetic Swipe Reading (MSR)0x90
- Camera Control0x91
- Arcade