public class XInputDevice14 extends XInputDevice
As with XInputDevice, certain methods in this class are not thread-safe.
It is not recommended to share an instance of XInputDevice14 across multiple threads.
playerNum| Modifier | Constructor and Description |
|---|---|
protected |
XInputDevice14(int playerNum) |
| Modifier and Type | Method and Description |
|---|---|
static XInputDevice14[] |
getAllDevices()
Returns an array containing all registered XInput devices.
|
XInputBatteryInformation |
getBatteryInformation(XInputBatteryDeviceType deviceType)
Retrieves the device's battery information.
|
XInputCapabilities |
getCapabilities()
Retrieves the capabilities of the device.
|
static XInputDevice14 |
getDeviceFor(int playerNum)
Returns the XInput device for the specified player.
|
XInputCapabilities |
getGamepadCapabilities()
Retrieves the capabilities of the gamepad.
|
XInputKeystroke |
getKeystroke()
Retrieves the next keystroke from this device, or
null if there are no more keystrokes or the device is
not connected. |
static boolean |
isAvailable()
Determines if the XInput devices are available on this platform.
|
static void |
setEnabled(boolean enabled)
Enables or disables the reporting state of XInput.
|
addListener, checkReturnCode, checkReturnCode, getComponents, getDelta, getLastComponents, getLibraryVersion, getPlayerNum, isConnected, isGuideButtonSupported, newBuffer, poll, removeListener, setPreProcessData, setVibrationpublic static boolean isAvailable()
true if the XInput devices are available, false if notpublic static XInputDevice14[] getAllDevices() throws XInputNotLoadedException
The XInputDevice14 objects are not thread-safe.
XInputNotLoadedException - if the native library failed to loadpublic static XInputDevice14 getDeviceFor(int playerNum) throws XInputNotLoadedException
The returned object should not be shared among multiple threads.
playerNum - the player numberXInputNotLoadedException - if the native library failed to loadpublic static void setEnabled(boolean enabled)
enabled - true to enable XInput to send and receive data to/from the device, false to
force it to return neutral data and prevent sending data to the devicepublic XInputCapabilities getCapabilities()
This method is not thread-safe.
null if the device is not connectedIllegalStateException - if there is an error trying to read the device statepublic XInputCapabilities getGamepadCapabilities()
This method is not thread-safe.
null if the device is not connectedIllegalStateException - if there is an error trying to read the device statepublic XInputBatteryInformation getBatteryInformation(XInputBatteryDeviceType deviceType)
This method is not thread-safe.
deviceType - the type of device to obtain battery information fromXInputBatteryInformation or null if the device is not connectedIllegalStateException - if there is an error trying to read the device statepublic XInputKeystroke getKeystroke()
null if there are no more keystrokes or the device is
not connected.
This method is not thread-safe.
Copyright © 2018. All rights reserved.