public class Xbox360Controller
extends java.lang.Object
Constructor and Description |
---|
Xbox360Controller()
Creates a new Xbox360-Controller-Manager with a deadzone of 20%
|
Xbox360Controller(com.badlogic.gdx.controllers.Controller controller)
Creates a new Xbox360-Controller-Manager with given controller and a deadzone of 20%
|
Xbox360Controller(com.badlogic.gdx.controllers.Controller controller,
float deadzone)
Creates a new Xbox360-Controller-Manager with given controller
|
Xbox360Controller(float deadzone)
Creates a new Xbox360-Controller-Manager
|
Modifier and Type | Method and Description |
---|---|
com.badlogic.gdx.controllers.PovDirection |
getDPadState()
Returns state of the d-pad (see Xbox360Keys.DPad.*)
|
Xbox360StickState |
getLeftStickState()
Returns state of the left stick
|
float |
getLeftTriggerState()
Returns amplitude of the left trigger
|
Xbox360StickState |
getRightStickState()
Returns state of the right stick
|
float |
getRightTriggerState()
Returns amplitude of the right trigger
|
boolean |
isButtonPressed(int keyCode)
Is the button pressed?
|
boolean |
isDPadPressed()
Is the d-pad pressed?
|
boolean |
isLeftStickMoved()
Is left stick moved?
|
boolean |
isLeftTriggerPulled()
Is left trigger pulled?
|
boolean |
isReady()
Is the controller ready?
|
boolean |
isRightStickMoved()
Is right stick moved?
|
boolean |
isRightTriggerPulled()
Is right trigger pulled?
|
void |
setDeadzone(float deadzone)
Sets deadzone of Sticks and Triggers (valid: 0f ...
|
public Xbox360Controller()
public Xbox360Controller(float deadzone)
deadzone
- Deadzone of sticks and triggers (valid: 0f ... < 1f)public Xbox360Controller(com.badlogic.gdx.controllers.Controller controller)
controller
- Xbox360-Controllerpublic Xbox360Controller(com.badlogic.gdx.controllers.Controller controller, float deadzone)
controller
- Xbox360-Controllerdeadzone
- Deadzone of sticks and triggers (valid: 0f ... < 1f)public boolean isButtonPressed(int keyCode)
keyCode
- Key-code (use Xbox360Keys.Button.*)public boolean isDPadPressed()
public boolean isLeftStickMoved()
public boolean isLeftTriggerPulled()
public boolean isReady()
public boolean isRightStickMoved()
public boolean isRightTriggerPulled()
public com.badlogic.gdx.controllers.PovDirection getDPadState()
public Xbox360StickState getLeftStickState()
public float getLeftTriggerState()
public Xbox360StickState getRightStickState()
public float getRightTriggerState()
public void setDeadzone(float deadzone)
deadzone
- Deadzone of Sticks and Triggers (valid 0f ... < 1f)