> ## 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::GetDeviceFamily

> 获取设备所属的输入设备族。

获取设备所属的输入设备族。

## 语法

```cpp theme={null}
GameInputDeviceFamily GetDeviceFamily();
```

### 参数

此方法没有参数。

### 返回值

类型：[GameInputDeviceFamily](https://docs.xbox.com/zh-CN/reference/input/gameinput/enums/gameinputdevicefamily.md)

输入设备所属的设备族，例如 `GameInputFamilyXboxOne`、`GameInputFamilyHid` 或 `GameInputFamilyAggregate`。如果无法确定设备族，则返回 `GameInputFamilyUnknown`。

## 备注

设备族标识 GameInput 与设备通信时所使用的驱动程序或协议。它不描述设备提供的输入类型。若要确定输入类型，请使用 [IGameInputDevice::GetSupportedInput](https://docs.xbox.com/zh-CN/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getsupportedinput.md)。

通过 [IGameInput::CreateAggregateDevice](https://docs.xbox.com/zh-CN/reference/input/gameinput/interfaces/igameinput/methods/igameinput_createaggregatedevice.md) 创建的聚合设备报告 `GameInputFamilyAggregate`。

设备族在设备对象的生存期内不会更改。

在 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) 结构的 `deviceFamily` 成员中获取。

## 要求

**头文件：** 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)\
[GameInputDeviceFamily](https://docs.xbox.com/zh-CN/reference/input/gameinput/enums/gameinputdevicefamily.md)\
[IGameInputDevice::GetSupportedInput](https://docs.xbox.com/zh-CN/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getsupportedinput.md)

## 版本历史

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


## Related topics

- [GameInputDeviceFamily](https://docs.xbox.com/zh-CN/reference/input/gameinput/enums/gameinputdevicefamily.md)
- [IGameInputDevice（接口内容）](https://docs.xbox.com/zh-CN/reference/input/gameinput/interfaces/igameinputdevice/igameinputdevice.md)
- [IGameInputDevice::GetDeviceId](https://docs.xbox.com/zh-CN/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getdeviceid.md)
- [IGameInputDevice::GetXInputDeviceIndex](https://docs.xbox.com/zh-CN/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getxinputdeviceindex.md)
- [IGameInputDevice::GetDeviceRootId](https://docs.xbox.com/zh-CN/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getdevicerootid.md)
