You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Speaking on the Linux side: Linux gamepad specification
If you have a non-standard controller with many axes or triggers (DS2, DS3, DS4, any controller with triggers or pressure-sensitive buttons), the drivers might simply not support them to conform to this spec. For example, Sony dropped pressure sensitivity in their hid-sony driver in this commit.
Currently, the SDL GameController API follows the evdev implementation, so different controllers with more axes will never get properly configured. The axes are not even reported on evdev because the drivers won't support them all.
What could be done:
Convince the maintainers to improve the gamepad specification and update every Linux driver to report all axes.
Talk to the gamepad directly via HIDAPI (hidraw or libusb backends). Every userspace application would need their own drivers. Some emulators do this.
Use an external library that does this.
Luckily, SDL2 has been implementing lots of HIDAPI drivers:
/* This is the full set of HIDAPI drivers available */
#define SDL_JOYSTICK_HIDAPI_GAMECUBE
#define SDL_JOYSTICK_HIDAPI_LUNA
#define SDL_JOYSTICK_HIDAPI_PS3
#define SDL_JOYSTICK_HIDAPI_PS4
#define SDL_JOYSTICK_HIDAPI_PS5
#define SDL_JOYSTICK_HIDAPI_STADIA
#define SDL_JOYSTICK_HIDAPI_SWITCH
#define SDL_JOYSTICK_HIDAPI_WII
#define SDL_JOYSTICK_HIDAPI_XBOX360
#define SDL_JOYSTICK_HIDAPI_XBOXONE
#define SDL_JOYSTICK_HIDAPI_SHIELD
By using SDL2, you can finally get all functionality from these controllers. However, you cannot use the GameController API and should fallback to the Joystick API, so some code changes are required. SDL_GameController SDL_Joystick
For reference, here's a DualShock 3 controller with every pressure-sensitive button working via SDL2 HIDAPI driver and sdl2-jstest:
Digital buttons (15): ×, ○, □, △, Select, PS, Start, L3, R3, L1, R1, ↑, ↓, ←, →
Analog axes (16): Left Analog X, Left Analog Y, Right Analog X, Right Analog Y, L2, R2, ×, ○, □, △, L1, R1, ↑, ↓, ←, →,
Speaking on the Linux side:
Linux gamepad specification
If you have a non-standard controller with many axes or triggers (DS2, DS3, DS4, any controller with triggers or pressure-sensitive buttons), the drivers might simply not support them to conform to this spec. For example, Sony dropped pressure sensitivity in their hid-sony driver in this commit.
Currently, the SDL GameController API follows the evdev implementation, so different controllers with more axes will never get properly configured. The axes are not even reported on evdev because the drivers won't support them all.
What could be done:
Luckily, SDL2 has been implementing lots of HIDAPI drivers:
By using SDL2, you can finally get all functionality from these controllers. However, you cannot use the GameController API and should fallback to the Joystick API, so some code changes are required.
SDL_GameController
SDL_Joystick
Relevant issues: #11721 #6920
The text was updated successfully, but these errors were encountered: