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

> 取得描述輸入裝置主要用途的 HID 使用方式。

取得描述輸入裝置主要用途的 HID 使用方式。

## 語法

```cpp theme={null}
void GetUsage(
    GameInputUsage* usage
);
```

### 參數

*usage*   \_Out\_\
類型：[GameInputUsage](https://docs.xbox.com/zh-TW/reference/input/gameinput/structs/gameinputusage.md)\*

接收裝置的 HID 使用方式頁面和使用方式識別碼。

### 傳回值

類型：void

## 備註

使用方式是由使用方式頁面和使用方式識別碼組成的兩部分 HID 索引，用來描述裝置是什麼。例如，遊戲台通常會回報 Generic Desktop 使用方式頁面 (0x01) 以及 Gamepad 使用方式識別碼 (0x05)。如果裝置未回報使用方式，*usage* 的兩個成員都會設定為 0。

使用方式在裝置物件的存留期間內不會變更。若要判斷 GameInput 可以從裝置讀取哪些輸入類型，請改用 [IGameInputDevice::GetSupportedInput](https://docs.xbox.com/zh-TW/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getsupportedinput.md)。

在 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) 結構的 `usage` 成員取得。

## 需求

**標頭：** 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)\
[GameInputUsage](https://docs.xbox.com/zh-TW/reference/input/gameinput/structs/gameinputusage.md)\
[IGameInputDevice::GetSupportedInput](https://docs.xbox.com/zh-TW/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getsupportedinput.md)

## 版本歷程記錄

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


## Related topics

- [IGameInputDevice (介面內容)](https://docs.xbox.com/zh-TW/reference/input/gameinput/interfaces/igameinputdevice/igameinputdevice.md)
- [IGameInputDevice::GetDeviceFamily](https://docs.xbox.com/zh-TW/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getdevicefamily.md)
- [IGameInputDevice::GetDeviceId](https://docs.xbox.com/zh-TW/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getdeviceid.md)
- [IGameInputDevice::GetXInputDeviceIndex](https://docs.xbox.com/zh-TW/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getxinputdeviceindex.md)
- [IGameInputDevice::GetSupportedInput](https://docs.xbox.com/zh-TW/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getsupportedinput.md)
