mirror of
https://github.com/TangentFoxy/baton.git
synced 2025-07-28 02:52:19 +00:00
fix error when using joystick button sources
This commit is contained in:
@@ -62,9 +62,11 @@ function sourceFunction.joystick.axis(joystick, value)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function sourceFunction.joystick.button(joystick, button)
|
function sourceFunction.joystick.button(joystick, button)
|
||||||
local isDown = tonumber(button) and joystick:isDown(tonumber(button))
|
if tonumber(button) then
|
||||||
or joystick:isGamepadDown(button)
|
return joystick:isDown(tonumber(button)) and 1 or 0
|
||||||
return isDown and 1 or 0
|
else
|
||||||
|
return joystick:isGamepadDown(button) and 1 or 0
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function sourceFunction.joystick.hat(joystick, value)
|
function sourceFunction.joystick.hat(joystick, value)
|
||||||
|
Reference in New Issue
Block a user