| Modifier and Type | Field and Description |
|---|---|
| public final boolean | a
Whether or not the a button is pressed |
| public final boolean | aJustPressed
Whether or not the a button was just pressed |
| public final boolean | b
Whether or not the b button is pressed |
| public final boolean | back
Whether or not the back button is pressed |
| public final boolean | backJustPressed
Whether or not the back button was just pressed |
| public final boolean | bJustPressed
Whether or not the b button was just pressed |
| public final String | controllerType
A string describing the type of controller (i.e. "PS4 Controller" or "XInput Controller") |
| private static final ControllerState | |
| public final boolean | dpadDown
Whether or not the down button on the dpad is pushed |
| public final boolean | dpadDownJustPressed
Whether or not the down button on the dpad was just pressed |
| public final boolean | dpadLeft
Whether or not the left button on the dpad is pushed |
| public final boolean | dpadLeftJustPressed
Whether or not the left button on the dpad was just pressed |
| public final boolean | dpadRight
Whether or not the right button on the dpad is pushed |
| public final boolean | dpadRightJustPressed
Whether or not the right button on the dpad was just pressed |
| public final boolean | dpadUp
Whether or not the up button on the dpad is pushed |
| public final boolean | dpadUpJustPressed
Whether or not the up button on the dpad was just pressed |
| public final boolean | guide
Whether or not the guide button is pressed. |
| public final boolean | guideJustPressed
Whether or not the guide button was just pressed |
| public final boolean | isConnected
Whether or not the controller is currently connected. |
| public final boolean | lb
Whether or not the left bumper is pressed |
| public final boolean | lbJustPressed
Whether or not the left bumper was just pressed |
| public final float | leftStickAngle
The angle of the left stick (for reference, 0 is right, 90 is up, 180 is left, 270 is down) |
| public final boolean | leftStickClick
Whether or not the left stick is clicked in |
| public final boolean | leftStickJustClicked
Whether or not the left stick was just is clicked in |
| public final float | leftStickMagnitude
The amount the left stick is pushed in the current direction. |
| public final float | leftStickX
The x position of the left stick between -1 and 1 |
| public final float | leftStickY
The y position of the left stick between -1 and 1 |
| public final float | leftTrigger
The position of the left trigger between 0 and 1 |
| public final boolean | misc1
Xbox Series X share button, PS5 microphone button, Nintendo Switch Pro capture button |
| public final boolean | |
| public final boolean | paddle1
Xbox Elite paddle P1 |
| public final boolean | |
| public final boolean | paddle2
Xbox Elite paddle P3 |
| public final boolean | |
| public final boolean | paddle3
Xbox Elite paddle P2 |
| public final boolean | |
| public final boolean | paddle4
Xbox Elite paddle P4 |
| public final boolean | |
| public final boolean | rb
Whether or not the right bumper is pressed |
| public final boolean | rbJustPressed
Whether or not the right bumper was just pressed |
| public final float | rightStickAngle
The angle of the right stick (for reference, 0 is right, 90 is up, 180 is left, 270 is down) |
| public final boolean | rightStickClick
Whether or not the right stick is clicked in |
| public final boolean | rightStickJustClicked
Whether or not the right stick was just is clicked in |
| public final float | rightStickMagnitude
The amount the right stick is pushed in the current direction. |
| public final float | rightStickX
The x position of the right stick between -1 and 1 |
| public final float | rightStickY
The y position of the right stick between -1 and 1 |
| public final float | rightTrigger
The position of the right trigger between 0 and 1 |
| private static final long | |
| public final boolean | start
Whether or not the start button is pressed |
| public final boolean | startJustPressed
Whether or not the start button was just pressed |
| public final boolean | touchpadButton
PS4/PS5 touchpad button |
| public final boolean | |
| public final boolean | x
Whether or not the x button is pressed |
| public final boolean | xJustPressed
Whether or not the x button was just pressed |
| public final boolean | y
Whether or not the y button is pressed |
| public final boolean | yJustPressed
Whether or not the y button was just pressed |
| Access | Constructor and Description |
|---|---|
| private | |
| private |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv static ControllerState | Returns: The ControllerState representing the disconnected controller.Return a ControllerState that represents a disconnected controller. |
| pack-priv static ControllerState | getInstanceFromController(ControllerIndex
The ControllerIndex object whose state should be read. c)Return a controller state based on the current state of the passed controller. |
| a | back to summary |
|---|---|
| public final boolean a Whether or not the a button is pressed | |
| aJustPressed | back to summary |
|---|---|
| public final boolean aJustPressed Whether or not the a button was just pressed | |
| b | back to summary |
|---|---|
| public final boolean b Whether or not the b button is pressed | |
| back | back to summary |
|---|---|
| public final boolean back Whether or not the back button is pressed | |
| backJustPressed | back to summary |
|---|---|
| public final boolean backJustPressed Whether or not the back button was just pressed | |
| bJustPressed | back to summary |
|---|---|
| public final boolean bJustPressed Whether or not the b button was just pressed | |
| controllerType | back to summary |
|---|---|
| public final String controllerType A string describing the type of controller (i.e. "PS4 Controller" or "XInput Controller") | |
| DISCONNECTED_CONTROLLER | back to summary |
|---|---|
| private static final ControllerState DISCONNECTED_CONTROLLER | |
| dpadDown | back to summary |
|---|---|
| public final boolean dpadDown Whether or not the down button on the dpad is pushed | |
| dpadDownJustPressed | back to summary |
|---|---|
| public final boolean dpadDownJustPressed Whether or not the down button on the dpad was just pressed | |
| dpadLeft | back to summary |
|---|---|
| public final boolean dpadLeft Whether or not the left button on the dpad is pushed | |
| dpadLeftJustPressed | back to summary |
|---|---|
| public final boolean dpadLeftJustPressed Whether or not the left button on the dpad was just pressed | |
| dpadRight | back to summary |
|---|---|
| public final boolean dpadRight Whether or not the right button on the dpad is pushed | |
| dpadRightJustPressed | back to summary |
|---|---|
| public final boolean dpadRightJustPressed Whether or not the right button on the dpad was just pressed | |
| dpadUp | back to summary |
|---|---|
| public final boolean dpadUp Whether or not the up button on the dpad is pushed | |
| dpadUpJustPressed | back to summary |
|---|---|
| public final boolean dpadUpJustPressed Whether or not the up button on the dpad was just pressed | |
| guide | back to summary |
|---|---|
| public final boolean guide Whether or not the guide button is pressed. For some controller/platform combinations this doesn't work. You probably shouldn't use this. | |
| guideJustPressed | back to summary |
|---|---|
| public final boolean guideJustPressed Whether or not the guide button was just pressed | |
| isConnected | back to summary |
|---|---|
| public final boolean isConnected Whether or not the controller is currently connected. If the controller is disconnected, all other fields will be 0 or false. | |
| lb | back to summary |
|---|---|
| public final boolean lb Whether or not the left bumper is pressed | |
| lbJustPressed | back to summary |
|---|---|
| public final boolean lbJustPressed Whether or not the left bumper was just pressed | |
| leftStickAngle | back to summary |
|---|---|
| public final float leftStickAngle The angle of the left stick (for reference, 0 is right, 90 is up, 180 is left, 270 is down) | |
| leftStickClick | back to summary |
|---|---|
| public final boolean leftStickClick Whether or not the left stick is clicked in | |
| leftStickJustClicked | back to summary |
|---|---|
| public final boolean leftStickJustClicked Whether or not the left stick was just is clicked in | |
| leftStickMagnitude | back to summary |
|---|---|
| public final float leftStickMagnitude The amount the left stick is pushed in the current direction. This probably between 0 and 1, but this can't be guaranteed due to weird gamepads (like the square holes on a Logitech Dual Action) | |
| leftStickX | back to summary |
|---|---|
| public final float leftStickX The x position of the left stick between -1 and 1 | |
| leftStickY | back to summary |
|---|---|
| public final float leftStickY The y position of the left stick between -1 and 1 | |
| leftTrigger | back to summary |
|---|---|
| public final float leftTrigger The position of the left trigger between 0 and 1 | |
| misc1 | back to summary |
|---|---|
| public final boolean misc1 Xbox Series X share button, PS5 microphone button, Nintendo Switch Pro capture button | |
| misc1JustPressed | back to summary |
|---|---|
| public final boolean misc1JustPressed | |
| paddle1 | back to summary |
|---|---|
| public final boolean paddle1 Xbox Elite paddle P1 | |
| paddle1JustPressed | back to summary |
|---|---|
| public final boolean paddle1JustPressed | |
| paddle2 | back to summary |
|---|---|
| public final boolean paddle2 Xbox Elite paddle P3 | |
| paddle2JustPressed | back to summary |
|---|---|
| public final boolean paddle2JustPressed | |
| paddle3 | back to summary |
|---|---|
| public final boolean paddle3 Xbox Elite paddle P2 | |
| paddle3JustPressed | back to summary |
|---|---|
| public final boolean paddle3JustPressed | |
| paddle4 | back to summary |
|---|---|
| public final boolean paddle4 Xbox Elite paddle P4 | |
| paddle4JustPressed | back to summary |
|---|---|
| public final boolean paddle4JustPressed | |
| rb | back to summary |
|---|---|
| public final boolean rb Whether or not the right bumper is pressed | |
| rbJustPressed | back to summary |
|---|---|
| public final boolean rbJustPressed Whether or not the right bumper was just pressed | |
| rightStickAngle | back to summary |
|---|---|
| public final float rightStickAngle The angle of the right stick (for reference, 0 is right, 90 is up, 180 is left, 270 is down) | |
| rightStickClick | back to summary |
|---|---|
| public final boolean rightStickClick Whether or not the right stick is clicked in | |
| rightStickJustClicked | back to summary |
|---|---|
| public final boolean rightStickJustClicked Whether or not the right stick was just is clicked in | |
| rightStickMagnitude | back to summary |
|---|---|
| public final float rightStickMagnitude The amount the right stick is pushed in the current direction. This probably between 0 and 1, but this can't be guaranteed due to weird gamepads (like the square holes on a Logitech Dual Action) | |
| rightStickX | back to summary |
|---|---|
| public final float rightStickX The x position of the right stick between -1 and 1 | |
| rightStickY | back to summary |
|---|---|
| public final float rightStickY The y position of the right stick between -1 and 1 | |
| rightTrigger | back to summary |
|---|---|
| public final float rightTrigger The position of the right trigger between 0 and 1 | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID | |
| start | back to summary |
|---|---|
| public final boolean start Whether or not the start button is pressed | |
| startJustPressed | back to summary |
|---|---|
| public final boolean startJustPressed Whether or not the start button was just pressed | |
| touchpadButton | back to summary |
|---|---|
| public final boolean touchpadButton PS4/PS5 touchpad button | |
| touchpadButtonJustPressed | back to summary |
|---|---|
| public final boolean touchpadButtonJustPressed | |
| x | back to summary |
|---|---|
| public final boolean x Whether or not the x button is pressed | |
| xJustPressed | back to summary |
|---|---|
| public final boolean xJustPressed Whether or not the x button was just pressed | |
| y | back to summary |
|---|---|
| public final boolean y Whether or not the y button is pressed | |
| yJustPressed | back to summary |
|---|---|
| public final boolean yJustPressed Whether or not the y button was just pressed | |
| ControllerState | back to summary |
|---|---|
| private ControllerState(ControllerIndex c) throws ControllerUnpluggedException | |
| ControllerState | back to summary |
|---|---|
| private ControllerState() | |
| getDisconnectedControllerInstance | back to summary |
|---|---|
| pack-priv static ControllerState getDisconnectedControllerInstance() Return a ControllerState that represents a disconnected controller. This object is shared.
| |
| getInstanceFromController | back to summary |
|---|---|
| pack-priv static ControllerState getInstanceFromController(ControllerIndex c) Return a controller state based on the current state of the passed controller. If the controller a disconnected mid-read, the disconnected controller is returned, and the pre-disconnection read data is ignored.
| |