Is there any good reason for Steam Controllers not being considered a GameController in SDL2?
While running some tests, that include opening the device as a
SDL_Joystick and map the buttons myself. I was able to get all available input working, hence I ask:
why not Steam Controllers are identified as a GameController?
To show some info, the application output is:
INFO: main: 1 joysticks found
INFO: main: Not GameController 0: #ax: 4, #but: 21, #hat: 2, #ball: 0 -- 03000000de2800004211000011010000 -- Wireless Steam Controller
INFO: Joystick added
INFO: Closing application
The full of
0's line shows:
- [joystick id]
- (axis0, axis1)
- (axis3, axis4)
- o <-- is a hat, it changes to
\/^v,.<> it depends on hat state (in this case there is 2 hats).
00000... each button state,
0 not pressed,
1 pressed. (here I’m pressing the last button, right bumper).
Moreover, besides it reports 21 buttons, I could not find the last 4 buttons anywhere. And triggers are also mapped as hats (weird).
After read the SDL source code
SDL/src/joystick/SDL_gamecontroller.c:1168 I found out, that a mapping is necessary to make a Joystick be handled as a GameController. Hence I made my own mapping. And now is working nicely.
I have 2 Steam controllers, one is identified as joystick (and I’m being able to map as a GameController), the other one is not even identified as a Joystick.
I don’t know why. Maybe the firmware.
From what I understand, Steam provides your game with the SteamController mappings created by the user at runtime, so users can have things mapped the way they want. Outside of Steam, who knows?
Maybe someone want to run a game without steam using a steam controller (it’s just a piece of hardware).
Did you ever reach a satisfactory point with this? I’ve just sent an early version of my game to a friend to test - he has a Steam Controller (I don’t), and my game (which is only using GameController for input at the moment) doesn’t see it at all.
My experience with Steam Controller is that Valve really don’t want or care about people trying to use it without Steam software running concurrently. The intended use case is to map the controller to standard gamepad inputs - Or, use the proprietary Steamworks SDK to poll information on GameController devices directly. In other words, the controller may be “just a piece of hardware” but that doesn’t mean it uses any open standards.