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

# GameInputDeviceInfo (非推奨)

> 入力デバイスに関するすべての情報を記述します (v4 で削除)。

> [!WARNING]
>
> **非推奨。** この構造体は GameInput v4 で削除され、現在の API では利用できません。代わりに、[IGameInputDevice](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputdevice/igameinputdevice.md) の個別の getter メソッドを使用してください。「解説」セクションの対応表を参照してください。

入力デバイスに関するすべての情報を記述します。

## 構文

```cpp theme={null}
struct GameInputDeviceInfo
{
    uint16_t               vendorId;
    uint16_t               productId;
    uint16_t               revisionNumber;
    GameInputUsage         usage;
    GameInputVersion       hardwareVersion;
    GameInputVersion       firmwareVersion;
    APP_LOCAL_DEVICE_ID    deviceId;
    APP_LOCAL_DEVICE_ID    deviceRootId;
    GameInputDeviceFamily  deviceFamily;
    GameInputKind          supportedInput;
    GameInputRumbleMotors  supportedRumbleMotors;
    GameInputSystemButtons supportedSystemButtons;
    GUID                   containerId;
    const char*            displayName;
    const char*            pnpPath;

    const GameInputKeyboardInfo* keyboardInfo;
    const GameInputMouseInfo*    mouseInfo;
    const GameInputSensorsInfo*  sensorsInfo;

    const GameInputControllerInfo*  controllerInfo;
    const GameInputArcadeStickInfo* arcadeStickInfo;
    const GameInputFlightStickInfo* flightStickInfo;
    const GameInputGamepadInfo*     gamepadInfo;
    const GameInputRacingWheelInfo* racingWheelInfo;

    uint32_t                               forceFeedbackMotorCount;
    const GameInputForceFeedbackMotorInfo* forceFeedbackMotorInfo;

    uint32_t                            inputReportCount;
    const GameInputRawDeviceReportInfo* inputReportInfo;

    uint32_t                            outputReportCount;
    const GameInputRawDeviceReportInfo* outputReportInfo;
};
```

### メンバー

*vendorId*\

型: uint16\_t

入力デバイスのベンダーを識別します。

*productId*\

型: uint16\_t

入力デバイスを製品として識別します。

*revisionNumber*\

型: uint16\_t

デバイスのハードウェア リビジョン番号 (存在する場合)。

*usage*\

