joystick:getGamepadMapping(buttonName) always returns nil
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Re: joystick:getGamepadMapping(buttonName) always returns nil
There's no reason it shouldn't work - it is a gamepad. It's just there's no stock mapping for it.
- slime
- Solid Snayke
- Posts: 3163
- Joined: Mon Aug 23, 2010 6:45 am
- Location: Nova Scotia, Canada
- Contact:
Re: joystick:getGamepadMapping(buttonName) always returns nil
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
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
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
OK, so, what to do now?
Re: joystick:getGamepadMapping(buttonName) always returns nil
You can just not use it. All other gamepad functionality works fine.
- slime
- Solid Snayke
- Posts: 3163
- Joined: Mon Aug 23, 2010 6:45 am
- Location: Nova Scotia, Canada
- Contact:
Re: joystick:getGamepadMapping(buttonName) always returns nil
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).sandygk wrote:can anyone confirm if getGamepadMapping() works with other controllers? it doesn't seem to work with Xbox controllers
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
that would be great
Re: joystick:getGamepadMapping(buttonName) always returns nil
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.
Who is online
Users browsing this forum: Bing [Bot], Google [Bot] and 6 guests