Page 3 of 3
Re: joystick:getGamepadMapping(buttonName) always returns nil
Posted: Wed Nov 30, 2016 1:55 am
by raidho36
There's no reason it shouldn't work - it is a gamepad. It's just there's no stock mapping for it.
Re: joystick:getGamepadMapping(buttonName) always returns nil
Posted: Wed Nov 30, 2016 2:22 am
by slime
love.gamepadpressed and friends don't work without a mapping between the joystick button and axis indices and the gamepad control scheme. Joystick:getGamepadMapping is supposed to retrieve that mapping, but it isn't happening in this case even though the mapping exists.
Re: joystick:getGamepadMapping(buttonName) always returns nil
Posted: Wed Nov 30, 2016 2:41 pm
by raidho36
For what I can tell, SDL_GameControllerMappingForGUID fails to return mapping string, presumably due to GUID from SDL_JoystickGetGUIDFromString being invalid - that function will produce GUID from any input but if it wasn't a valid joystick GUID then it won't be useful, as per docs.
Re: joystick:getGamepadMapping(buttonName) always returns nil
Posted: Wed Nov 30, 2016 5:08 pm
by sandygk
can anyone confirm if getGamepadMapping() works with other controllers? it doesn't seem to work with Xbox controllers
Re: joystick:getGamepadMapping(buttonName) always returns nil
Posted: Fri Dec 02, 2016 5:39 pm
by sandygk
OK, so, what to do now?
Re: joystick:getGamepadMapping(buttonName) always returns nil
Posted: Fri Dec 02, 2016 5:43 pm
by raidho36
You can just not use it. All other gamepad functionality works fine.
Re: joystick:getGamepadMapping(buttonName) always returns nil
Posted: Sat Dec 03, 2016 1:27 am
by slime
sandygk wrote:can anyone confirm if getGamepadMapping() works with other controllers? it doesn't seem to work with Xbox controllers
It works when I use my 360 controller in macOS. I suspect this is a bug in how SDL handles xinput controllers on Windows/Linux (in macOS there's no xinput).
I may be able to make getGamepadMapping use an alternative API in SDL to work around the issue, if it doesn't get fixed in SDL itself. We'll see.
Re: joystick:getGamepadMapping(buttonName) always returns nil
Posted: Sat Dec 03, 2016 5:33 am
by sandygk
that would be great
Re: joystick:getGamepadMapping(buttonName) always returns nil
Posted: Sat Dec 03, 2016 5:42 am
by raidho36
I don't think it's a bug in the way SDL handles controllers (mine does works if you use *Gamepad functions), it's the function that should return mapping by GUID that may be bugged. Or the function that returns GUID is bugged - that's a possibility as well.
Re: joystick:getGamepadMapping(buttonName) always returns nil
Posted: Sat Dec 03, 2016 5:00 pm
by sandygk