> ## 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_STATE

> XINPUT_STATE

# XINPUT\_STATE

Describes the state of a controller.

<a id="syntaxSection" />

## Syntax

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

<a id="membersSection" />

### 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](/reference/input/xinputongameinput/structs/xinput_gamepad)

[XINPUT\_GAMEPAD](/reference/input/xinputongameinput/structs/xinput_gamepad) object that contains the current state of a controller.

<a id="remarksSection" />

## 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](/reference/input/xinputongameinput/functions/xinputgetstate) and [XInputGetStateWithToken](/reference/input/xinputongameinput/functions/xinputgetstatewithtoken) functions.

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

<a id="requirementsSection" />

## Requirements

**Header:** XInputOnGameInput.h

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

<a id="seealsoSection" />

## See also

[Porting from XInput to GameInput](/build/core-features/common/input/porting/input-porting-xinput)\
[XInputOnGameInput](/reference/input/xinputongameinput/xinputongameinput_members)


## Related topics

- [XINPUT_GAMEPAD](/reference/input/xinputongameinput/structs/xinput_gamepad.md)
- [XInputGetState](/reference/input/xinputongameinput/functions/xinputgetstate.md)
- [XInputGetStateWithToken](/reference/input/xinputongameinput/functions/xinputgetstatewithtoken.md)
- [XInputOnGameInput](/reference/input/xinputongameinput/xinputongameinput_members.md)
- [XINPUT_VIBRATION](/reference/input/xinputongameinput/structs/xinput_vibration.md)
