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

# GameInputFlightStickButtons

> GameInputFlightStickButtons

# GameInputFlightStickButtons

列舉飛行搖桿按鈕。

<a id="syntaxSection" />

## 語法

```cpp theme={null}
enum GameInputFlightStickButtons
{
    GameInputFlightStickNone           = 0x00000000,
    GameInputFlightStickMenu           = 0x00000001,
    GameInputFlightStickView           = 0x00000002,
    GameInputFlightStickFirePrimary    = 0x00000004,
    GameInputFlightStickFireSecondary  = 0x00000008,
    GameInputFlightStickHatSwitchUp    = 0x00000010,
    GameInputFlightStickHatSwitchDown  = 0x00000020,
    GameInputFlightStickHatSwitchLeft  = 0x00000040,
    GameInputFlightStickHatSwitchRight = 0x00000080,
    GameInputFlightStickA              = 0x00000100,
    GameInputFlightStickB              = 0x00000200,
    GameInputFlightStickX              = 0x00000400,
    GameInputFlightStickY              = 0x00000800,
};
```

<a id="constantsSection" />

## 常數

| 常數 | 描述 |
| - | - |
| GameInputFlightStickNone | 表示未按下任何按鈕。 |
| GameInputFlightStickMenu | 表示已按下功能表按鈕。 |
| GameInputFlightStickView | 表示已按下檢視按鈕。 |
| GameInputFlightStickFirePrimary | 表示已按下主要射擊按鈕。 |
| GameInputFlightStickFireSecondary | 表示已按下次要射擊按鈕。 |
| GameInputFlightStickHatSwitchUp | 表示已按下帽型開關的上方部分。 |
| GameInputFlightStickHatSwitchDown | 表示已按下帽型開關的下方部分。 |
| GameInputFlightStickHatSwitchLeft | 表示已按下帽型開關的左側部分。 |
| GameInputFlightStickHatSwitchRight | 表示已按下帽型開關的右側部分。 |
| GameInputFlightStickA | 表示已按下遊戲台的 A 按鈕。 |
| GameInputFlightStickB | 表示已按下遊戲台的 B 按鈕。 |
| GameInputFlightStickX | 表示已按下遊戲台的 X 按鈕。 |
| GameInputFlightStickY | 表示已按下遊戲台的 Y 按鈕。 |

<a id="remarksSection" />

## 備註

此列舉用於 [GameInputFlightStickState](/zh-TW/reference/input/gameinput/structs/gameinputflightstickstate) 結構。您可以組合多個值，以同時讀取多個按鈕。

`GameInputFlightStickHatSwitchUp`、`GameInputFlightStickHatSwitchDown`、`GameInputFlightStickHatSwitchLeft` 和 `GameInputFlightStickHatSwitchRight` 是將帽型開關轉譯為按鈕值的結果。對角方向的表示方式是同時按下兩個按鈕，與遊戲台上的方向鍵相同。帽型開關置中時，表示這些按鈕都未按下。這些按鈕也是使用 [IGameInputMapper::GetFlightStickButtonMappingInfo](/zh-TW/reference/input/gameinput/interfaces/igameinputmapper/methods/igameinputmapper_getflightstickbuttonmappinginfo) 方法查詢帽型開關對應資訊的唯一方式。

`GameInputFlightStickA`、`GameInputFlightStickB`、`GameInputFlightStickX` 和 `GameInputFlightStickY` 不屬於飛行搖桿對應。這些值是從遊戲台按鈕報告複製而來。如果沒有遊戲台對應到該裝置，這些值一律為 0。

如需詳細資訊，請參閱 [GameInput 讀數](/zh-TW/build/core-features/common/input/overviews/input-readings)的[從讀數取得資料](/zh-TW/build/core-features/common/input/overviews/input-readings#gettingStateSection)一節。

此列舉也可以搭配 [IGameInputMapper::GetFlightStickButtonMappingInfo](/zh-TW/reference/input/gameinput/interfaces/igameinputmapper/methods/igameinputmapper_getflightstickbuttonmappinginfo) 方法使用，以擷取特定飛行搖桿按鈕的對應資訊。

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

## 版本歷程記錄

| 版本 | 變更 |
| - | - |
| **v3** | 為類似遊戲台的按鈕**新增 8 個常數**：`HatSwitchUp`、`HatSwitchDown`、`HatSwitchLeft`、`HatSwitchRight`、`A`、`B`、`X`、`Y`。 |
| **v0** | 推出。 |

## 附錄：先前版本

### v0

```cpp theme={null}
enum GameInputFlightStickButtons
{
    GameInputFlightStickNone          = 0x00000000,
    GameInputFlightStickMenu          = 0x00000001,
    GameInputFlightStickView          = 0x00000002,
    GameInputFlightStickFirePrimary   = 0x00000004,
    GameInputFlightStickFireSecondary = 0x00000008,
};
```


## Related topics

- [GameInputFlightStickButtons](/reference/input/gameinput/enums/gameinputflightstickbuttons.md)
- [IGameInputMapper::GetFlightStickButtonMappingInfo](/reference/input/gameinput/interfaces/igameinputmapper/methods/igameinputmapper_getflightstickbuttonmappinginfo.md)
- [GameInputFlightStickState](/reference/input/gameinput/structs/gameinputflightstickstate.md)
- [GameInput](/reference/input/gameinput/gameinput_members.md)
