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

> サポートされているボタン、サンプル レート、スクロール ホイールなど、デバイスのマウスのプロパティを取得します。

サポートされているボタン、サンプル レート、スクロール ホイールなど、デバイスのマウスのプロパティを取得します。

## 構文

```cpp theme={null}
bool GetMouseInfo(
    GameInputMouseInfo* info
);
```

### パラメーター

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

デバイスのマウスのプロパティを受け取る `GameInputMouseInfo` 構造体へのポインター。デバイスがマウス入力をサポートしていない場合、構造体のすべてのメンバーは 0 に設定されます。

### 戻り値

型: bool

デバイスがマウス入力をサポートしていて、*info* にデータが格納された場合は `true`。それ以外の場合は `false`。

## 解説

`GetMouseInfo` メソッドは、デバイスのマウスのプロパティを、呼び出し元が用意した構造体にコピーします。[GetSupportedInput](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getsupportedinput.md) から返される値に `GameInputKindMouse` が含まれている場合、そのデバイスはマウス入力をサポートしています。デバイスがマウス入力をサポートしていない場合、`GetMouseInfo` は *info* を 0 で初期化し、`false` を返します。

`supportedButtons` メンバーはマウスが備えている [GameInputMouseButtons](https://docs.xbox.com/ja-jp/reference/input/gameinput/enums/gameinputmousebuttons.md) を報告し、`hasWheelX` メンバーと `hasWheelY` メンバーはマウスに水平スクロール ホイールと垂直スクロール ホイールがあるかどうかを報告します。マウスの状態は、[IGameInputReading::GetMouseState](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputreading/methods/igameinputreading_getmousestate.md) を使用して読み取りから取得します。

このメソッドによって返されるプロパティはデバイスの有効期間中は固定されているため、一度 (たとえば、デバイスの接続時に) クエリを実行して結果をキャッシュできます。

次の例は、デバイスのマウスのプロパティをクエリする方法を示しています。

```cpp theme={null}
GameInputMouseInfo info;
if (device->GetMouseInfo(&info))
{
    if (info.hasWheelY)
    {
        // Enable scroll-wheel controls.
    }
}
```

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) 構造体の `mouseInfo` メンバーから取得できました。

## 要件

**ヘッダー:** 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)\
[GameInputMouseInfo](https://docs.xbox.com/ja-jp/reference/input/gameinput/structs/gameinputmouseinfo.md)\
[GetSupportedInput](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getsupportedinput.md)\
[GameInputKind](https://docs.xbox.com/ja-jp/reference/input/gameinput/enums/gameinputkind.md)\
[GameInputMouseButtons](https://docs.xbox.com/ja-jp/reference/input/gameinput/enums/gameinputmousebuttons.md)\
[IGameInputReading::GetMouseState](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputreading/methods/igameinputreading_getmousestate.md)\
[IGameInputDevice](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputdevice/igameinputdevice.md)

## バージョン履歴

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


## Related topics

- [GameInputMouseInfo](https://docs.xbox.com/ja-jp/reference/input/gameinput/structs/gameinputmouseinfo.md)
- [IGameInputDevice::GetInputReportInfo](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getinputreportinfo.md)
- [IGameInputDevice::GetKeyboardInfo](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getkeyboardinfo.md)
- [IGameInputDevice::GetGamepadInfo](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getgamepadinfo.md)
- [IGameInputDevice::GetSensorsInfo](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getsensorsinfo.md)
