Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve Device class (Collections) structure #9

Open
NZSmartie opened this issue May 4, 2016 · 0 comments
Open

Improve Device class (Collections) structure #9

NZSmartie opened this issue May 4, 2016 · 0 comments

Comments

@NZSmartie
Copy link
Owner

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
                • Report at index 1

At the moment, i'm not too sure how to make it more readable, will comment on this later

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant