public class XboxController
extends java.lang.Object
Constructor and Description |
---|
XboxController()
Same as XboxController(dll, 1, 50, 50).
|
XboxController(int playerNb)
Same as XboxController(dll, int playerNb, 50, 50).
|
XboxController(int controllerPollPeriod,
int queuePollPeriod)
Same as XboxController(dll, 1, controllerPollPeriod, queuePollPeriod).
|
XboxController(java.lang.String dll,
int playerNb,
int controllerPollPeriod,
int queuePollPeriod)
Creates a XboxController instance using the given native Windows DLL
and tries to establish a connection to the controller with the given
player number.
|
Modifier and Type | Method and Description |
---|---|
void |
addXboxControllerListener(XboxControllerListener xboxControllerListener)
Registers the given XboxControllerListener and starts polling the event queue.
|
static java.lang.String |
getVersion()
Returns version information.
|
boolean |
isConnected()
Returns true if the last native polling call to the controller was successful.
|
void |
release()
Release native resources.
|
void |
setDebug(boolean on)
Displays debug information when the native thread sends data to the
FIFO queue and when the Java thread receives it.
|
void |
setLeftThumbDeadZone(double zone)
Sets the dead zone for the left thumb.
|
void |
setLeftTriggerDeadZone(double zone)
Sets the dead zone for LeftTrigger.
|
void |
setRightThumbDeadZone(double zone)
Sets the dead zone for the right thumb.
|
void |
setRightTriggerDeadZone(double zone)
Sets the dead zone for RightTrigger.
|
void |
vibrate(int leftVal,
int rightVal)
Starts vibration with given left und right intensity.
|
void |
vibrate(int leftVal,
int rightVal,
int duration)
Vibrates with given left und right intensity for the given
duration.
|
public XboxController()
public XboxController(int controllerPollPeriod, int queuePollPeriod)
public XboxController(int playerNb)
public XboxController(java.lang.String dll, int playerNb, int controllerPollPeriod, int queuePollPeriod)
dll
- the fully qualified path to the native DLL.
If the extension .DLL is missing, the DLL is searched in the Windows path.playerNb
- the number of the player 1..4controllerPollPeriod
- the period (in ms) of the native timer that polls the state of the controllerqueuePollPeriod
- the period (in ms) of the Java timer that polls the message queuepublic void release()
public void setLeftTriggerDeadZone(double zone)
zone
- the zone with no notifications, no change if < 0 or > 1public void setRightTriggerDeadZone(double zone)
zone
- the zone with no notifications, no change if < 0 or > 1public void setLeftThumbDeadZone(double zone)
zone
- the zone to report magnitude 0public void setRightThumbDeadZone(double zone)
zone
- the zone to report magnitude 0public void vibrate(int leftVal, int rightVal)
leftVal
- left intensity 0..65535rightVal
- right intensity 0..65535public void vibrate(int leftVal, int rightVal, int duration)
leftVal
- left intensity 0..65535rightVal
- right intensity 0..65535duration
- rightVal vibration time in mspublic boolean isConnected()
public void addXboxControllerListener(XboxControllerListener xboxControllerListener)
xboxControllerListener
- the XboxControllerListener to registerpublic static java.lang.String getVersion()
public void setDebug(boolean on)
on
- if true, debug information is displayed at System.out