> ## 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-TW/reference/input/gameinput/interfaces/igameinputreading/methods/igameinputreading_getgamepadstate.md)) 傳入適當大小的緩衝區時，這點非常重要。

## 需求

**標頭：** GameInput.h

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

## 版本歷程記錄

| 版本 | 變更 |
| - | - |
| **v0** | 推出。 |


## Related topics

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