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

# GameInputSwitchPosition

> GameInputSwitchPosition

# GameInputSwitchPosition

枚举输入设备上开关的位置。

<a id="syntaxSection" />

## 语法

```cpp theme={null}
enum GameInputSwitchPosition
{
    GameInputSwitchCenter    = 0,
    GameInputSwitchUp        = 1,
    GameInputSwitchUpRight   = 2,
    GameInputSwitchRight     = 3,
    GameInputSwitchDownRight = 4,
    GameInputSwitchDown      = 5,
    GameInputSwitchDownLeft  = 6,
    GameInputSwitchLeft      = 7,
    GameInputSwitchUpLeft    = 8
};
```

<a id="constantsSection" />

## 常量

| 常量                       | 说明        |
| ------------------------ | --------- |
| GameInputSwitchCenter    | 开关处于居中位置。 |
| GameInputSwitchUp        | 开关处于向上位置。 |
| GameInputSwitchUpRight   | 开关处于右上位置。 |
| GameInputSwitchRight     | 开关处于向右位置。 |
| GameInputSwitchDownRight | 开关处于右下位置。 |
| GameInputSwitchDown      | 开关处于向下位置。 |
| GameInputSwitchDownLeft  | 开关处于左下位置。 |
| GameInputSwitchLeft      | 开关处于向左位置。 |
| GameInputSwitchUpLeft    | 开关处于左上位置。 |

<a id="remarksSection" />

## 备注

并非所有开关都支持每种值。

此枚举在 [GameInputFlightStickState](/reference/input/gameinput/structs/gameinputflightstickstate) 结构以及 [IGameInputReading::GetControllerSwitchState](/reference/input/gameinput/interfaces/igameinputreading/methods/igameinputreading_getcontrollerswitchstate) 方法中使用。

有关 GameInput API 的中级和高级用例，请参阅 [高级 GameInput](/build/core-features/common/input/advanced/input-advanced-topics) 主题。

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

## 版本历史

| 版本     | 变更  |
| ------ | --- |
| **v0** | 引入。 |


## Related topics

- [IGameInputReading::GetControllerAxisState](/zh-CN/reference/input/gameinput/interfaces/igameinputreading/methods/igameinputreading_getcontrolleraxisstate.md)
- [GameInput](/zh-CN/reference/input/gameinput/gameinput_members.md)
- [GameInputSwitchKind](/zh-CN/reference/input/gameinput/enums/gameinputswitchkind.md)
- [IGameInputReading::GetControllerSwitchCount](/zh-CN/reference/input/gameinput/interfaces/igameinputreading/methods/igameinputreading_getcontrollerswitchcount.md)
- [IGameInputReading::GetControllerSwitchState](/zh-CN/reference/input/gameinput/interfaces/igameinputreading/methods/igameinputreading_getcontrollerswitchstate.md)
