I recently added controller support to my game which was a breeze with the baton library. Worked great with an official XBox 360 controller. So I bought a Logitech F310 controller, which is pretty much the same thing. The joystick is registered and everything, it claims to be a "Xbox 360 Wired Controller", however, love.gamepadpressed is not called when I press a button, while love.joystickpressed does get called. isDown also returns a button number.
Code: Select all
function love.gamepadpressed( joystick, button )
print('gamepad pressed')
print(joystick)
print(button)
end
function love.joystickpressed( joystick, button )
print('joystick pressed')
print(joystick)
print(button)
end
function love.load()
local j = love.joystick.getJoysticks()[1]
print(j)
print(j:getName())
print(j:getButtonCount())
end
Code: Select all
Joystick: 0x7fbd6d202060
Xbox 360 Wired Controller
15
joystick pressed
Joystick: 0x7fbd6d202060
1
joystick pressed
Joystick: 0x7fbd6d202060
2
What might be the problem? Thanks, Andras