public class XboxControllerAdapter extends java.lang.Object implements XboxControllerListener
Constructor and Description |
---|
XboxControllerAdapter() |
Modifier and Type | Method and Description |
---|---|
void |
back(boolean pressed)
Notification when button BACK is pressed or released.
|
void |
buttonA(boolean pressed)
Notification when button A is pressed or released.
|
void |
buttonB(boolean pressed)
Notification when button B is pressed or released.
|
void |
buttonX(boolean pressed)
Notification when button X is pressed or released.
|
void |
buttonY(boolean pressed)
Notification when button Y is pressed or released.
|
void |
dpad(int direction,
boolean pressed)
Notification when the direction pad is actuated.
|
void |
isConnected(boolean connected)
Notification when the connection to the controller is lost or reestablished.
|
void |
leftShoulder(boolean pressed)
Notification when button LEFTSHOULDER is pressed or released.
|
void |
leftThumb(boolean pressed)
Notification when button LEFTTHUMB is pressed or released.
|
void |
leftThumbDirection(double direction)
Notification when the direction of the left thumb changes.
|
void |
leftThumbMagnitude(double magnitude)
Notification when the magnitude of the left thumb changes.
|
void |
leftTrigger(double value)
Notification when the LEFTTRIGGER value changes.
|
void |
rightShoulder(boolean pressed)
Notification when button RIGHTSHOULDER is pressed or released.
|
void |
rightThumb(boolean pressed)
Notification when button RIGHTTHUMB is pressed or released.
|
void |
rightThumbDirection(double direction)
Notification when the direction of the right thumb changes.
|
void |
rightThumbMagnitude(double magnitude)
Notification when the magnitude of the rigth thumb changes.
|
void |
rightTrigger(double value)
Notification when the RIGHTTRIGGER value changes.
|
void |
start(boolean pressed)
Notification when button START is pressed or released.
|
public void buttonA(boolean pressed)
buttonA
in interface XboxControllerListener
pressed
- true, when button is pressed; false, when releasedpublic void buttonB(boolean pressed)
buttonB
in interface XboxControllerListener
pressed
- true, when button is pressed; false, when releasedpublic void buttonX(boolean pressed)
buttonX
in interface XboxControllerListener
pressed
- true, when button is pressed; false, when releasedpublic void buttonY(boolean pressed)
buttonY
in interface XboxControllerListener
pressed
- true, when button is pressed; false, when releasedpublic void back(boolean pressed)
back
in interface XboxControllerListener
pressed
- true, when button is pressed; false, when releasedpublic void start(boolean pressed)
start
in interface XboxControllerListener
pressed
- true, when button is pressed; false, when releasedpublic void leftShoulder(boolean pressed)
leftShoulder
in interface XboxControllerListener
pressed
- true, when button is pressed; false, when releasedpublic void rightShoulder(boolean pressed)
rightShoulder
in interface XboxControllerListener
pressed
- true, when button is pressed; false, when releasedpublic void leftThumb(boolean pressed)
leftThumb
in interface XboxControllerListener
pressed
- true, when button is pressed; false, when releasedpublic void rightThumb(boolean pressed)
rightThumb
in interface XboxControllerListener
pressed
- true, when button is pressed; false, when releasedpublic void dpad(int direction, boolean pressed)
dpad
in interface XboxControllerListener
direction
- one of the values 0..7pressed
- true, when button is pressed; false, when releasedpublic void leftTrigger(double value)
leftTrigger
in interface XboxControllerListener
value
- the new value -1..0..1public void rightTrigger(double value)
rightTrigger
in interface XboxControllerListener
value
- the new value -1..0..1public void leftThumbMagnitude(double magnitude)
leftThumbMagnitude
in interface XboxControllerListener
magnitude
- the new magnitude 0..1public void leftThumbDirection(double direction)
leftThumbDirection
in interface XboxControllerListener
direction
- the new direction 0..360 degrees (clockwise, 0 to north)public void rightThumbMagnitude(double magnitude)
rightThumbMagnitude
in interface XboxControllerListener
magnitude
- the new magnitude 0..1public void rightThumbDirection(double direction)
rightThumbDirection
in interface XboxControllerListener
direction
- the new direction 0..360 degrees (clockwise, 0 to northpublic void isConnected(boolean connected)
isConnected
in interface XboxControllerListener
connected
- true, if the connection is reestablished; false, if lost