> ## 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/ja-jp/reference/input/gameinput/structs/gameinputusage.md)\*

デバイスの HID 使用法ページと使用法 ID を受け取ります。

### 戻り値

型: void

## 解説

使用法は、使用法ページと使用法 ID で構成される 2 つの部分からなる HID インデックスで、デバイスが何であるかを表します。たとえば、ゲームパッドは通常、Generic Desktop 使用法ページ (0x01) と Gamepad 使用法 ID (0x05) を報告します。デバイスが使用法を報告しない場合、*usage* の両方のメンバーは 0 に設定されます。

使用法は、デバイス オブジェクトの有効期間中は変化しません。GameInput がデバイスから読み取ることができる入力の種類を確認するには、代わりに [IGameInputDevice::GetSupportedInput](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getsupportedinput.md) を使用します。

GameInput v3 以前では、この情報は [IGameInputDevice::GetDeviceInfo](https://docs.xbox.com/ja-jp/reference/input/gameinput/deprecated/interfaces/igameinputdevice/methods/igameinputdevice_getdeviceinfo.md) から返される [GameInputDeviceInfo](https://docs.xbox.com/ja-jp/reference/input/gameinput/deprecated/structs/gameinputdeviceinfo.md) 構造体の `usage` メンバーから取得できました。

## 要件

**ヘッダー:** GameInput.h

**ライブラリ:** gameinput.lib

**サポートされているプラットフォーム:** Windows、XBOX One ファミリー本体、XBOX Series 本体

## 関連項目

[GameInput の概要](https://docs.xbox.com/ja-jp/build/core-features/common/input/overviews/input-overview.md)\
[IGameInputDevice](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputdevice/igameinputdevice.md)\
[GameInputUsage](https://docs.xbox.com/ja-jp/reference/input/gameinput/structs/gameinputusage.md)\
[IGameInputDevice::GetSupportedInput](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getsupportedinput.md)

## バージョン履歴

| バージョン | 変更内容 |
| - | - |
| **v4** | 導入されました。 |


## Related topics

- [IGameInputDevice (インターフェイスの内容)](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputdevice/igameinputdevice.md)
- [IGameInputDevice::GetDeviceFamily](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getdevicefamily.md)
- [IGameInputDevice::GetDeviceId](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getdeviceid.md)
- [IGameInputDevice::GetXInputDeviceIndex](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getxinputdeviceindex.md)
- [IGameInputDevice::GetDeviceRootId](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getdevicerootid.md)
