Skip to content
This repository has been archived by the owner on Jul 28, 2022. It is now read-only.

Commit

Permalink
Gamepad:IsDown(key)
Browse files Browse the repository at this point in the history
Pretty self explanatory. Returns true if the given key is pressed on the current gamepad.
  • Loading branch information
ThoughtSpinnr authored Nov 14, 2018
1 parent d518045 commit 0852cfd
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
gamepad = Gamepad.new(gamepadUserInputType)
Boolean gamepad:IsDown(key)
Boolean gamepad:IsConnected()
InputObject gamepad:GetState(keyCode)
Void gamepad:SetMotor(motor, value)
Expand Down Expand Up @@ -121,6 +122,11 @@ function Gamepad:DisconnectAll()
end


function Gamepad:IsDown(key)
return userInput:IsGamepadButtonDown(self._gamepadInput, key)
end


function Gamepad:IsConnected()
return self._isConnected
end
Expand Down Expand Up @@ -173,4 +179,4 @@ function Gamepad:Init()
end


return Gamepad
return Gamepad

0 comments on commit 0852cfd

Please sign in to comment.