Open lucasmr opened 2 years ago
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, ↑, ↓, ←, →,
Looks like SDL has finally support for pressure-sensitive buttons on Linux, MacOS and Windows: https://github.com/libsdl-org/SDL/issues/5148.
Maybe now it will be easier to put it into RetroArch.
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