function love.joystickpressed(joystick, button)
print(joystick, button)
end
Press buttons on your joystick, and if you get output, then that means you'll have to add gamepad mappings manually for your controller. See: love.joystick.setGamepadMapping.
Kingdaro wrote:It's possible that your joystick isn't actually registered as a gamepad. Try putting this in your code (with console enabled in conf.lua):
function love.joystickpressed(joystick, button)
print(joystick, button)
end
Press buttons on your joystick, and if you get output, then that means you'll have to add gamepad mappings manually for your controller. See: love.joystick.setGamepadMapping.
Is "registered as a gamepad" and simply recognized by the following code the same thing?
No, they aren't. Joysticks and gamepads are conceptually different things. Rather, they have different workings in their API. Joysticks represent the controller itself, where the gamepad bindings, axes and such are there just so you have an easy to use, universal... thing, to more easily support multiple controllers. As an example, the button 1 differs widely from controller to controller, but different mappings for 'a' will always allow you to get the button you want as mapped on the controller itself.
In relation to your question, you can also check if a joystick is detected as a gamepad directly, something I forgot about when making my post. I'll also apologize if my explanation isn't all that clear, the wiki page here should give a good enough explanation as well.