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

usage tables are inconsistent and incomplete #20

Open
beatboxchad opened this issue Apr 13, 2024 · 1 comment
Open

usage tables are inconsistent and incomplete #20

beatboxchad opened this issue Apr 13, 2024 · 1 comment

Comments

@beatboxchad
Copy link

beatboxchad commented Apr 13, 2024

This repository currently includes some custom YAML files to store the usage metadata for HID. This is how you get useful descriptions of the control data coming from your devices. The report just has numbers, this metadata has the names. There's a "Digitizer" page with "Touchscreen" and "X" and "Y". The semantics are in the HID report structure (how many "X" and "Y" axes does a touchscreen send?)

SuperCollider reads these files as-needed in HIDUsage.getUsageDescription, but they're an incomplete and inconsistent representation of the official tables. I just wrote some tests for the HIDUsage class and discovered that the usage/page names in SuperCollider's version are underscored some places, truncated in others -- there's no consistent formatting scheme. In addition, the usage tables are incomplete, and it looks like they were last updated around 2016. They were likely built by hand -- the committer is not a Github user or I'd @ them to ask.

The official doc -- which anyone developing HID code will find super useful for its detailed descriptions of the usage data -- includes a JSON attachment that has all the data, updated annually. I think SuperCollider ought to just use that.

@beatboxchad
Copy link
Author

beatboxchad commented Apr 13, 2024

Although this change has a small potential to break somebody's code if they used HIDUsage.getUsageIds with one of the reformatted names, I'd guess that such issues would be minimal and easy to document. SuperCollider's HIDUsage, per the documentation, is mostly used internally.

@beatboxchad beatboxchad changed the title use the official usage tables from libusb usage tables are inconsistent and incomplete Apr 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant