Page 1 of 1

Switch Pro Controller support for PC

Posted: Fri Jan 18, 2019 7:53 pm
by Jaston
I have been trying to get my pro controller to work with love2d. I loaded in all the sdl2 default gamepad mappings but it does the following:

1) does not register gamepad presses
2) indicates not vibration supported

I wondered over to steam and turned on switch pro controller support in steam. Now presses are regustered in love but it is a jumbled mess of input. Its like im holding down buttons when they arent pressed. Also i noticed my controller would rumble in steam.

Anyone else have these troubles or have any luck getting the controller to register and work for pc properly?

Re: Switch Pro Controller support for PC

Posted: Fri Jan 18, 2019 8:34 pm
by MissDanish
LÖVE 11.2 and earlier ships with an older version of SDL2 which doesn't support the pro controller, however it should work in the upcoming 11.3 since that ships with the newest SDL2 version. If you're on windows there's an easy fix for this, download the latest SDL2 DLL from the SDL website and go into your LÖVE installation folder and replace the SDL2 DLL in there with the one you just downloaded (this worked for me and I have tested it with my own pro controller)

Edit: one thing that doesn't work though is hot plugging, for some reason my fix doesn't allow for that. I am guessing LÖVE does something on it's end to support that or it's a bug in SDL2.

Re: Switch Pro Controller support for PC

Posted: Sat Jan 19, 2019 1:03 am
by Jaston
Thank you for the help :). I currently use the hot swapping in my game just incase a player losses battery or unplugs. Maybe its something they can fix in 11.3 or 11.4

Re: Switch Pro Controller support for PC

Posted: Sun Jan 20, 2019 12:55 am
by MissDanish
Jaston wrote: Sat Jan 19, 2019 1:03 am Thank you for the help :). I currently use the hot swapping in my game just incase a player losses battery or unplugs. Maybe its something they can fix in 11.3 or 11.4
I've talked to slime on the discord server about getting this working in 11.3, turns out there's some other bug in 11.3 right now that breaks it in a completely different way from what I detailed. This controller should hopefully work in 11.3

Re: Switch Pro Controller support for PC

Posted: Sun Jan 20, 2019 1:16 am
by slime
Specifically, the third-party libraries love uses on Windows are built using CMake when love is built, but SDL's new joystick code which includes better Switch Pro controller support doesn't get compiled in when you build SDL with CMake. I'll need to modify SDL's CMake generator file to fix it.