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 Xbox Series controller detected as 2 devices #71784

Merged
merged 1 commit into from
Jan 23, 2023

Conversation

PrecisionRender
Copy link
Contributor

@PrecisionRender PrecisionRender commented Jan 21, 2023

Fixes #69257, related to #41684.

Adds missing GUID check for the Xbox Series controller. This prevents the same device from getting added as an XInput device and a DInput device. GUID was retrieved by reading it while the comparator function was being run.

Bugsquad edit:

@PrecisionRender PrecisionRender requested a review from a team as a code owner January 21, 2023 03:25
@PrecisionRender PrecisionRender changed the title Fix Xbox Series controller duplicate input Fix Xbox Series controller detected as 2 devices Jan 21, 2023
@akien-mga
Copy link
Member

Makes sense. The original report mentions Xbox One controller, would we also need an exception for that one?

I can test the fix (and the original bug) with a Series controller in coming days.

@PrecisionRender
Copy link
Contributor Author

PrecisionRender commented Jan 21, 2023

@akien-mga I don't have an Xbox One controller, so I can't test the issue with one, and I don't know how to get its GUID. (See my question in https://chat.godotengine.org/channel/input)

@akien-mga
Copy link
Member

akien-mga commented Jan 23, 2023

I tested the change with an Xbox Series controller, and it works fine to prevent detecting it as two controller. After this change it's only detected as a generic Xinput controller (not sure if that's the better one of the two, but I'm not really familiar with the controller code on Windows).

On the other hand, both before and after this PR, the button mappings seem completely wrong for my (official) Xbox Series controller. In master/before this PR, they're wrong for both the detected controllers.

Edit: Actually I think it's the joypads demo in the 4.0-dev branch https://github.com/godotengine/godot-demo-projects/tree/4.0-dev which is broken, it's highlighting the wrong buttons, but the input events seem correct.

@akien-mga akien-mga added cherrypick:3.x Considered for cherry-picking into a future 3.x release cherrypick:3.5 Considered for cherry-picking into a future 3.5.x release labels Jan 23, 2023
@akien-mga akien-mga merged commit 84c0819 into godotengine:master Jan 23, 2023
@akien-mga
Copy link
Member

Thanks!

@akien-mga
Copy link
Member

Cherry-picked for 3.6.

@akien-mga akien-mga removed the cherrypick:3.x Considered for cherry-picking into a future 3.x release label Mar 6, 2023
@akien-mga
Copy link
Member

Cherry-picked for 3.5.2.

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