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

Incorrect Switch Pro Controller face buttons when SDL_HINT_GAMECONTROLLER_USE_BUTTON_LABELS disabled #3967

Closed
SDLBugzilla opened this issue Feb 11, 2021 · 0 comments

Comments

@SDLBugzilla
Copy link
Collaborator

This bug report was migrated from our old Bugzilla tracker.

Reported in version: 2.0.14
Reported for operating system, platform: Windows 10, x86_64

Comments on the original bug report:

On 2021-01-04 13:37:55 +0000, wrote:

I'm testing with DualShock 4, DualSense, Switch Pro Controller, and PowerA Switch Controller.

I'm using the standard mapping file from here:
https://raw.github.com/gabomdq/SDL_GameControllerDB/master/gamecontrollerdb.txt

With SDL_HINT_GAMECONTROLLER_USE_BUTTON_LABELS turned off (set to "0") I expect the button positions to be the same on all devices, based on Xbox controller button naming (eg SDL_GameControllerGetButton(g, SDL_CONTROLLER_BUTTON_Y) gives me whether the North face button is pressed).

However, the Switch Pro Controller layout is wrong (matching labels rather than positions, so X and Y are swapped and A and B are swapped). And with the PowerA controller the East and West buttons are correct, but the North and South buttons are swapped instead.

On 2021-01-04 21:40:07 +0000, Sam Lantinga wrote:

Does it work correctly with the built-in SDL mappings, if you don't use gamecontrollerdb.txt? That mapping file doesn't support the hint.

On 2021-01-05 01:12:47 +0000, wrote:

(In reply to Sam Lantinga from comment # 1)

Does it work correctly with the built-in SDL mappings, if you don't use
gamecontrollerdb.txt? That mapping file doesn't support the hint.

I've just tested it out without loading gamecontrollerdb.txt, and it still behaves incorrectly as described.

On 2021-01-12 17:31:19 +0000, Mathias Kaerlev wrote:

Also seeing this on 2.0.14. This is most likely a regression, since we weren't seeing this on an earlier SDL version.

I suspect it might be caused by this commit:
spurious/SDL-mirror@a569b21#diff-da9344d94c66b8c702a45e7649f412039f08bba83bd82de33f5c80ea9c8c39d5

It seems like both the HIDAPI driver and SDL_gamecontroller.c will try to swap the buttons if the hint is set to 0, causing the button remap to cancel out.

On 2021-01-14 23:16:45 +0000, Sam Lantinga wrote:

Fixed, thanks guys!
https://hg.libsdl.org/SDL/rev/abc272ee7adf

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