型: [GameInputUsage](https://docs.xbox.com/ja-jp/reference/input/gameinput/structs/gameinputusage.md)

使用される入力を記述する 2 つの部分から成るインデックス。

*hardwareVersion*\

型: [GameInputVersion](https://docs.xbox.com/ja-jp/reference/input/gameinput/structs/gameinputversion.md)

デバイスのハードウェア バージョン (存在する場合)。

*firmwareVersion*\

型: [GameInputVersion](https://docs.xbox.com/ja-jp/reference/input/gameinput/structs/gameinputversion.md)

デバイスのファームウェア バージョン (存在する場合)。

*deviceId*\

型: APP\_LOCAL\_DEVICE\_ID

入力デバイスのデバイス ID。

*deviceRootId*\

型: APP\_LOCAL\_DEVICE\_ID

入力デバイスのルート ID。

*deviceFamily*\

型: [GameInputDeviceFamily](https://docs.xbox.com/ja-jp/reference/input/gameinput/enums/gameinputdevicefamily.md)

入力デバイスが属する入力デバイス ファミリを指定します。

*supportedInput*\

型: [GameInputKind](https://docs.xbox.com/ja-jp/reference/input/gameinput/enums/gameinputkind.md)

デバイスがサポートする入力の種類を記述します。

*supportedRumbleMotors*\

型: [GameInputRumbleMotors](https://docs.xbox.com/ja-jp/reference/input/gameinput/enums/gameinputrumblemotors.md)

デバイス上でアクセス可能な振動モーター (存在する場合) を記述します。

*supportedSystemButtons*\

型: [GameInputSystemButtons](https://docs.xbox.com/ja-jp/reference/input/gameinput/enums/gameinputsystembuttons.md)

システムを操作するために使用できるボタン (多くの場合ゲーム外で使用) を記述します。

*containerId*\

型: GUID

入力デバイスのコンテナー ID。

*displayName*\

型: const char\*

デバイスのフレンドリ名を記述します。

*pnpPath*\

型: const char\*

デバイスのプラグ アンド プレイ機能を記述します。このパスを使用して、他の API から基になるデバイスを参照します。

*keyboardInfo*\

型: [GameInputKeyboardInfo](https://docs.xbox.com/ja-jp/reference/input/gameinput/structs/gameinputkeyboardinfo.md) const \*

キーボード入力デバイスに関する情報。

*mouseInfo*\

型: [GameInputMouseInfo](https://docs.xbox.com/ja-jp/reference/input/gameinput/structs/gameinputmouseinfo.md) const \*

マウス入力デバイスに関する情報。

*sensorsInfo*\

型: [GameInputSensorsInfo](https://docs.xbox.com/ja-jp/reference/input/gameinput/structs/gameinputsensorsinfo.md) const \*

デバイス上のセンサーに関する情報。

*controllerInfo*\

型: [GameInputControllerInfo](https://docs.xbox.com/ja-jp/reference/input/gameinput/deprecated/structs/gameinputcontrollerinfo.md) const \*

汎用コントローラー入力デバイスに関する情報。コントローラーは、デバイス上のマッピングされていない生の軸、ボタン、スイッチを表します。

*arcadeStickInfo*\

型: [GameInputArcadeStickInfo](https://docs.xbox.com/ja-jp/reference/input/gameinput/structs/gameinputarcadestickinfo.md) const \*

アーケード スティック入力デバイスに関する情報。

*flightStickInfo*\

型: [GameInputFlightStickInfo](https://docs.xbox.com/ja-jp/reference/input/gameinput/structs/gameinputflightstickinfo.md) const \*

フライト スティック入力デバイスに関する情報。

*gamepadInfo*\

型: [GameInputGamepadInfo](https://docs.xbox.com/ja-jp/reference/input/gameinput/structs/gameinputgamepadinfo.md) const \*

ゲームパッド入力デバイスに関する情報。

*racingWheelInfo*\

型: [GameInputRacingWheelInfo](https://docs.xbox.com/ja-jp/reference/input/gameinput/structs/gameinputracingwheelinfo.md) const \*

レーシング ホイール入力デバイスに関する情報。

*forceFeedbackMotorCount*\

型: uint32\_t

入力デバイス上のフォース フィードバック モーターの数。

*forceFeedbackMotorInfo*\

型: [GameInputForceFeedbackMotorInfo](https://docs.xbox.com/ja-jp/reference/input/gameinput/structs/gameinputforcefeedbackmotorinfo.md) const \*

デバイス上のすべてのフォース フィードバック モーターに関する情報。

*inputReportCount*\

型: uint32\_t

デバイスの入力レポートの数。

*inputReportInfo*\

型: [GameInputRawDeviceReportInfo](https://docs.xbox.com/ja-jp/reference/input/gameinput/structs/gameinputrawdevicereportinfo.md) const \*

入力レポート情報オブジェクト。

*outputReportCount*\

型: uint32\_t

デバイスの出力レポートの数。

*outputReportInfo*\

型: [GameInputRawDeviceReportInfo](https://docs.xbox.com/ja-jp/reference/input/gameinput/structs/gameinputrawdevicereportinfo.md) const \*

出力レポート。

## 解説

この構造体のすべての文字列メンバーは UTF-8 エンコードを使用します。

`deviceId` はアプリケーション ローカル ID であり、デバイスを一意に識別する 256 ビットのハッシュ値です。この ID は、デバイスが同じ USB ポートに接続されている限り、アプリケーションの実行やシステムの再起動をまたいでも、特定のデバイスに対して常に同じ値のままです。アプリケーションは、呼び出し元のアプリケーションとシステムに固有の情報を一部使用して、アプリケーション ローカル ID のハッシュを生成します。

`deviceRootId` もアプリケーション ローカル ID で、複合デバイスのルート デバイス ノードを識別します。これにより、アプリケーションは個々のデバイス間の関係を判断できます。たとえば、一部のゲーミング キーボードは、複数のキーボード ノードを持つ複合デバイスとして自身を公開することで、同時に 8 つのキーストロークという従来の USB の制限を回避しています。これらのノードは "システム" キーボードに統合されるため、通常ユーザーがこれを意識することはありません。しかし、GameInput API を介してキーボードごとの入力を処理する場合、この仕組みを理解しておくと、アプリケーションが機能をキーストロークにマッピングする際に不適切な想定 (たとえば、キーストロークは常に特定のデバイスから送られてくるという想定) を避けることができます。デバイスが複合デバイス上の複数のインターフェイスの 1 つでない場合、`deviceId` と `deviceRootId` は同じになります。

`displayName` 文字列には、デバイスの "フレンドリ" 名が含まれます。この文字列はアプリケーションの UI に表示できますが、ローカライズされている保証はありません。ローカライズされていない可能性があるのは、GameInput API がこの文字列を複数の場所から検索し、最終的なフォールバックの 1 つがデバイスのファームウェアから取得されるためです。

`GameInputDeviceInfo` 構造体の最後のフィールドは、フォース フィードバックやハプティック フィードバックのサポートに関する情報など、デバイスに関する情報の可変サイズ配列へのポインターです。`NULL` ポインターは、対応する機能がデバイスで使用できないか、サポートされていないことを示します。ソース注釈言語 (SAL) の注釈に記載されているとおり、各配列の要素数は構造体内の対応するフィールドによって示されます。

すべての属性について読み取り可能な値を提供する入力デバイスはありません。デバイスによっては、関連する属性の値のみが含まれます。システムは、この情報を [IGameInputDevice::GetDeviceInfo](https://docs.xbox.com/ja-jp/reference/input/gameinput/deprecated/interfaces/igameinputdevice/methods/igameinputdevice_getdeviceinfo.md) を通じて返します。

### GameInput v4 での代替メソッド

GameInput v4 では、`GameInputDeviceInfo` の各メンバーは [IGameInputDevice](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputdevice/igameinputdevice.md) の getter メソッドに置き換えられています。

| v3 のメンバー | v4 での代替 |
| - | - |
| `vendorId` | [GetVendorId](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getvendorid.md) |
| `productId` | [GetProductId](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getproductid.md) |
| `revisionNumber` | [GetRevisionNumber](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getrevisionnumber.md) |
| `usage` | [GetUsage](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getusage.md) |
| `hardwareVersion` | [GetHardwareVersion](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_gethardwareversion.md) |
| `firmwareVersion` | [GetFirmwareVersion](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getfirmwareversion.md) |
| `deviceId` | [GetDeviceId](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getdeviceid.md) |
| `deviceRootId` | [GetDeviceRootId](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getdevicerootid.md) |
| `deviceFamily` | [GetDeviceFamily](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getdevicefamily.md) |
| `supportedInput` | [GetSupportedInput](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getsupportedinput.md) |
| `supportedRumbleMotors` | [GetSupportedRumbleMotors](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getsupportedrumblemotors.md) |
| `supportedSystemButtons` | [GetSupportedSystemButtons](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getsupportedsystembuttons.md) |
| `containerId` | [GetContainerId](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getcontainerid.md) |
| `displayName` | [GetDisplayName](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getdisplayname.md) |
| `pnpPath` | [GetPnpPath](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getpnppath.md) |
| `keyboardInfo` | [GetKeyboardInfo](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getkeyboardinfo.md) |
| `mouseInfo` | [GetMouseInfo](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getmouseinfo.md) |
| `sensorsInfo` | [GetSensorsInfo](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getsensorsinfo.md) |
| `controllerInfo` | [GetControllerAxisCount](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getcontrolleraxiscount.md)、[GetControllerAxisLabels](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getcontrolleraxislabels.md)、[GetControllerButtonCount](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getcontrollerbuttoncount.md)、[GetControllerButtonLabels](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getcontrollerbuttonlabels.md)、[GetControllerSwitchCount](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getcontrollerswitchcount.md)、[GetControllerSwitchInfo](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getcontrollerswitchinfo.md) |
| `arcadeStickInfo` | [GetArcadeStickInfo](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getarcadestickinfo.md) |
| `flightStickInfo` | [GetFlightStickInfo](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getflightstickinfo.md) |
| `gamepadInfo` | [GetGamepadInfo](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getgamepadinfo.md) |
| `racingWheelInfo` | [GetRacingWheelInfo](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getracingwheelinfo.md) |
| `forceFeedbackMotorCount` | [GetForceFeedbackMotorCount](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getforcefeedbackmotorcount.md) |
| `forceFeedbackMotorInfo` | [GetForceFeedbackMotorInfo](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getforcefeedbackmotorinfo.md) |
| `inputReportCount` | [GetInputReportCount](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getinputreportcount.md) |
| `inputReportInfo` | [GetInputReportInfo](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getinputreportinfo.md) |
| `outputReportCount` | [GetOutputReportCount](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getoutputreportcount.md) |
| `outputReportInfo` | [GetOutputReportInfo](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getoutputreportinfo.md) |

`keyboardInfo` や `gamepadInfo` などのデバイス固有の情報を表すポインター メンバーは、デバイスにその種類の入力がない場合は `NULL` でした。対応する v4 の getter (`GetKeyboardInfo` や `GetGamepadInfo` など) は、その場合 `false` を返します。

## 概念に関するドキュメント

* [GameInput でのフォース フィードバック](https://docs.xbox.com/ja-jp/build/core-features/common/input/advanced/input-forcefeedback.md)
* [GameInput デバイス](https://docs.xbox.com/ja-jp/build/core-features/common/input/overviews/input-devices.md)

## 関連項目

[非推奨の GameInput API メンバー](https://docs.xbox.com/ja-jp/reference/input/gameinput/deprecated/gameinput_deprecated_members.md)\
[IGameInputDevice](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputdevice/igameinputdevice.md)\
[Input API の概要](https://docs.xbox.com/ja-jp/build/core-features/common/input/overviews/input-overview.md)\
[GameInput](https://docs.xbox.com/ja-jp/reference/input/gameinput/gameinput_members.md)\
[IGameInputDevice::GetDeviceInfo](https://docs.xbox.com/ja-jp/reference/input/gameinput/deprecated/interfaces/igameinputdevice/methods/igameinputdevice_getdeviceinfo.md)

## バージョン履歴

| バージョン | 変更内容 |
| - | - |
| **v4** | 削除されました。 |
| **v3** | `uiNavigationInfo` が `controllerInfo` ポインターに置き換えられました。個別の軸/ボタン/スイッチの数と情報のフィールドが `controllerInfo` に置き換えられました。`inputReportCount`/`inputReportInfo` と `outputReportCount`/`outputReportInfo` が追加されました。`hapticFeedbackMotorInfo` が削除されました。 |
| **v2** | `revisionNumber`、`hardwareVersion`、`firmwareVersion`、`containerId` (GUID)、`sensorsInfo` ポインターが**追加**されました。 |
| **v1** | v0 からの**大幅な簡素化**: `infoSize`、`interfaceNumber`、`collectionNumber`、`capabilities` (GameInputDeviceCapabilities)、およびタッチ/ハプティクス/文字列/記述子の数のフィールドが削除され、`supportedSystemButtons`、`const char*` 型の `displayName`、`pnpPath` が追加されました。 |
| **v0** | 導入されました。 |

## 付録: 以前のバージョン

### v2

```cpp theme={null}
struct GameInputDeviceInfo
{
    uint16_t               vendorId;
    uint16_t               productId;
    uint16_t               revisionNumber;
    GameInputUsage         usage;
    GameInputVersion       hardwareVersion;
    GameInputVersion       firmwareVersion;
    APP_LOCAL_DEVICE_ID    deviceId;
    APP_LOCAL_DEVICE_ID    deviceRootId;
    GameInputDeviceFamily  deviceFamily;
    GameInputKind          supportedInput;
    GameInputRumbleMotors  supportedRumbleMotors;
    GameInputSystemButtons supportedSystemButtons;
    GUID                   containerId;
    const char*            displayName;
    const char*            pnpPath;

    const GameInputKeyboardInfo* keyboardInfo;
    const GameInputMouseInfo*    mouseInfo;
    const GameInputSensorsInfo*  sensorsInfo;

    const GameInputUiNavigationInfo* uiNavigationInfo;
    const GameInputArcadeStickInfo*  arcadeStickInfo;
    const GameInputFlightStickInfo*  flightStickInfo;
    const GameInputGamepadInfo*      gamepadInfo;
    const GameInputRacingWheelInfo*  racingWheelInfo;

    uint32_t                              controllerAxisCount;
    const GameInputControllerAxisInfo*    controllerAxisInfo;
    uint32_t                              controllerButtonCount;
    const GameInputControllerButtonInfo*  controllerButtonInfo;
    uint32_t                              controllerSwitchCount;
    const GameInputControllerSwitchInfo*  controllerSwitchInfo;

    uint32_t                               forceFeedbackMotorCount;
    const GameInputForceFeedbackMotorInfo* forceFeedbackMotorInfo;

    uint32_t                                hapticFeedbackMotorCount;
    const GameInputHapticFeedbackMotorInfo* hapticFeedbackMotorInfo;
};
```

### v1

```cpp theme={null}
struct GameInputDeviceInfo
{
    uint16_t               vendorId;
    uint16_t               productId;
    GameInputUsage         usage;
    APP_LOCAL_DEVICE_ID    deviceId;
    APP_LOCAL_DEVICE_ID    deviceRootId;
    GameInputDeviceFamily  deviceFamily;
    GameInputKind          supportedInput;
    GameInputRumbleMotors  supportedRumbleMotors;
    GameInputSystemButtons supportedSystemButtons;
    const char*            displayName;
    const char*            pnpPath;

    const GameInputKeyboardInfo* keyboardInfo;
    const GameInputMouseInfo*    mouseInfo;

    const GameInputUiNavigationInfo* uiNavigationInfo;
    const GameInputArcadeStickInfo*  arcadeStickInfo;
    const GameInputFlightStickInfo*  flightStickInfo;
    const GameInputGamepadInfo*      gamepadInfo;
    const GameInputRacingWheelInfo*  racingWheelInfo;

    uint32_t                              controllerAxisCount;
    const GameInputControllerAxisInfo*    controllerAxisInfo;
    uint32_t                              controllerButtonCount;
    const GameInputControllerButtonInfo*  controllerButtonInfo;
    uint32_t                              controllerSwitchCount;
    const GameInputControllerSwitchInfo*  controllerSwitchInfo;

    uint32_t                               forceFeedbackMotorCount;
    const GameInputForceFeedbackMotorInfo* forceFeedbackMotorInfo;

    uint32_t                                hapticFeedbackMotorCount;
    const GameInputHapticFeedbackMotorInfo* hapticFeedbackMotorInfo;
};
```


## Related topics

- [GetDeviceInfo (非推奨)](https://docs.xbox.com/ja-jp/reference/input/gameinput/deprecated/interfaces/igameinputdevice/methods/igameinputdevice_getdeviceinfo.md)
- [GameInputMotionInfo (非推奨)](https://docs.xbox.com/ja-jp/reference/input/gameinput/deprecated/structs/gameinputmotioninfo.md)
- [GameInputString (非推奨)](https://docs.xbox.com/ja-jp/reference/input/gameinput/deprecated/structs/gameinputstring.md)
- [GameInputControllerInfo (非推奨)](https://docs.xbox.com/ja-jp/reference/input/gameinput/deprecated/structs/gameinputcontrollerinfo.md)
- [GameInputRawDeviceReportItemInfo (非推奨)](https://docs.xbox.com/ja-jp/reference/input/gameinput/deprecated/structs/gameinputrawdevicereportiteminfo.md)
