Any ideas on how to use SDL2 in a snap and have it recognise controllers?
I figured connecting the joystick interface might help but it doesn’t, maybe it does for older joysticks but I’m testing with modern gamepads, so ps3/ps4/360/xbone.
I’m using the SDL2 provided by the system, eg libsdl2-dev
The joystick plug is the solution (added to your snapcraft.yaml then manually connected after installation). Certainly, it works for my SDL snaps and xbox360 controllers.
Maybe some of your controllers do not work now, but will do once the above patches land.
I’m sure @jdstrand would be happy to see somebody testing his PR…
Certainly x360 controllers (and Steam controllers masquerading as x360 controllers via sc-controller) work perfectly for me. I don’t have anything more modern .
The interface work I did for 2.33 is to add support for accessing controllers via the modern /dev/input/event* evdev interface as opposed to the older /dev/input/js* interface. Controllers can typically be accessed with either and it depends on the libraries you are using as to which is used. I suspect that sdl2 is using the modern evdev interfaces. It looks like the new code to support evdev joysticks is already in edge. You might try ‘sudo snap refresh core --edge’