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

# XINPUT_STATE

> XINPUT_STATE

Describes the state of a controller.

## Syntax

```cpp theme={null}
typedef struct XINPUT_STATE {  
    DWORD dwPacketNumber;  
    XINPUT_GAMEPAD Gamepad;  
} XINPUT_STATE  
```

### Members

*dwPacketNumber*\
Type: DWORD

State packet number. The packet number indicates whether the state of the controller has changed. If the value is the same in sequentially returned `XINPUT_STATE` objects, the controller state has not changed.

*Gamepad*\
Type: [XINPUT\_GAMEPAD](https://docs.xbox.com/reference/input/xinputongameinput/structs/xinput_gamepad.md)

[XINPUT\_GAMEPAD](https://docs.xbox.com/reference/input/xinputongameinput/structs/xinput_gamepad.md) object that contains the current state of a controller.

## Remarks

The value of *dwPacketNumber* is incremented only if the state of the controller changed since the controller was last polled.

This structure is used by the [XInputGetState](https://docs.xbox.com/reference/input/xinputongameinput/functions/xinputgetstate.md) and [XInputGetStateWithToken](https://docs.xbox.com/reference/input/xinputongameinput/functions/xinputgetstatewithtoken.md) functions.

For more information, see [The XInputOnGameInput wrapper](https://docs.xbox.com/build/core-features/common/input/porting/input-porting-xinput.md#xinputWrapperSection).

## Requirements

**Header:** XInputOnGameInput.h

**Supported platforms:** XBOX One family consoles and XBOX Series consoles

## See also

[Porting from XInput to GameInput](https://docs.xbox.com/build/core-features/common/input/porting/input-porting-xinput.md)\
[XInputOnGameInput](https://docs.xbox.com/reference/input/xinputongameinput/xinputongameinput_members.md)


## Related topics

- [XINPUT_GAMEPAD](https://docs.xbox.com/reference/input/xinputongameinput/structs/xinput_gamepad.md)
- [XInputGetState](https://docs.xbox.com/reference/input/xinputongameinput/functions/xinputgetstate.md)
- [XInputGetStateWithToken](https://docs.xbox.com/reference/input/xinputongameinput/functions/xinputgetstatewithtoken.md)
- [XInputOnGameInput (API contents)](https://docs.xbox.com/reference/input/xinputongameinput/xinputongameinput_members.md)
- [XINPUT_VIBRATION](https://docs.xbox.com/reference/input/xinputongameinput/structs/xinput_vibration.md)
