Skip to main content

XINPUT_GAMEPAD

Describes the current state of the controller.

Syntax

Members

wButtons
Type: WORD
Bitmask of the device’s digital buttons. A set bit indicates that the corresponding button is pressed. Bits that are set but not defined above are reserved, and their state is undefined. bLeftTrigger
Type: BYTE
The current value of the Left Trigger’s analog control. The value is between 0 and 255. bRightTrigger
Type: BYTE
The current value of the Right Trigger’s analog control. The value is between 0 and 255. sThumbLX
Type: SHORT
Left thumbstick’s x-axis value. Each thumbstick axis member is a signed value that is between -32768 and 32767 and describes the position of the thumbstick. A value of 0 is centered, negative values signify down or to the left, and positive values signify up or to the right. The constants XINPUT_GAMEPAD_LEFT_THUMB_DEADZONE and XINPUT_GAMEPAD_RIGHT_THUMB_DEADZONE can be used as positive and negative values for filtering a thumbstick input. sThumbLY
Type: SHORT
Left thumbstick’s y-axis value, which is between -32768 and 32767. sThumbRX
Type: SHORT
Right thumbstick’s x-axis value, which is between -32768 and 32767. sThumbRY
Type: SHORT
Right thumbstick’s y-axis value, which is between -32768 and 32767.

Remarks

This structure is used by the XINPUT_STATE structure during the polling for changes in the state of the controller. The specific mapping of a button to a game function varies according to the game type. The constant XINPUT_GAMEPAD_TRIGGER_THRESHOLD may be used as the value that bLeftTrigger and bRightTrigger must be greater than to register as pressed. This is optional but often desirable.

Requirements

Header: XInputOnGameInput.h Supported platforms: XBOX One family consoles and XBOX Series consoles

See also

Port XInput to GameInput
XInputOnGameInput
Last modified on August 20, 2026