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

# GameInputSwitchPosition

> GameInputSwitchPosition

# GameInputSwitchPosition

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

## 语法

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

## 常量

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

## 备注

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

此枚举在 [GameInputFlightStickState](https://docs.xbox.com/zh-CN/reference/input/gameinput/structs/gameinputflightstickstate.md) 结构以及 [IGameInputReading::GetControllerSwitchState](https://docs.xbox.com/zh-CN/reference/input/gameinput/interfaces/igameinputreading/methods/igameinputreading_getcontrollerswitchstate.md) 方法中使用。

有关 GameInput API 的中级和高级用例，请参阅 [高级 GameInput](https://docs.xbox.com/zh-CN/build/core-features/common/input/advanced/input-advanced-topics.md) 主题。

## 要求

**标头：** GameInput.h

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

## 另请参阅

[GameInput 概述](https://docs.xbox.com/zh-CN/build/core-features/common/input/overviews/input-overview.md)\
[GameInput](https://docs.xbox.com/zh-CN/reference/input/gameinput/gameinput_members.md)

## 版本历史

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


## Related topics

- [GetControllerAxisState](https://docs.xbox.com/zh-CN/reference/input/gameinput/interfaces/igameinputreading/methods/igameinputreading_getcontrolleraxisstate.md)
- [GameInput API 成员](https://docs.xbox.com/zh-CN/reference/input/gameinput/gameinput_members.md)
- [GameInputSwitchKind](https://docs.xbox.com/zh-CN/reference/input/gameinput/enums/gameinputswitchkind.md)
- [GetControllerSwitchCount](https://docs.xbox.com/zh-CN/reference/input/gameinput/interfaces/igameinputreading/methods/igameinputreading_getcontrollerswitchcount.md)
- [GetControllerSwitchState](https://docs.xbox.com/zh-CN/reference/input/gameinput/interfaces/igameinputreading/methods/igameinputreading_getcontrollerswitchstate.md)
