PyHIDParser icon indicating copy to clipboard operation
PyHIDParser copied to clipboard

Add missing Usage Pages

Open NZSmartie opened this issue 9 years ago • 6 comments

Usage Pages implemented:

  • [x] 0x01 - GenericDesktop
  • [ ] 0x02 - Simulation
  • [x] 0x03 - Virtual Reality
  • [ ] 0x04 - Sport
  • [ ] 0x05 - Game
  • [x] 0x06 - Generic Device
  • [ ] 0x07 - Keyboard
  • [ ] 0x08 - LEDs
  • [x] 0x09 - Button
  • [ ] 0x0A - Ordinal
  • [ ] 0x0B - Telephony
  • [ ] 0x0C - Consumer
  • [x] 0x0D - Digitizer
  • [ ] Physical Interface Device definitions for force feedback and related devices
    • [ ] 0x0F - Physical Interface Device (PID) page
  • [ ] 0x10 - Unicode
  • [ ] 0x14 - Alphanumeric Display
  • [ ] 0x40 - Medial Instruments
  • [ ] Monitor Devices
    • [ ] 0x80-0x83 - Monitor Pages
  • [X] Power Devices
    • [X] 0x84 - Power Device Page (Thank you @kabili207 #13)
    • [X] 0x85 - Battery System Page (Thank you @kabili207 #13)
    • 0x86-0x87 - Reserved
  • [ ] Point of Sales
    • [ ] 0x8C - Bar Code Scanner
    • [ ] 0x8D - Scale
    • [ ] 0x8E - Magnetic Swipe Reading (MSR)
  • [ ] Image Class Devices
    • [ ] 0x90 - Camera Control
  • [ ] OAAF Definitions for arcade and coinop related devices
    • [ ] 0x91 - Arcade

NZSmartie avatar Apr 24 '16 12:04 NZSmartie

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 avatar Apr 25 '16 09:04 NZSmartie

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 avatar May 01 '16 21:05 NZSmartie

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 avatar May 01 '16 21:05 NZSmartie

In da0bda0

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

NZSmartie avatar May 17 '16 09:05 NZSmartie

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.

kabili207 avatar Nov 26 '18 14:11 kabili207

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!

NZSmartie avatar Nov 26 '18 22:11 NZSmartie