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

Fix reporting of "share" button (KEY_RECORD) #17

Closed
wants to merge 1 commit into from

Conversation

lbschenkel
Copy link

@lbschenkel lbschenkel commented Jan 9, 2023

Tested on a 8BitPro Pro 2 Wired Controller for Xbox. The driver was not
reporting button presses of the "share" button (below the big Xbox
button). After confirming that the controller is detected as "Series XS"
and analyzing packet dumps, I noticed that this controller reports the
button in a different offset than this driver expects.

Since the controller works in Windows with the stock, official Microsoft
driver I am assuming that both offsets are being used in the wild to
report the state of this button.

Signed-off-by: Leonardo Brondani Schenkel <leonardo@schenkel.net>

@lbschenkel
Copy link
Author

Hmmmm... please hold the merge. I tried to do the same change on xpad and there the offset matches the old one here, and two codebases wouldn't have the same bug. I'm now thinking that the Microsoft controllers report this in one offset, and the 8BitDo in a different offset, but the Microsoft driver in Windows recognizes either one.

Tested on a 8BitPro Pro 2 Wired Controller for Xbox. The driver was not
reporting button presses of the "share" button (below the big Xbox
button). After confirming that the controller is detected as "Series XS"
and analyzing packet dumps, I noticed that this controller reports the
button in a different offset than this driver expects.

Since the controller works in Windows with the stock, official Microsoft
driver I am assuming that both offsets are being used in the wild to
report the state of this button.

Signed-off-by: Leonardo Brondani Schenkel <leonardo@schenkel.net>
@lbschenkel
Copy link
Author

Fixed patch. I'm assuming that the previous offset is valid and used by the official controllers, and I'm adding the new offset used by the 8BitDo controller. I don't have an official controller to test; we should verify what official controllers send in that different offset (if it's always zero, or consistent with the other offset, then we're good).

@lbschenkel
Copy link
Author

Hi. Any feedback on this?

@mbenkmann
Copy link

I can confirm that the official Microsoft controller I have reports the Share button in byte 22 (counting GIP_CMD_INPUT as byte 0) and the Hori Fighting Commander Octa reports the Share button in byte 18.

@lbschenkel
Copy link
Author

Hi again. Is there anything else I could do to get this merged?

@medusalix
Copy link
Owner

Hi, sorry for the delay. I've investigated the share button handling of the Windows drive a while ago and it looks like the button byte is always at a constant offset from the end of the packet. Handling the share button in this way ensures that we don't have to fix the offset for every new device.

I've made the required changes to the packet handling in the share-button branch. It would be great if you could give it a try 😃

@lbschenkel
Copy link
Author

I compiled and tested the share-button branch on my machine and I can confirm that presses of the share button produce a KEY_RECORD event in my 8BitDo Pro 2 Wired Controller for Xbox. I don't have an official Microsoft controller to test.

@lbschenkel
Copy link
Author

Closing this PR since the maintainer implemented a better approach.

@lbschenkel lbschenkel closed this Jan 13, 2024
@lbschenkel
Copy link
Author

@medusalix : any plans for that branch to be merged?

@medusalix
Copy link
Owner

Yes, I'll probably merge it later today.

@lbschenkel lbschenkel deleted the fix-share-button branch April 22, 2024 08:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants