public final class XInputKeystroke
extends com.sun.jna.Structure
XInput.XInputGetKeystroke(int, int, XInputKeystroke)
.
Future devices may return HID codes and virtual key values that are not supported on current devices, and are currently undefined.
Applications should ignore these unexpected values. A virtual-key code is a byte value that represents a particular physical key on the keyboard,
not the character or characters (possibly none) that the key can be mapped to based on keyboard state. The keyboard state at the time a virtual
key is pressed modifies the character reported. For example, VK_4 might represent a "4" or a "$", depending on the state of the SHIFT key.
A reported keyboard event includes the virtual key that caused the event, whether the key was pressed or released (or is repeating),
and the state of the keyboard at the time of the event. The keyboard state includes information about whether any CTRL, ALT,
or SHIFT keys are down. If the keyboard event represents an Unicode
character (for example, pressing the "A" key),
the Unicode
member will contain that character. Otherwise, Unicode
will contain the value zero.
The valid virtual-key (VK_xxx) codes are defined in XInput.h. In addition to codes that indicate key presses, the following codes indicate controller input.
Header | XInput.h |
---|
Source: Microsoft Documentation
XInput.XInputGetKeystroke(int, int, XInputKeystroke)
Modifier and Type | Field and Description |
---|---|
short |
Flags
Flags that indicate the keyboard state at the time of the input event.
|
byte |
HidCode
HID code corresponding to the input.
|
java.lang.String |
Unicode
This member is unused and the value is zero.
|
byte |
UserIndex
Index of the signed-in gamer associated with the device.
|
short |
VirtualKey
Virtual-key code of the key, button, or stick movement.
|
Constructor and Description |
---|
XInputKeystroke() |
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 VirtualKey
Source: Microsoft Documentation
public java.lang.String Unicode
Source: Microsoft Documentation
public short Flags
Flags that indicate the keyboard state at the time of the input event. This member can be any combination of the following flags:
Value | Description |
---|---|
XInput.XINPUT_KEYSTROKE_KEYDOWN } | The key was pressed. |
XInput.XINPUT_KEYSTROKE_KEYUP } | The key was released. |
XInput.XINPUT_KEYSTROKE_REPEAT } | A repeat of a held key. |
Source: Microsoft Documentation
public byte UserIndex
0
– 3
.
Source: Microsoft Documentation
public byte HidCode
Source: Microsoft Documentation