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

> 入力デバイスが制御可能なランプを備えているライティング グループを取得します。

入力デバイスが制御可能なランプを備えているライティング グループを取得します。

## 構文

```cpp theme={null}
GameInputLightingGroups GetSupportedLightingGroups();
```

### パラメーター

このメソッドにはパラメーターがありません。

### 戻り値

型: [GameInputLightingGroups](https://learn.microsoft.com/en-us/gaming/gdk/docs/reference/input/gameinput/enums/gameinputlightinggroups)

デバイス上のランプを 1 つ以上含む、すべての名前付きライティング グループの `GameInputLightingGroups` フラグの組み合わせ。デバイスのどの名前付きグループにもランプがない場合は `GameInputLightingGroupUnknown` (0) を返します。

## 解説

返される値の各フラグは、`GameInputLightingGroupFaceButtons` や `GameInputLightingGroupCenterLight` など、[IGameInputDevice::SetLightingColor](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_setlightingcolor.md) で指定できるランプの名前付きグループを示します。`GameInputLightingGroupUnknown` の値は 0 であるため、このメソッドがこれをグループとして報告することはありません。

デバイスは、どの名前付きグループにも属さないランプを備えている場合があります。そのため、戻り値が 0 であっても、デバイスにランプがないとは限りません。デバイスがライティングをサポートしているかどうかを判断するには、[IGameInputDevice::GetSupportedInput](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getsupportedinput.md) に `GameInputKindLighting` が含まれているかどうかを確認するか、`GameInputLightingGroupAll` を指定して [IGameInputDevice::GetSupportedLightingGroupSize](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getsupportedlightinggroupsize.md) を呼び出します。名前付きグループに属さないランプの数を数えるには、`GameInputLightingGroupUnknown` を指定して `GetSupportedLightingGroupSize` を呼び出します。

次の例では、該当するグループを備えたデバイスで、フェイス ボタンを赤に、センター ライトを青に設定してから、それらのカラーを 1 回の更新で適用します。

```cpp theme={null}
void SetControllerLighting(IGameInputDevice* device) noexcept
{
    const GameInputLightingGroups groups = device->GetSupportedLightingGroups();

    if ((groups & GameInputLightingGroupFaceButtons) != 0)
    {
        device->SetLightingColor({ 255, 0, 0 }, GameInputLightingGroupFaceButtons);
    }

    if ((groups & GameInputLightingGroupCenterLight) != 0)
    {
        device->SetLightingColor({ 0, 0, 255 }, GameInputLightingGroupCenterLight);
    }

    device->ApplyLightingColors();
}
```

サポートされるライティング グループのセットは、デバイス オブジェクトの有効期間中は変化しません。

> [!NOTE]
>
> ライティングのサポートは、デバイスとプラットフォームによって異なります。現在、GameInput は、Windows Dynamic Lighting (LampArray) デバイスと DualSense コントローラーのライトバーでのライティングをサポートしています。

## 要件

**ヘッダー:** 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)\
[GameInputLightingGroups](https://learn.microsoft.com/en-us/gaming/gdk/docs/reference/input/gameinput/enums/gameinputlightinggroups)\
[IGameInputDevice::GetSupportedLightingGroupSize](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getsupportedlightinggroupsize.md)\
[IGameInputDevice::SetLightingColor](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_setlightingcolor.md)\
[IGameInputDevice::ApplyLightingColors](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_applylightingcolors.md)\
[IGameInputDevice::ApplyLightingSystemDefault](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_applylightingsystemdefault.md)

## バージョン履歴

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


## Related topics

- [IGameInputDevice::GetSupportedLightingGroupSize](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getsupportedlightinggroupsize.md)
- [IGameInputDevice::SetLightingColor](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_setlightingcolor.md)
- [IGameInputDevice::ApplyLightingColors](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_applylightingcolors.md)
- [IGameInputDevice::GetSupportedInput](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getsupportedinput.md)
- [IGameInputDevice::GetDeviceFamily](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getdevicefamily.md)
