> ## Documentation Index
> Fetch the complete documentation index at: https://devdocs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# XINPUT_GAMEPAD

> XINPUT_GAMEPAD

# XINPUT\_GAMEPAD

Describes the current state of the controller.

## Syntax

```cpp theme={null}
typedef struct XINPUT_GAMEPAD {  
    WORD wButtons;  
    BYTE bLeftTrigger;  
    BYTE bRightTrigger;  
    SHORT sThumbLX;  
    SHORT sThumbLY;  
    SHORT sThumbRX;  
    SHORT sThumbRY;  
} XINPUT_GAMEPAD  
```

### Members

*wButtons*\
Type: WORD

Bitmask of the device's digital buttons. A set bit indicates that the corresponding button is pressed.

| Device button                    | Bitmask |
| -------------------------------- | ------- |
| XINPUT\_GAMEPAD\_DPAD\_UP        | 0x0001  |
| XINPUT\_GAMEPAD\_DPAD\_DOWN      | 0x0002  |
| XINPUT\_GAMEPAD\_DPAD\_LEFT      | 0x0004  |
| XINPUT\_GAMEPAD\_DPAD\_RIGHT     | 0x0008  |
| XINPUT\_GAMEPAD\_START           | 0x0010  |
| XINPUT\_GAMEPAD\_BACK            | 0x0020  |
| XINPUT\_GAMEPAD\_LEFT\_THUMB     | 0x0040  |
| XINPUT\_GAMEPAD\_RIGHT\_THUMB    | 0x0080  |
| XINPUT\_GAMEPAD\_LEFT\_SHOULDER  | 0x0100  |
| XINPUT\_GAMEPAD\_RIGHT\_SHOULDER | 0x0200  |
| XINPUT\_GAMEPAD\_A               | 0x1000  |
| XINPUT\_GAMEPAD\_B               | 0x2000  |
| XINPUT\_GAMEPAD\_X               | 0x4000  |
| XINPUT\_GAMEPAD\_Y               | 0x8000  |

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](/reference/input/xinputongameinput/structs/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](/build/core-features/common/input/porting/input-porting-xinput)\
[XInputOnGameInput](/reference/input/xinputongameinput/xinputongameinput_members)


## Related topics

- [XINPUT_STATE](/reference/input/xinputongameinput/structs/xinput_state.md)
- [XInputOnGameInput](/reference/input/xinputongameinput/xinputongameinput_members.md)
- [XINPUT_CAPABILITIES](/reference/input/xinputongameinput/structs/xinput_capabilities.md)
- [Porting from XInput to GameInput](/build/core-features/common/input/porting/input-porting-xinput.md)
- [XInputGetKeystroke](/reference/input/xinputongameinput/functions/xinputgetkeystroke.md)
