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

# GameInputControllerSwitchInfo

> GameInputControllerSwitchInfo

# GameInputControllerSwitchInfo

描述輸入裝置上的開關。

## 語法

```cpp theme={null}
struct GameInputControllerSwitchInfo
{
    GameInputLabel      labels[GAMEINPUT_MAX_SWITCH_STATES];
    GameInputSwitchKind kind;
};
```

### 成員

*labels*\

類型：[GameInputLabel](https://docs.xbox.com/zh-TW/reference/input/gameinput/enums/gameinputlabel.md)

開關狀態的標籤。

*kind*\

類型：[GameInputSwitchKind](https://docs.xbox.com/zh-TW/reference/input/gameinput/enums/gameinputswitchkind.md)

開關的類型。

## 備註

此結構用於 [GameInputControllerInfo](https://docs.xbox.com/zh-TW/reference/input/gameinput/structs/gameinputcontrollerinfo.md) 結構中。`GameInputControllerInfo` 由 [GameInputDeviceInfo](https://docs.xbox.com/zh-TW/reference/input/gameinput/structs/gameinputdeviceinfo.md) 結構用來描述控制器輸入裝置的屬性。

## 需求

**標頭：** GameInput.h

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

## 另請參閱

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

## 版本歷程記錄

| 版本 | 變更 |
| - | - |
| **v3** | **已移除** `mappedInputKinds`。將單一的 `label` 取代為陣列 `labels[GAMEINPUT_MAX_SWITCH_STATES]`。 |
| **v1** | **已移除** `positionLabels[9]`，以及所有舊版/原始 HID 和 DInput 欄位 (`legacyDInputIndex`、`legacyHidIndex`、`rawReportIndex`、原始報告指標)。 |
| **v0** | 推出。 |

## 附錄：先前版本

### v1, v2

```cpp theme={null}
struct GameInputControllerSwitchInfo
{
    GameInputKind       mappedInputKinds;
    GameInputLabel      label;
    GameInputSwitchKind kind;
};
```

### v0

```cpp theme={null}
struct GameInputControllerSwitchInfo
{
    GameInputKind       mappedInputKinds;
    GameInputLabel      label;
    GameInputLabel      positionLabels[9];
    GameInputSwitchKind kind;
    uint8_t             legacyDInputIndex;
    uint8_t             legacyHidIndex;
    uint16_t            rawReportIndex;
};
```


## Related topics

- [GameInputControllerInfo](https://docs.xbox.com/zh-TW/reference/input/gameinput/structs/gameinputcontrollerinfo.md)
- [GameInputSwitchKind](https://docs.xbox.com/zh-TW/reference/input/gameinput/enums/gameinputswitchkind.md)
- [GameInputLabel](https://docs.xbox.com/zh-TW/reference/input/gameinput/enums/gameinputlabel.md)
- [GameInput API 成員](https://docs.xbox.com/zh-TW/reference/input/gameinput/gameinput_members.md)
- [GetControllerSwitchCount](https://docs.xbox.com/zh-TW/reference/input/gameinput/interfaces/igameinputreading/methods/igameinputreading_getcontrollerswitchcount.md)
