> ## 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](/reference/input/gameinput/structs/gameinputflightstickstate) 结构中使用。你可以组合多个值以同时读取多个按钮。

`GameInputFlightStickHatSwitchUp`、`GameInputFlightStickHatSwitchDown`、`GameInputFlightStickHatSwitchLeft` 和 `GameInputFlightStickHatSwitchRight` 是帽形开关向按钮值的转换。对角方向通过同时呈现两个按钮为按下状态来表示，如同游戏手柄上的方向键。帽形开关的中心状态通过这些按钮均未被按下来表示。这些按钮也是使用 [IGameInputMapper::GetFlightStickButtonMappingInfo](/reference/input/gameinput/interfaces/igameinputmapper/methods/igameinputmapper_getflightstickbuttonmappinginfo) 方法查询帽形开关映射信息的唯一方式。

`GameInputFlightStickA`、`GameInputFlightStickB`、`GameInputFlightStickX` 和 `GameInputFlightStickY` 不属于飞行摇杆映射，而是从游戏手柄按钮报告中复制过来的值。如果没有映射到该设备的游戏手柄，这些值将始终为 0。

有关详细信息，请参阅 [GameInput 读数](/build/core-features/common/input/overviews/input-readings) 中的 [从读数获取数据](/build/core-features/common/input/overviews/input-readings#gettingStateSection) 部分。

此枚举还可与 [IGameInputMapper::GetFlightStickButtonMappingInfo](/reference/input/gameinput/interfaces/igameinputmapper/methods/igameinputmapper_getflightstickbuttonmappinginfo) 方法配合使用，以检索特定飞行摇杆按钮的映射信息。

<a id="requirementsSection" />

## 要求

**标头：** GameInput.h

**支持的平台：** Windows、XBOX One 系列主机和 XBOX Series 主机

<a id="seealsoSection" />

## 另请参阅

[GameInput 概述](/build/core-features/common/input/overviews/input-overview)\
[GameInput](/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

- [GameInput](/zh-CN/reference/input/gameinput/gameinput_members.md)
- [IGameInputReading::GetFlightStickState](/zh-CN/reference/input/gameinput/interfaces/igameinputreading/methods/igameinputreading_getflightstickstate.md)
- [GameInputArcadeStickButtons](/zh-CN/reference/input/gameinput/enums/gameinputarcadestickbuttons.md)
- [GameInputKind](/zh-CN/reference/input/gameinput/enums/gameinputkind.md)
- [GameInputLabel](/zh-CN/reference/input/gameinput/enums/gameinputlabel.md)
