I'm concerned with the ambiguity and readability with accessing Collections or Reports in a Device Class or more accurately the Collection class.
As is the case with examples/dual-shock-3.py there are logical collections nested under the root Joystick collection that are not assigned a Usage. Resulting in code that looks like this
buttons = my_device.desc.reports[1].inputs.joystick[0][1]
To break it down:
buttons Report =
device ➔
- report descriptor ➔
- reportID:
1 ➔
inputs Collection ➔
- GenericDesktop
Joystick Collection ➔
- Logical Collection at index
0 ➔
At the moment, i'm not too sure how to make it more readable, will comment on this later
I'm concerned with the ambiguity and readability with accessing Collections or Reports in a Device Class or more accurately the Collection class.
As is the case with
examples/dual-shock-3.pythere are logical collections nested under the root Joystick collection that are not assigned a Usage. Resulting in code that looks like thisTo break it down:
buttonsReport =device➔1➔inputsCollection ➔JoystickCollection ➔0➔1At the moment, i'm not too sure how to make it more readable, will comment on this later