Package rosequartz.input
Class NullGamepad
java.lang.Object
rosequartz.input.Gamepad
rosequartz.input.NullGamepad
Represents a gamepad that does not exist. Used as a placeholder for when no gamepad is connected, but a gamepad is expected.
This allows the return value to behave like a gamepad that does nothing, instead of crashing.
- See Also:
InputManager.mainGamepad()
-
Nested Class Summary
Nested classes/interfaces inherited from class rosequartz.input.Gamepad
Gamepad.Axis, Gamepad.Button -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfloatgetAxis(Gamepad.Axis a)Gets the value of an axis.booleanGets if a button is currently pressed.getName()Gets the name of the gamepad.booleanhasAxis(Gamepad.Axis a)Gets if the gamepad has an axis.booleanGets if the gamepad has a button.booleanGets if the gamepad is still connected.
-
Constructor Details
-
NullGamepad
public NullGamepad()
-
-
Method Details
-
getName
Gets the name of the gamepad. -
hasButton
Gets if the gamepad has a button. Always returns false. -
getButton
Gets if a button is currently pressed. Always returns false. -
hasAxis
Gets if the gamepad has an axis. Always returns false. -
getAxis
Gets the value of an axis. Always returns 0. -
isConnected
public boolean isConnected()Gets if the gamepad is still connected. Always returns false.- Overrides:
isConnectedin classGamepad- Returns:
- false
-