-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Opinion: SDL_HINT_GAMECONTROLLER_USE_BUTTON_LABELS
should default to 0
#6117
Comments
Am I right in paraphrasing your opinion as being like this? With With The Your reasoning is that the physical location of the buttons is the most important thing and their labels are secondary, similar to the way most games that are ported between Xbox and Playstation directly mirror the function of the Xbox ABXY buttons with the Playstation button that is in the corresponding position (Y = triangle and so on). Correct? For what it's worth, the Linux kernel agrees with you: the evdev gamepad interface is written in terms of |
You are perfectly right with your paraphrase. |
I agree with your reasoning and I'll leave this open for further discussion, however making a change like this isn't something we should do lightly. In the meantime, you can set the behavior you like by setting the environment variable: |
For comparison, what does Steam Input remapping do with Nintendo controllers? Do they follow the positions or the button labels by default? I don't currently have a Nintendo gamepad connected to any of my Steam devices, only Steam Controllers (which follow the convention that controllers designed for PC label and colour-code their buttons like an Xbox controller) and various generations of Playstation gamepads (which don't use the ABXY labels, but Steam treats them as equivalent to the Xbox button that has the corresponding position, disregarding labels and colour-coding). |
Steam defaults to using the buttons as labeled, and has a setting to change that to positional mapping. |
Consistent with current SDL (without the change proposed here), then, which makes sense. |
Steam however shows this is a GUI option, close to the one to enable the controller support in the first place. SDL's option is far less discoverable. And while Steam defaults to the equivalent of The alternative to not changing the default could be making the option more discoverable, but I have no idea how. The only idea I have would be a log in the terminal when SDL detects a controller that makes use of the hint, but that would only be useful for only a small percentage of users. |
Controllers such as 8BitDo Pro Wired 2 actually have their physical labels according to the "Nintendo layout" (bottom = B, east = A) and not the "Xbox layout" (default, bottom = A, east = B). SDL supports the SDL_HINT_GAMECONTROLLER_USE_BUTTON_LABELS for this purpose, which hints to the application that the user wants to follow the labels in the controller, and not the physical layout of the buttons [1]. That hint defaults to 1. The mappings for this particular controller are made in the "default layout" (hint=0) and do not support the "Nintendo layout" (hint=1), which is inconsistent with how SDL works by default. This commit addresses that by introducing a new copy of each one of the three mappings for this controller (as it has 3 operations modes which result in 3 different GUIDs [2]), which will activate depending on the hint. Naturally there are other controllers with the "Nintendo layout" that would benefit from the same improvements, however the author of this commit is restricting the scope of the change to the controller he personally has and can test. [1] libsdl-org/SDL#6117 [2] mdqinc#650
SDL_HINT_GAMECONTROLLER_USE_BUTTON_LABELS
should default to 0
This seems to be approximately the same issue as #6665, which I closed because a majority of the commenters seemed to be against the idea. |
Bump, is anything changing with SDL3? |
I hope not. |
So, a recap. Problem with PC gaming: when playing with a Nintendo controller, the prompts don't match the buttons you press.
(Also, applying both solutions at the same time will make a game with both the wrong mapping and the wrong prompts. Meaning, if you play a game with the default SDL setting, you should not enable Nintendo prompts on a Nintendo controller.) So, @Squall-Leonhart, are you going to write a motivation on why not? The motivation so far was because it was a big change, but now that they should be fair game due to SDL3, I'd want another one. |
simply put, you're the only one that cares thats not reason enough to invert behaviors from one sdl version to another. |
If the prompt says "X" and I'm holding a switch pro controller I expect that the top button will do it. If the prompt says "Y", the left, and so on. I don't look at the controller, but I know by instinct which button is which on that controller. Programs should learn to respect Nintendo controller users, not the other way around. If i wanted an xbox controller I'd just get one and use that. |
Could say the same about SDL 2.0.12, which introduced this to begin with. (With 9a76beb)
Found someone else! https://www.reddit.com/r/linux_gaming/comments/fguome/comment/fk8o7lt/?context=3
Alright, but you should motive why it's worth these tradeoffs:
And as I said, some games do offer Nintendo prompts (which make sense only if |
i stumbled over this trying to get the "correct" mapping for my WiiU-Pro Pad. The Launch parameter works fine. I just wonder, is there a more persistent way so that i wouldn't have to set that launch parameter for each game? |
If you want to set the environment variable for the entire user, add the following line to
|
…rate label This gives applications and binding systems a clearer view of what the hardware is so they can make intelligent decisions about how to present things to the user. Fixes libsdl-org#6117
…rate label This gives applications and binding systems a clearer view of what the hardware is so they can make intelligent decisions about how to present things to the user. Fixes libsdl-org#6117
…rate label This gives applications and binding systems a clearer view of what the hardware is so they can make intelligent decisions about how to present things to the user. Fixes libsdl-org#6117
…rate label This gives applications and binding systems a clearer view of what the hardware is so they can make intelligent decisions about how to present things to the user. Fixes libsdl-org#6117
…rate label This gives applications and binding systems a clearer view of what the hardware is so they can make intelligent decisions about how to present things to the user. Fixes libsdl-org#6117
…rate label This gives applications and binding systems a clearer view of what the hardware is so they can make intelligent decisions about how to present things to the user. Gamepad mappings continue to use abxy for the face buttons for simplicity and compatibility with earlier versions of SDL, however the "SDL_GAMECONTROLLER_USE_BUTTON_LABELS" hint no longer has any effect. Fixes libsdl-org#6117
…rate label This gives applications and binding systems a clearer view of what the hardware is so they can make intelligent decisions about how to present things to the user. Gamepad mappings continue to use abxy for the face buttons for simplicity and compatibility with earlier versions of SDL, however the "SDL_GAMECONTROLLER_USE_BUTTON_LABELS" hint no longer has any effect. Fixes libsdl-org#6117
…rate label This gives applications and binding systems a clearer view of what the hardware is so they can make intelligent decisions about how to present things to the user. Gamepad mappings continue to use abxy for the face buttons for simplicity and compatibility with earlier versions of SDL, however the "SDL_GAMECONTROLLER_USE_BUTTON_LABELS" hint no longer has any effect. Fixes libsdl-org#6117
…rate label This gives applications and binding systems a clearer view of what the hardware is so they can make intelligent decisions about how to present things to the user. Gamepad mappings continue to use abxy for the face buttons for simplicity and compatibility with earlier versions of SDL, however the "SDL_GAMECONTROLLER_USE_BUTTON_LABELS" hint no longer has any effect. Fixes libsdl-org#6117
Okay, this is implemented! |
As described here,
SDL_HINT_GAMECONTROLLER_USE_BUTTON_LABELS
makes the game controller face buttons report their values according to their labels instead of their positional layout.Right now, this hint defaults to 1, but in my opinion it should default to 0.
Most players do not look at the controller while playing, and while players used to the Nintendo layout will have to rewire the brain to adjust the labels, it's definitely easier than rewiring the brain to push different buttons (with 1, if someone plays a game on Switch, then plays the same game on PC with a Switch Controller, they'd have to change the buttons to press).
It's important that the button positions are consistent between gamepads, and also games between different platforms (since the same game on Xbox and Switch map the buttons so that are in the same position (except for menus)).
Many games are also designed to have buttons in a specific layout (like the Binding of Isaac, or Inversus). Even if they aren't, many games show a gamepad layout when prompting a specific button.
The text was updated successfully, but these errors were encountered: