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

# XINPUT\_STATE

コントローラーの状態を表します。

## 構文

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

### メンバー

*dwPacketNumber*\
型: DWORD

状態パケット番号。パケット番号は、コントローラーの状態が変化したかどうかを示します。連続して返される `XINPUT_STATE` オブジェクトで値が同じである場合、コントローラーの状態は変化していません。

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

コントローラーの現在の状態を含む [XINPUT\_GAMEPAD](https://docs.xbox.com/ja-jp/reference/input/xinputongameinput/structs/xinput_gamepad.md) オブジェクト。

## 解説

*dwPacketNumber* の値は、コントローラーが前回ポーリングされてから状態が変化した場合にのみ増加します。

この構造体は [XInputGetState](https://docs.xbox.com/ja-jp/reference/input/xinputongameinput/functions/xinputgetstate.md) および [XInputGetStateWithToken](https://docs.xbox.com/ja-jp/reference/input/xinputongameinput/functions/xinputgetstatewithtoken.md) 関数で使用されます。

詳細については、[XInputOnGameInput ラッパー](https://docs.xbox.com/ja-jp/build/core-features/common/input/porting/input-porting-xinput.md#xinputWrapperSection)を参照してください。

## 要件

**ヘッダー:** XInputOnGameInput.h

**対応プラットフォーム:** XBOX One ファミリー本体および XBOX Series 本体

## 関連項目

[XInput から GameInput への移植](https://docs.xbox.com/ja-jp/build/core-features/common/input/porting/input-porting-xinput.md)\
[XInputOnGameInput](https://docs.xbox.com/ja-jp/reference/input/xinputongameinput/xinputongameinput_members.md)


## Related topics

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