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

> 指定したライティング グループの選択範囲に含まれる、入力デバイス上のランプの数を取得します。

指定したライティング グループの選択範囲に含まれる、入力デバイス上のランプの数を取得します。

## 構文

```cpp theme={null}
uint32_t GetSupportedLightingGroupSize(
    GameInputLightingGroups group
);
```

### パラメーター

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

ランプを数える対象のライティング グループの選択範囲。1 つ以上の名前付きグループ フラグ、`GameInputLightingGroupAll`、または `GameInputLightingGroupUnknown` を指定できます。

### 戻り値

型: uint32\_t

選択範囲内のランプの数。デバイスの選択範囲内にランプがない場合、または *group* に未定義のフラグが含まれている場合は 0 を返します。

## 解説

*group* の値は次のように解釈されます。

| *group* の値 | 数えられるランプ |
| - | - |
| `GameInputLightingGroupAll` | 名前付きグループに属さないランプを含む、デバイス上のすべてのランプ。 |
| `GameInputLightingGroupUnknown` | どの名前付きグループにも属さないランプのみ。 |
| 1 つ以上の名前付きグループ フラグ | 選択範囲内の各名前付きグループのランプ数の合計。 |

個々のランプを序数で指定する場合、選択範囲のランプ数は、[IGameInputDevice::SetLightingColor](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_setlightingcolor.md) の *groupOrderIndex* パラメーターの上限 (この値自体は含まない) になります。例外は `GameInputLightingGroupKeyboardKey` で、このグループでは個々のランプを代わりにキーボード スキャン コードで指定します。

次の例では、フェイス ボタン グループ内の各ランプを、それぞれ異なる濃さの緑で点灯します。

```cpp theme={null}
void SetFaceButtonGradient(IGameInputDevice* device) noexcept
{
    const uint32_t lampCount = device->GetSupportedLightingGroupSize(GameInputLightingGroupFaceButtons);
    for (uint32_t i = 0; i < lampCount; ++i)
    {
        const uint8_t green = static_cast<uint8_t>(255 * (i + 1) / lampCount);
        device->SetLightingColor({ 0, green, 0 }, GameInputLightingGroupFaceButtons, i);
    }

    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::GetSupportedLightingGroups](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getsupportedlightinggroups.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)

## バージョン履歴

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


## Related topics

- [IGameInputDevice::GetSupportedLightingGroups](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getsupportedlightinggroups.md)
- [IGameInputDevice::SetLightingColor](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_setlightingcolor.md)
- [IGameInputDevice::GetSupportedInput](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getsupportedinput.md)
- [IGameInputDevice::GetSupportedRumbleMotors](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getsupportedrumblemotors.md)
- [IGameInputDevice::GetSupportedSystemButtons](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getsupportedsystembuttons.md)
