Gamepad Button Syntax..?
Posted: Wed Oct 01, 2014 4:43 am
Can someone tell me the code for Xbox game pad button input?
So far, I only know what the D Pad Syntax...
Does anyone know the syntax for the x,y,a,b buttons, the thumb sticks, the shoulder buttons, and the start and back buttons?
Any help would be appreciated!
So far, I only know what the D Pad Syntax...
Does anyone know the syntax for the x,y,a,b buttons, the thumb sticks, the shoulder buttons, and the start and back buttons?
Any help would be appreciated!
Code: Select all
function love.update(dt)
if not joystick then return end
if joystick:isGamepadDown("dpleft") then
position.x = position.x - speed * dt
elseif joystick:isGamepadDown("dpright") then
position.x = position.x + speed * dt
end
if joystick:isGamepadDown("dpup") then
position.y = position.y - speed * dt
elseif joystick:isGamepadDown("dpdown") then
position.y = position.y + speed * dt
end
end