Thanks!success = love.joystick.setGamepadMapping( guid, button, inputtype, inputindex, hatdir )
love.joystick.setGamepadMapping for unrecognised joysticks?
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
love.joystick.setGamepadMapping for unrecognised joysticks?
love.joystick.setGamepadMapping, from what I've read, can be used to map a controller which is not recognised as a controller by LÖVE by default. I have an SNES controller, which other frameworks recognise, but LÖVE does not. How can I use love.joystick.setGamepadMapping to get LÖVE to recognise my controller? There are no examples on the wiki for this, just docs, whereas usually there is an example to help. Just the function synopsis:
"In those quiet moments, you come into my mind" - Liam Reilly
- bartbes
- Sex machine
- Posts: 4946
- Joined: Fri Aug 29, 2008 10:35 am
- Location: The Netherlands
- Contact:
Re: love.joystick.setGamepadMapping for unrecognised joystic
Let's start off by saying that love probably recognizes it, but as joystick, which means you can still use it, you just can't use the gamepad api. Then, the gamepad api is made for xbox360-like controllers, which the snes controller.. well.. isn't. Lastly, the SDL documentation tells you what a mapping looks like.Eamonn wrote:I have an SNES controller, which other frameworks recognise, but LÖVE does not.
Re: love.joystick.setGamepadMapping for unrecognised joystic
LÖVE doesn't recognise it according to joystick:isGamepad()
I'll check that link, thanks! So I can't remap the SNES controller since it's nothing like the Xbox 360 controller?
I'll check that link, thanks! So I can't remap the SNES controller since it's nothing like the Xbox 360 controller?

"In those quiet moments, you come into my mind" - Liam Reilly
- bartbes
- Sex machine
- Posts: 4946
- Joined: Fri Aug 29, 2008 10:35 am
- Location: The Netherlands
- Contact:
Re: love.joystick.setGamepadMapping for unrecognised joystic
.. as a gamepad. You've got a joystick object, you can use it.Eamonn wrote:LÖVE doesn't recognise it according to joystick:isGamepad()
You can try, but it seems unlikely to work.Eamonn wrote:So I can't remap the SNES controller since it's nothing like the Xbox 360 controller?
Re: love.joystick.setGamepadMapping for unrecognised joysticks?
I'm struggling with the same issue.
However, it seems even though my 8BitDo SNES30 controller isn't properly recognised (only the X,Y,A,B buttons work as expected with the API), it should be possible to make it work manually.
I've noticed the joystick:getAxis() APIs actually do return the correct axis on the dpad.
So for some simple controllers, one approach could be to check the status of the dpad every game update and respond as needed. And perhaps this also works for other inputs.
I'm gonna try to implement something like this.
However, it seems even though my 8BitDo SNES30 controller isn't properly recognised (only the X,Y,A,B buttons work as expected with the API), it should be possible to make it work manually.
I've noticed the joystick:getAxis() APIs actually do return the correct axis on the dpad.
So for some simple controllers, one approach could be to check the status of the dpad every game update and respond as needed. And perhaps this also works for other inputs.
I'm gonna try to implement something like this.
Re: love.joystick.setGamepadMapping for unrecognised joysticks?
There is no problem at all. I use 8BitDo gamepads as well.
Use a public SDL mapping DB
https://github.com/gabomdq/SDL_GameControllerDB
Read the DB file with
love.joystick.loadGamepadMappings( "res/gamecontrollerdb.txt" )
Use a public SDL mapping DB
https://github.com/gabomdq/SDL_GameControllerDB
Read the DB file with
love.joystick.loadGamepadMappings( "res/gamecontrollerdb.txt" )
Our LÖVE Gamedev blog Zabuyaki (an open source retro beat 'em up game). Twitter: @Zabuyaki.
LÖVE & Lua Video Lessons in Russian / Видео уроки по LÖVE и Lua 


Who is online
Users browsing this forum: Ahrefs [Bot], Semrush [Bot] and 10 guests