Open Torguen opened 3 months ago
This problem is caused by godot or by SDL_GameControllerDB?
Should I report this issue here or in SDL_GameControllerDB?
Would be good to do a check upstream and see if the problem occurs in other cases as well, I don't have this controller so can't test myself
What other cases are you referring to?
In the gamecontrollerdb.txt file the stadia controller seems to be misassigned, someone thought that those triggers are not analog and set them as digital. The different analog controls on the xbox controller, for example, are set as a0, a1, a2 etc... (a for analog I guess). However, the stadia controller triggers do not have the letter a but its analog sticks do. Someone must have thought that the stadia controller triggers are not analog.
What other cases are you referring to?
Outside Godot
I have no idea, how should I test outside of godot?
That's why I'd suggest looking upstream, what I meant in my comment above
I don't understand what you mean in your previous comment. If you want to explain it to me, I can try it.
It would be good to see if other projects have this problem to see if it's a Godot problem or an sdl problem
I'm sorry if the language barrier makes it hard to understand what I'm saying 😕
What I'm saying is: Check with the SDL library to see if this is known, and if others have this issue, if it's our code, or our configuration, or a problem with their configurations
If it's that their configurations are wrong then it should be fixed by them and then we can update ours to match
Maybe it's related: https://github.com/godotengine/godot/issues/36370
In the end I couldn't look at what you suggested because I don't know exactly how to do it.
There is an answer and it is mentioned that SDL accepts stadia controllers. https://discourse.libsdl.org/t/sdl-supports-stadia-pad/55314
Well, someone answered, and they say that SDL is compatible with the Stadia controller. I have a Stadia controller, if someone tells me what I should change in the Godot source code, I could fix it.
In Godot, the Stadia controller is using DirectInput The information I have so far is that the analog trigger press only returns 1 and 0 because in this line, 1 is assigned when the trigger is pressed, and there is no intermediate value; the trigger is not being detected as analog.
In input.cpp Just investigating. If it's an axis type, why are integer values assigned to it?
Also, from joypad_windows.cpp, the trigger is already detected as a button because these lines are executed when pressing and releasing it. Perhaps joy_axis should be executed instead of joy_button?
When the analog left trigger is pressed, the value 13 is sent, which corresponds to DPAD_LEFT in the JoyButton class.
The correct way should be:
Tested versions
v4.4.dev2.official [97ef3c837] v4.3.beta3.official [82cedc83c] v3.6.rc1.official [cfc4a0eff]
System information
w10 64
Issue description
From the SDL forum, they confirm that the Stadia controller's analog triggers work correctly. It is understood that the problem lies in Godot. A video is provided showing that the analog triggers work correctly in SDL. Link to the post: https://discourse.libsdl.org/t/sdl-supports-stadia-pad/55314/2
Godot only reads 0 or 1, there are no intermediate values using "get_action_strength". Initially this error also occurred on Windows. For windows I solved it using this method:
This generated two new fields in the windows application:
But godot doesn't read those fields, it seems, and only returns two fixed values: 0 or 1.
This utility reads stadia triggers correctly: https://gamepad-tester.com/
https://github.com/user-attachments/assets/b30d6746-2994-405d-b2d5-4466fb7ba39c
Steps to reproduce
Press the right trigger and see the values in output, 0 or 1.
Minimal reproduction project (MRP)
Test.zip