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

# GetDevice

> IGameInputReading::GetDevice

# IGameInputReading::GetDevice

获取与某个 IGameInputReading 关联的设备。

## 语法

```cpp theme={null}
void GetDevice(
    IGameInputDevice** device
);
```

### 参数

*device*   \_Outptr\_\\
类型：IGameInputDevice\*\*

与该 IGameInputReading 关联的设备。

### 返回值

类型：void

## 备注

使用此方法可获取有关设备型号及其功能的信息。例如，你可能需要知道设备上的按钮、数组和轴的数量。当你需要为许多 Get\*State 函数（例如 [IGameInputReading::GetGamepadState](https://docs.xbox.com/zh-CN/reference/input/gameinput/interfaces/igameinputreading/methods/igameinputreading_getgamepadstate.md)，这些函数需要开发人员创建的缓冲区）传入适当大小的缓冲区时，这一点非常重要。

## 要求

**头文件：** GameInput.h

[输入 API 概述](https://docs.xbox.com/zh-CN/build/core-features/common/input/overviews/input-overview.md)\
[IGameInputReading](https://docs.xbox.com/zh-CN/reference/input/gameinput/interfaces/igameinputreading/igameinputreading.md)\
[IGameInputReading::GetGamepadState](https://docs.xbox.com/zh-CN/reference/input/gameinput/interfaces/igameinputreading/methods/igameinputreading_getgamepadstate.md)

## 版本历史

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


## Related topics

- [GetDevice](https://docs.xbox.com/zh-CN/reference/graphics/d3d12/interfaces/id3d12devicechild/methods/id3d12devicechild_getdevice_public.md)
- [PartyNetwork::GetDevices](https://docs.xbox.com/zh-CN/services/playfab/multiplayer/networking/reference/classes/PartyNetwork/methods/partynetwork_getdevices.md)
- [PartyEndpoint::GetDevice](https://docs.xbox.com/zh-CN/services/playfab/multiplayer/networking/reference/classes/PartyEndpoint/methods/partyendpoint_getdevice.md)
- [PartyChatControl::GetDevice](https://docs.xbox.com/zh-CN/services/playfab/multiplayer/networking/reference/classes/PartyChatControl/methods/partychatcontrol_getdevice.md)
- [IGameInputForceFeedbackEffect::GetDevice](https://docs.xbox.com/zh-CN/reference/input/gameinput/interfaces/igameinputforcefeedbackeffect/methods/igameinputforcefeedbackeffect_getdevice.md)
