mirror of
https://github.com/TangentFoxy/baton.git
synced 2025-07-27 18:42: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
|
||||
|
||||
function sourceFunction.joystick.button(joystick, button)
|
||||
local isDown = tonumber(button) and joystick:isDown(tonumber(button))
|
||||
or joystick:isGamepadDown(button)
|
||||
return isDown and 1 or 0
|
||||
if tonumber(button) then
|
||||
return joystick:isDown(tonumber(button)) and 1 or 0
|
||||
else
|
||||
return joystick:isGamepadDown(button) and 1 or 0
|
||||
end
|
||||
end
|
||||
|
||||
function sourceFunction.joystick.hat(joystick, value)
|
||||
|
Reference in New Issue
Block a user