Interface GamepadListener
public interface GamepadListener
Told about controllers coming and going and about their buttons. Register one
with Gamepads#addListener(GamepadListener); every callback arrives on the EDT.
Axis movement is not reported here, because a stick reports dozens of values
a second: read Gamepad#getAxis(int) from the update loop instead.
-
Method Summary
Modifier and TypeMethodDescriptionbooleangamepadButton(Gamepad pad, int button, boolean down) A button went down or up.voidgamepadConnected(Gamepad pad) A controller was connected.voidA controller was disconnected;Gamepad#isConnected()is already false.
-
Method Details
-
gamepadConnected
A controller was connected. -
gamepadDisconnected
A controller was disconnected;Gamepad#isConnected()is already false. -
gamepadButton
A button went down or up.
Parameters
-
pad: the controller -
button: one of theGamepad.BUTTON_*constants -
down: true when pressed, false when released
Returns
true to consume the event, which stops
Gamepadsfrom also turning it into focus navigation -
-