NZSmartie / PyHIDParser

A HID descriptor parser written in Python 3
MIT License
23 stars 5 forks source link

Add missing Usage Pages #2

Open NZSmartie opened 8 years ago

NZSmartie commented 8 years ago

Usage Pages implemented:

NZSmartie commented 8 years ago

The Buttons usage page implements a "hacked" Python enum.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?

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.

NZSmartie commented 8 years ago

The Button usage page implements a "hacked" Python enum.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

NZSmartie commented 8 years ago

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

NZSmartie commented 8 years ago

In da0bda0

Approved HID Usage Table Review Request 61 was also added for convenience

kabili207 commented 5 years ago

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.

NZSmartie commented 5 years ago

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!