public final class XInputGamepad
extends com.sun.jna.Structure
Describes the current state of the Xbox 360 Controller.
XInput.XINPUT_GAMEPAD_TRIGGER_THRESHOLD
may be used as the value which bLeftTrigger
and bRightTrigger
must be greater than to register as pressed. This is optional, but often desirable. Xbox 360 Controller buttons do not manifest crosstalk.
Header | XInput.h |
---|
Source: Microsoft Documentation
XInput.XInputGetState(int, XInputState)
,
XInputState
Modifier and Type | Field and Description |
---|---|
byte |
bLeftTrigger
The current value of the left trigger analog control.
|
byte |
bRightTrigger
The current value of the right trigger analog control.
|
short |
sThumbLX
Left thumbstick x-axis value.
|
short |
sThumbLY
Left thumbstick y-axis value.
|
short |
sThumbRX
Right thumbstick x-axis value.
|
short |
sThumbRY
Right thumbstick y-axis value.
|
short |
wButtons
Bitmask of the device digital buttons, as follows.
|
Constructor and Description |
---|
XInputGamepad() |
autoRead, autoRead, autoWrite, autoWrite, clear, createFieldsOrder, createFieldsOrder, createFieldsOrder, createFieldsOrder, dataEquals, dataEquals, equals, getAutoRead, getAutoWrite, getPointer, hashCode, newInstance, newInstance, read, readField, setAutoRead, setAutoSynch, setAutoWrite, size, toArray, toArray, toString, toString, write, writeField, writeField
public short wButtons
Bitmask of the device digital buttons, as follows. A set bit indicates that the corresponding button is pressed.
Device button | Bitmask |
---|---|
XInput.XINPUT_GAMEPAD_DPAD_UP | 0x0001 |
XInput.XINPUT_GAMEPAD_DPAD_DOWN | 0x0002 |
XInput.XINPUT_GAMEPAD_DPAD_LEFT | 0x0004 |
XInput.XINPUT_GAMEPAD_DPAD_RIGHT | 0x0008 |
XInput.XINPUT_GAMEPAD_START | 0x0010 |
XInput.XINPUT_GAMEPAD_BACK | 0x0020 |
XInput.XINPUT_GAMEPAD_LEFT_THUMB | 0x0040 |
XInput.XINPUT_GAMEPAD_RIGHT_THUMB | 0x0080 |
XInput.XINPUT_GAMEPAD_LEFT_SHOULDER | 0x0100 |
XInput.XINPUT_GAMEPAD_RIGHT_SHOULDER | 0x0200 |
XInput.XINPUT_GAMEPAD_A | 0x1000 |
XInput.XINPUT_GAMEPAD_B | 0x2000 |
XInput.XINPUT_GAMEPAD_X | 0x4000 |
XInput.XINPUT_GAMEPAD_Y | 0x8000 |
Bits that are set but not defined above are reserved, and their state is undefined.
Source: Microsoft Documentation
public byte bLeftTrigger
The current value of the left trigger analog control. The value is between 0
and 255
.
Source: Microsoft Documentation
public byte bRightTrigger
The current value of the right trigger analog control. The value is between 0
and 255
.
Source: Microsoft Documentation
public short sThumbLX
Left thumbstick x-axis value. Each of the thumbstick axis members is a signed value between and
describing the position of the thumbstick. A value of 0
is centered. Negative values signify down or to the left.
Positive values signify up or to the right. The constants XInput.XINPUT_GAMEPAD_LEFT_THUMB_DEADZONE
or XInput.XINPUT_GAMEPAD_RIGHT_THUMB_DEADZONE
can be used as a positive and negative value to filter a thumbstick input.
Source: Microsoft Documentation
public short sThumbLY
Left thumbstick y-axis value. The value is between and .
Source: Microsoft Documentation
public short sThumbRX
Right thumbstick x-axis value. The value is between and .
Source: Microsoft Documentation
public short sThumbRY
Right thumbstick y-axis value. The value is between and .
Source: Microsoft Documentation