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

> Gets the number of lamps on the input device in the specified lighting group selection.

Gets the number of lamps on the input device in the specified lighting group selection.

## Syntax

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

### Parameters

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

The lighting group selection whose lamps are counted. This can be one or more named group flags, `GameInputLightingGroupAll`, or `GameInputLightingGroupUnknown`.

### Return value

Type: uint32\_t

The number of lamps in the selection. Returns 0 if the device has no lamps in the selection or if *group* contains undefined flags.

## Remarks

The value of *group* is interpreted as follows.

| Value of *group* | Lamps counted |
| - | - |
| `GameInputLightingGroupAll` | Every lamp on the device, including lamps that don't belong to a named group. |
| `GameInputLightingGroupUnknown` | Only the lamps that don't belong to any named group. |
| One or more named group flags | The sum of the lamp counts of each named group in the selection. |

The lamp count of a selection is the exclusive upper bound for the *groupOrderIndex* parameter of [IGameInputDevice::SetLightingColor](https://docs.xbox.com/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_setlightingcolor.md) when you address an individual lamp by its ordinal. The exception is `GameInputLightingGroupKeyboardKey`, which addresses individual lamps by keyboard scan code instead.

The following example lights each lamp in the face button group with a different shade of green.

```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();
}
```

The lamp counts don't change for the lifetime of the device object.

> [!NOTE]
>
> Lighting support depends on the device and the platform. Currently, GameInput supports lighting on Windows Dynamic Lighting (LampArray) devices and on the lightbar of DualSense controllers.

## Requirements

**Header:** GameInput.h

**Library:** gameinput.lib

**Supported platforms:** Windows, XBOX One family consoles and XBOX Series consoles

## See also

[Overview of GameInput](https://docs.xbox.com/build/core-features/common/input/overviews/input-overview.md)\
[IGameInputDevice](https://docs.xbox.com/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/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getsupportedlightinggroups.md)\
[IGameInputDevice::SetLightingColor](https://docs.xbox.com/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_setlightingcolor.md)\
[IGameInputDevice::ApplyLightingColors](https://docs.xbox.com/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_applylightingcolors.md)

## Version History

| Version | Changes |
| - | - |
| **v4** | Introduced. |


## Related topics

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