Package input
Class Gamepad
java.lang.Object
input.Gamepad
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic intstatic intstatic intstatic intstatic intstatic intstatic intstatic intstatic intstatic intstatic intstatic intstatic intstatic intstatic intstatic intstatic intstatic intstatic intstatic intstatic int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic floataxis(int controllerId, int axis) static booleanbuttonPressed(int controllerId, int button) static int
-
Field Details
-
LEFT_STICK_HORIZONTAL
public static int LEFT_STICK_HORIZONTAL -
LEFT_STICK_VERTICAL
public static int LEFT_STICK_VERTICAL -
LEFT_TRIGGER
public static int LEFT_TRIGGER -
RIGHT_TRIGGER
public static int RIGHT_TRIGGER -
RIGHT_STICK_HORIZONTAL
public static int RIGHT_STICK_HORIZONTAL -
RIGHT_STICK_VERITCAL
public static int RIGHT_STICK_VERITCAL -
A
public static int A -
B
public static int B -
X
public static int X -
Y
public static int Y -
LEFT_SHOULDER
public static int LEFT_SHOULDER -
RIGHT_SHOULDER
public static int RIGHT_SHOULDER -
BACK
public static int BACK -
START
public static int START -
XBOX
public static int XBOX -
LEFT_STICK
public static int LEFT_STICK -
RIGHT_STICK
public static int RIGHT_STICK -
D_UP
public static int D_UP -
D_RIGHT
public static int D_RIGHT -
D_DOWN
public static int D_DOWN -
D_LEFT
public static int D_LEFT
-
-
Constructor Details
-
Gamepad
public Gamepad()
-
-
Method Details
-
controllersAvailable
public static int controllersAvailable()- Returns:
- Returns an int with the number of connected controllers.
-
buttonPressed
public static boolean buttonPressed(int controllerId, int button) - Parameters:
controllerId- An int representing the ID of a gamepad or controllerbutton- An int representing the button to be checked.- Returns:
- Returns a boolean true if the button is pressed, otherwise, it returns false.
-
axis
public static float axis(int controllerId, int axis) - Parameters:
controllerId- An int representing the ID of a gamepad or controlleraxis- An int representing the axis to be checked.- Returns:
- Returns a float representing the directional state of the axis.
-