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 report descriptor parsing #18

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jfedor2
Copy link
Contributor

@jfedor2 jfedor2 commented Oct 8, 2024

This lifts previously existing restictions on where the button and motion bits can reside within the input reports.

The data no longer has to start on byte boundary and doesn't have to be contiguous.

Should now work with any report ID.

This lifts previously existing restictions on where the button and
motion bits can reside within the input reports.

The data no longer has to start on byte boundary and doesn't have to
be contiguous.

Should now work with any report ID.
@maximevince
Copy link
Contributor

Hi @jfedor2 thanks for all your contributions! I've actually stumbled across your blog a while ago, and found your projects very interesting. Cool to see PRs from you appear here, too.

I'll need some time to have a close look at all of them.

About this specific PR: have you actually seen any HID descriptors where the button and motion bits are not byte-aligned or non-continuous? I haven't on any of the mice I tested, but maybe you have? It sounds a like weird thing to do.

@jfedor2
Copy link
Contributor Author

jfedor2 commented Oct 12, 2024

I don't know about mice, but for example a DualShock 4 has button data starting at bit 4. Gamepads typically have a 4-bit field for the d-pad, so this is natural, depending on the order of fields and willingness to sacrifice bits for padding.

Also gamepads often have more than 8 buttons, which the current implementation doesn't support.

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

Successfully merging this pull request may close these issues.

2 participants