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

# IGameInputDevice::GetSupportedInput

> 取得輸入裝置支援的輸入類型。

取得輸入裝置支援的輸入類型。

## 語法

```cpp theme={null}
GameInputKind GetSupportedInput();
```

### 參數

此方法沒有參數。

### 傳回值

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

`GameInputKind` 旗標的組合，描述裝置支援的每種輸入類型。如果裝置不支援任何已知的輸入類型，則傳回 `GameInputKindUnknown`。

## 備註

傳回的旗標描述整個裝置。來自裝置的個別讀數只會包含其中部分類型；請使用 [IGameInputReading::GetInputKind](https://docs.xbox.com/zh-TW/reference/input/gameinput/interfaces/igameinputreading/methods/igameinputreading_getinputkind.md) 找出特定讀數包含哪些輸入類型。

支援的輸入類型通常表示裝置上對應的資訊方法會傳回資料。例如，如果傳回的值包含 `GameInputKindGamepad`，[IGameInputDevice::GetGamepadInfo](https://docs.xbox.com/zh-TW/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getgamepadinfo.md) 會傳回 `true`。同樣地，`GameInputKindTouch` 表示 [IGameInputDevice::GetTouchSurfaceCount](https://docs.xbox.com/zh-TW/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_gettouchsurfacecount.md) 會傳回非零值。

`GameInputKindLighting` 是僅限輸出的類型。它表示裝置具有可使用 [IGameInputDevice::SetLightingColor](https://docs.xbox.com/zh-TW/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_setlightingcolor.md) 控制的燈具；讀數永遠不會包含燈光資料。

下列範例會檢查裝置是否可以當作遊戲台使用。

```cpp theme={null}
bool IsGamepad(IGameInputDevice* device) noexcept
{
    return (device->GetSupportedInput() & GameInputKindGamepad) != 0;
}
```

支援的輸入類型集合在裝置物件的存留期間內不會變更。

在 GameInput v3 及更早版本中，此資訊可從 [IGameInputDevice::GetDeviceInfo](https://docs.xbox.com/zh-TW/reference/input/gameinput/deprecated/interfaces/igameinputdevice/methods/igameinputdevice_getdeviceinfo.md) 所傳回 [GameInputDeviceInfo](https://docs.xbox.com/zh-TW/reference/input/gameinput/deprecated/structs/gameinputdeviceinfo.md) 結構的 `supportedInput` 成員取得。

## 需求

**標頭：** GameInput.h

**程式庫：** gameinput.lib

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

## 另請參閱

[GameInput 概觀](https://docs.xbox.com/zh-TW/build/core-features/common/input/overviews/input-overview.md)\
[IGameInputDevice](https://docs.xbox.com/zh-TW/reference/input/gameinput/interfaces/igameinputdevice/igameinputdevice.md)\
[GameInputKind](https://docs.xbox.com/zh-TW/reference/input/gameinput/enums/gameinputkind.md)\
[IGameInputReading::GetInputKind](https://docs.xbox.com/zh-TW/reference/input/gameinput/interfaces/igameinputreading/methods/igameinputreading_getinputkind.md)

## 版本歷程記錄

| 版本 | 變更 |
| - | - |
| **v4** | 已推出。 |


## Related topics

- [IGameInputDevice::GetDeviceFamily](https://docs.xbox.com/zh-TW/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getdevicefamily.md)
- [IGameInputDevice::GetUsage](https://docs.xbox.com/zh-TW/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getusage.md)
- [IGameInputDevice::GetSupportedLightingGroups](https://docs.xbox.com/zh-TW/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getsupportedlightinggroups.md)
- [GameInputKind](https://docs.xbox.com/zh-TW/reference/input/gameinput/enums/gameinputkind.md)
- [IGameInputDevice::GetTouchSurfaceCount](https://docs.xbox.com/zh-TW/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_gettouchsurfacecount.md)
