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

> 丢弃所有暂存的灯光颜色，并使输入设备上的灯恢复其默认行为。

丢弃所有暂存的灯光颜色，并使输入设备上的灯恢复其默认行为。

## 语法

```cpp theme={null}
void ApplyLightingSystemDefault();
```

### 参数

此方法没有参数。

### 返回值

类型：void

## 备注

当应用程序不再需要控制设备的灯光时（例如玩家离开使用自定义灯光的游戏模式时），请调用此方法。它会丢弃通过调用 [IGameInputDevice::SetLightingColor](https://docs.xbox.com/zh-CN/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_setlightingcolor.md) 暂存的所有颜色，并释放对灯的控制，使其恢复为系统或设备默认提供的行为。对于协议无法恢复默认行为的设备，灯会被关闭。

调用此方法后，你可以通过暂存新颜色并调用 [IGameInputDevice::ApplyLightingColors](https://docs.xbox.com/zh-CN/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_applylightingcolors.md) 再次控制这些灯。

以下示例恢复设备的默认灯光。

```cpp theme={null}
void RestoreDefaultLighting(IGameInputDevice* device) noexcept
{
    if ((device->GetSupportedInput() & GameInputKindLighting) != 0)
    {
        device->ApplyLightingSystemDefault();
    }
}
```

> [!NOTE]
>
> 灯光支持取决于设备和平台。目前，GameInput 支持 Windows 动态光效 (LampArray) 设备以及 DualSense 控制器灯条的灯光。

## 要求

**头文件：** GameInput.h

**库：** gameinput.lib

**支持的平台：** Windows、XBOX One 系列主机和 XBOX Series 主机

## 另请参阅

[GameInput 概述](https://docs.xbox.com/zh-CN/build/core-features/common/input/overviews/input-overview.md)\
[IGameInputDevice](https://docs.xbox.com/zh-CN/reference/input/gameinput/interfaces/igameinputdevice/igameinputdevice.md)\
[IGameInputDevice::SetLightingColor](https://docs.xbox.com/zh-CN/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_setlightingcolor.md)\
[IGameInputDevice::ApplyLightingColors](https://docs.xbox.com/zh-CN/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_applylightingcolors.md)\
[GameInputLightingGroups](https://learn.microsoft.com/en-us/gaming/gdk/docs/reference/input/gameinput/enums/gameinputlightinggroups)

## 版本历史

| 版本 | 变更 |
| - | - |
| **v4** | 引入。 |


## Related topics

- [IGameInputDevice::ApplyLightingColors](https://docs.xbox.com/zh-CN/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_applylightingcolors.md)
- [IGameInputDevice::SetLightingColor](https://docs.xbox.com/zh-CN/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_setlightingcolor.md)
- [IGameInputDevice::GetSupportedLightingGroups](https://docs.xbox.com/zh-CN/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getsupportedlightinggroups.md)
- [IGameInputDevice::GetSupportedLightingGroupSize](https://docs.xbox.com/zh-CN/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getsupportedlightinggroupsize.md)
- [IGameInputDevice::GetSupportedSystemButtons](https://docs.xbox.com/zh-CN/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getsupportedsystembuttons.md)
