public abstract class PS4Controller extends java.lang.Object implements MdxController<PS4ControllerListener>
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
MAC_ID |
static java.lang.String |
WINDOWS_ID |
Constructor and Description |
---|
PS4Controller(com.badlogic.gdx.controllers.Controller controller) |
PS4Controller(com.badlogic.gdx.controllers.Controller controller,
DeadZone leftStickDeadZone,
DeadZone rightStickDeadZone) |
Modifier and Type | Method and Description |
---|---|
void |
addListener(int index,
PS4ControllerListener listener)
Inserts a listener at the specified index to the controller
|
void |
addListener(PS4ControllerListener 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() |
PS4ControllerListener |
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(PS4Button button) |
protected boolean |
notifyButtonUp(PS4Button button) |
protected boolean |
notifyDisconnected() |
protected boolean |
notifyL2Moved(float value) |
protected boolean |
notifyLeftStickXMoved(float value) |
protected boolean |
notifyLeftStickYMoved(float value) |
protected boolean |
notifyR2Moved(float value) |
protected boolean |
notifyRightStickXMoved(float value) |
protected boolean |
notifyRightStickYMoved(float value) |
void |
removeListener(int index)
Removes a listener at the specified index from this controller
|
void |
removeListener(PS4ControllerListener listener)
Removes a listener from this controller
|
void |
setLeftStickDeadZone(DeadZone leftStickDeadZone) |
void |
setRightStickDeadZone(DeadZone rightStickDeadZone) |
public static final java.lang.String WINDOWS_ID
public static final java.lang.String MAC_ID
public PS4Controller(com.badlogic.gdx.controllers.Controller controller)
protected boolean notifyDisconnected()
protected boolean notifyButtonDown(PS4Button button)
protected boolean notifyButtonUp(PS4Button button)
protected boolean notifyLeftStickXMoved(float value)
protected boolean notifyLeftStickYMoved(float value)
protected boolean notifyRightStickXMoved(float value)
protected boolean notifyRightStickYMoved(float value)
protected boolean notifyL2Moved(float value)
protected boolean notifyR2Moved(float value)
public ControllerType getControllerType()
MdxController
ControllerType
for this controllergetControllerType
in interface MdxController<PS4ControllerListener>
ControllerType.UNKNOWN
if the controller is unknownpublic void addListener(int index, PS4ControllerListener listener)
MdxController
addListener
in interface MdxController<PS4ControllerListener>
index
- The index to insert the listener atlistener
- The listener to insertpublic void addListener(PS4ControllerListener listener)
MdxController
addListener
in interface MdxController<PS4ControllerListener>
listener
- The listener to addpublic void removeListener(int index)
MdxController
removeListener
in interface MdxController<PS4ControllerListener>
index
- The index to removepublic void removeListener(PS4ControllerListener listener)
MdxController
removeListener
in interface MdxController<PS4ControllerListener>
listener
- The listener to removepublic PS4ControllerListener getListener(int index)
MdxController
getListener
in interface MdxController<PS4ControllerListener>
index
- The index to returnpublic int getTotalListeners()
MdxController
getTotalListeners
in interface MdxController<PS4ControllerListener>
public void clearListeners()
MdxController
clearListeners
in interface MdxController<PS4ControllerListener>
public DeadZone getLeftStickDeadZone()
public void setLeftStickDeadZone(DeadZone leftStickDeadZone)
public DeadZone getRightStickDeadZone()
public void setRightStickDeadZone(DeadZone rightStickDeadZone)