Syntax
Parameters
colorType: GameInputColor The color to stage for the selected lamps. group
Type: GameInputLightingGroups The lighting group selection that contains the lamps to set. This can be one or more named group flags,
GameInputLightingGroupAll to select every lamp on the device, or GameInputLightingGroupUnknown to select the lamps that don’t belong to any named group.
groupOrderIndex   _In_opt_Type: uint32_t Selects an individual lamp within group. The default value,
GAMEINPUT_LIGHTING_GROUP_ORDER_INDEX_ALL, selects every lamp in group. See Remarks for how other values are interpreted.
Return value
Type: voidRemarks
SetLightingColor doesn’t change the lamps immediately. It records (stages) the color for the selected lamps. Call IGameInputDevice::ApplyLightingColors to send all staged colors to the device in a single update. Because nothing is sent until you apply the colors, you can set several groups or individual lamps and have them change at the same time. Staged colors remain in effect after they’re applied, so to change one group later, you only need to stage the new color for that group and apply again.
The groupOrderIndex parameter is interpreted as follows.
A selection that combines
GameInputLightingGroupKeyboardKey with other named groups can’t select an individual lamp, because the index would be ambiguous. Use GAMEINPUT_LIGHTING_GROUP_ORDER_INDEX_ALL with such selections. GameInputLightingGroupAll can select an individual lamp by its zero-based position among all lamps on the device.
If the selection isn’t valid for the device, the call is ignored and nothing is staged. A selection isn’t valid if it includes a named group that the device doesn’t have (see IGameInputDevice::GetSupportedLightingGroups), contains no lamps, or specifies a groupOrderIndex that’s out of range or isn’t a valid scan code. Calls on a disconnected device have no effect.
To discard staged colors and return the lamps to their default behavior, call IGameInputDevice::ApplyLightingSystemDefault.
The following example sets the face buttons of a controller to red and its center light to blue, and then applies both colors in a single update.
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 consolesSee also
Overview of GameInputIGameInputDevice
GameInputColor
GameInputLightingGroups
IGameInputDevice::ApplyLightingColors
IGameInputDevice::ApplyLightingSystemDefault
IGameInputDevice::GetSupportedLightingGroups
IGameInputDevice::GetSupportedLightingGroupSize
