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

# GameInputGamepadState

> GameInputGamepadState

# GameInputGamepadState

描述遊戲台輸入裝置的狀態。

<a id="syntaxSection" />

## 語法

```cpp theme={null}
struct GameInputGamepadState
{
    GameInputGamepadButtons buttons;
    float                   leftTrigger;
    float                   rightTrigger;
    float                   leftThumbstickX;
    float                   leftThumbstickY;
    float                   rightThumbstickX;
    float                   rightThumbstickY;
};
```

<a id="membersSection" />

### 成員

*buttons*<br />
類型：[GameInputGamepadButtons](/zh-TW/reference/input/gameinput/enums/gameinputgamepadbuttons)

按下的遊戲台按鈕。

*leftTrigger*<br />
類型：float

左扳機的位置，正規化為範圍 \[0.0, 1.0] 內的值。

*rightTrigger*<br />
類型：float

右扳機的位置，正規化為範圍 \[0.0, 1.0] 內的值。

*leftThumbstickX*<br />
類型：float

左搖桿的水平位置，正規化為範圍 \[-1.0, 1.0] 內的值。

*leftThumbstickY*<br />
類型：float

左搖桿的垂直位置，正規化為範圍 \[-1.0, 1.0] 內的值。

*rightThumbstickX*<br />
類型：float

右搖桿的水平位置，正規化為範圍 \[-1.0, 1.0] 內的值。

*rightThumbstickY*<br />
類型：float

右搖桿的垂直位置，正規化為範圍 \[-1.0, 1.0] 內的值。

<a id="remarksSection" />

## 備註

由 [IGameInputReading:GetGamePadState](/zh-TW/reference/input/gameinput/interfaces/igameinputreading/methods/igameinputreading_getgamepadstate) 方法使用。

如需詳細資訊，請參閱 [GameInput 讀數](/zh-TW/build/core-features/common/input/overviews/input-readings)的[從讀數取得資料](/zh-TW/build/core-features/common/input/overviews/input-readings#gettingStateSection)一節。如需程式碼範例，請參閱[簡單的遊戲台輸入迴圈](/zh-TW/build/core-features/common/input/overviews/input-readings#sampleSection)。

<a id="requirementsSection" />

## 需求

**標頭：** GameInput.h

**支援的平台：** Windows、XBOX One 系列主機和 XBOX Series 主機

<a id="seealsoSection" />

## 另請參閱

[GameInput 概觀](/zh-TW/build/core-features/common/input/overviews/input-overview)\
[GameInput](/zh-TW/reference/input/gameinput/gameinput_members)

## 版本歷程記錄

| 版本 | 變更 |
| - | - |
| **v0** | 推出。 |


## Related topics

- [GameInputGamepadState](/reference/input/gameinput/structs/gameinputgamepadstate.md)
- [IGameInputReading::GetGamepadState](/reference/input/gameinput/interfaces/igameinputreading/methods/igameinputreading_getgamepadstate.md)
- [GameInput](/reference/input/gameinput/gameinput_members.md)
