protonscr

Steam input doesn't ignore `SDL_GAMECONTROLLER_USE_BUTTON_LABELS` on latest beta

steamclosed Steam clientGeneral controller / Steam Input
ValveSoftware/steam-for-linux#9553 · opened 2023-06-01 by SuperSamus · updated 2024-02-16 · 6 comments · github
3 matching comments, n / p to jump
SSuperSamus 2023-06-01 github

Your system information

  • Steam client version (build number or date): 1685572056
  • Distribution (e.g. Ubuntu): NixOS Unstable
  • Opted into Steam client beta?: Yes
  • Have you checked for system updates?: No, I didn't update the system when the issue appeared

Please describe your issue in as much detail as possible:

Nintendo controllers are known for having the A/B and X/Y buttons swapped, compared to the PC standard.
Does the user want the mapping based on the button labels, or based on the button position?
Steam has an option named "Use Nintendo Button Layout" to control that.
SDL also has a way to control that, the environment variable SDL_GAMECONTROLLER_USE_BUTTON_LABELS (set to 1 by default).

Because these two are doing the same thing, Steam ignored the SDL environment variable in order to give priority to its option. Because I want the mapping based on position everywhere, I disabled both Steam's "Use Nintendo Button Layout" and SDL's SDL_GAMECONTROLLER_USE_BUTTON_LABELS.
However, Steam doesn't ignore it anymore: it behaves with the assumption that SDL_GAMECONTROLLER_USE_BUTTON_LABELS is set to 1. If it is set to 0 then Steam's "Use Nintendo Button Layout" behavior will be reversed, meaning that now I have to enable it to get the mapping I want (which isn't intuitive).

Steps for reproducing this issue:

  1. Take a Nintendo controller
  2. Set SDL_GAMECONTROLLER_USE_BUTTON_LABELS=0, and launch Steam
  3. See that Steam's "Use Nintendo Button Layout"'s behavior is reversed
Sslouken 2023-06-07 github

Steam now uses SDL for Nintendo controller support and as-such, respects that hint. When Steam launches a game, it will set that hint based on the "Use Nintendo Button Layout" setting. I recommend that you don't launch Steam with that environment variable set, and Steam will work correctly, and Steam games will work corrrectly, based on the setting in the UI.

SSuperSamus 2023-06-07 github

The environment variable on my end is set through .bashrc, it's not exactly convenient to unset it every time I want to launch Steam.
Also, I still want it even if I'm not using Steam input.

When Steam launches a game, it will set that hint based on the "Use Nintendo Button Layout" setting

However, the environment variable still affects the final output, like this:

SDL_GAMECONTROLLER_USE_BUTTON_LABELS=0 SDL_GAMECONTROLLER_USE_BUTTON_LABELS=1
"Use Nintendo Button Layout" On Xbox Nintendo
"Use Nintendo Button Layout" Off Nintendo Xbox
Sslouken 2023-06-08 github

Yes, the environment variable will invert the buttons that Steam sees. You should not set the environment variable for Steam. It's respected for people who need to invert it because the controller is mis-detected for some reason.

SSuperSamus 2023-06-08 github

This wasn't the behavior before, though (and still isn't on Steam Stable).

SSuperSamus 2023-07-25 github

Informing that this issue is now also on stable.

It's respected for people who need to invert it because the controller is mis-detected for some reason.

I still don't get what you mean by that.

First, Steam offers the option even for non-Nintendo controllers.
Second, let's assume that it doesn't, and Steam recognizes a Nintendo controller as a non-Nintendo controller. A user however wants the mapping to be Nintendo's. The solution would be to set SDL_GAMECONTROLLER_USE_BUTTON_LABELS=0 (see table above). That's the opposite of what would make sense.

Could this get reopened?

SSuperSamus 2024-02-16 github

Note: this is actually fixed now.