public abstract class Xbox360Controller extends java.lang.Object implements MdxController<Xbox360ControllerListener>
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ID |
Constructor and Description |
---|
Xbox360Controller(com.badlogic.gdx.controllers.Controller controller) |
Xbox360Controller(com.badlogic.gdx.controllers.Controller controller,
DeadZone leftStickDeadZone,
DeadZone rightStickDeadZone) |
Modifier and Type | Method and Description |
---|---|
void |
addListener(int index,
Xbox360ControllerListener listener)
Inserts a listener at the specified index to the controller
|
void |
addListener(Xbox360ControllerListener listener)
Adds a listener to the controller
|
void |
clearListeners()
Removes all listeners from this controller
|
ControllerType |
getControllerType()
Returns the
ControllerType for this controller |
DeadZone |
getLeftStickDeadZone() |
Xbox360ControllerListener |
getListener(int index)
Gets the listener at the specified index for this controller
|
DeadZone |
getRightStickDeadZone() |
int |
getTotalListeners()
Returns the total number of listeners for this controller
|
protected boolean |
notifyButtonDown(Xbox360Button button) |
protected boolean |
notifyButtonUp(Xbox360Button button) |
protected boolean |
notifyDisconnected() |
protected boolean |
notifyLeftStickXMoved(float value) |
protected boolean |
notifyLeftStickYMoved(float value) |
protected boolean |
notifyLeftTriggerMoved(float value) |
protected boolean |
notifyRightStickXMoved(float value) |
protected boolean |
notifyRightStickYMoved(float value) |
protected boolean |
notifyRightTriggerMoved(float value) |
void |
removeListener(int index)
Removes a listener at the specified index from this controller
|
void |
removeListener(Xbox360ControllerListener listener)
Removes a listener from this controller
|
void |
setLeftStickDeadZone(DeadZone leftStickDeadZone) |
void |
setRightStickDeadZone(DeadZone rightStickDeadZone) |
public static final java.lang.String ID
public Xbox360Controller(com.badlogic.gdx.controllers.Controller controller)
protected boolean notifyDisconnected()
protected boolean notifyButtonDown(Xbox360Button button)
protected boolean notifyButtonUp(Xbox360Button button)
protected boolean notifyLeftTriggerMoved(float value)
protected boolean notifyRightTriggerMoved(float value)
protected boolean notifyLeftStickXMoved(float value)
protected boolean notifyLeftStickYMoved(float value)
protected boolean notifyRightStickXMoved(float value)
protected boolean notifyRightStickYMoved(float value)
public void addListener(int index, Xbox360ControllerListener listener)
MdxController
addListener
in interface MdxController<Xbox360ControllerListener>
index
- The index to insert the listener atlistener
- The listener to insertpublic void addListener(Xbox360ControllerListener listener)
MdxController
addListener
in interface MdxController<Xbox360ControllerListener>
listener
- The listener to addpublic void removeListener(int index)
MdxController
removeListener
in interface MdxController<Xbox360ControllerListener>
index
- The index to removepublic void removeListener(Xbox360ControllerListener listener)
MdxController
removeListener
in interface MdxController<Xbox360ControllerListener>
listener
- The listener to removepublic void clearListeners()
MdxController
clearListeners
in interface MdxController<Xbox360ControllerListener>
public Xbox360ControllerListener getListener(int index)
MdxController
getListener
in interface MdxController<Xbox360ControllerListener>
index
- The index to returnpublic int getTotalListeners()
MdxController
getTotalListeners
in interface MdxController<Xbox360ControllerListener>
public ControllerType getControllerType()
MdxController
ControllerType
for this controllergetControllerType
in interface MdxController<Xbox360ControllerListener>
ControllerType.UNKNOWN
if the controller is unknownpublic DeadZone getLeftStickDeadZone()
public void setLeftStickDeadZone(DeadZone leftStickDeadZone)
public DeadZone getRightStickDeadZone()
public void setRightStickDeadZone(DeadZone rightStickDeadZone)