> ## 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-CN/reference/input/gameinput/enums/gameinputkind.md)

`GameInputKind` 标志的组合，描述设备支持的每种输入类型。如果设备不支持任何已知的输入类型，则返回 `GameInputKindUnknown`。

## 备注

返回的标志描述的是整个设备。来自设备的单个读数仅包含其中的部分类型；使用 [IGameInputReading::GetInputKind](https://docs.xbox.com/zh-CN/reference/input/gameinput/interfaces/igameinputreading/methods/igameinputreading_getinputkind.md) 可以了解特定读数包含哪些输入类型。

支持某种输入类型通常意味着设备上相应的信息方法会返回数据。例如，如果返回的值包含 `GameInputKindGamepad`，则 [IGameInputDevice::GetGamepadInfo](https://docs.xbox.com/zh-CN/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getgamepadinfo.md) 返回 `true`。同样，`GameInputKindTouch` 表示 [IGameInputDevice::GetTouchSurfaceCount](https://docs.xbox.com/zh-CN/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_gettouchsurfacecount.md) 返回非零值。

`GameInputKindLighting` 是仅用于输出的类型。它表示设备具有可通过 [IGameInputDevice::SetLightingColor](https://docs.xbox.com/zh-CN/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-CN/reference/input/gameinput/deprecated/interfaces/igameinputdevice/methods/igameinputdevice_getdeviceinfo.md) 返回的 [GameInputDeviceInfo](https://docs.xbox.com/zh-CN/reference/input/gameinput/deprecated/structs/gameinputdeviceinfo.md) 结构的 `supportedInput` 成员中获取。

## 要求

**头文件：** GameInput.h

**库：** gameinput.lib

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

## 另请参阅

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

## 版本历史

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


## Related topics

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