> ## 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-TW/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_setlightingcolor.md) 暫存的每種色彩，並釋放對燈的控制，讓燈恢復為系統或裝置預設提供的行為。對於通訊協定無法恢復預設行為的裝置，燈會被關閉。

呼叫此方法後，您可以暫存新色彩並呼叫 [IGameInputDevice::ApplyLightingColors](https://docs.xbox.com/zh-TW/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-TW/build/core-features/common/input/overviews/input-overview.md)\
[IGameInputDevice](https://docs.xbox.com/zh-TW/reference/input/gameinput/interfaces/igameinputdevice/igameinputdevice.md)\
[IGameInputDevice::SetLightingColor](https://docs.xbox.com/zh-TW/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_setlightingcolor.md)\
[IGameInputDevice::ApplyLightingColors](https://docs.xbox.com/zh-TW/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-TW/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_applylightingcolors.md)
- [IGameInputDevice::SetLightingColor](https://docs.xbox.com/zh-TW/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_setlightingcolor.md)
- [IGameInputDevice::GetSupportedLightingGroups](https://docs.xbox.com/zh-TW/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getsupportedlightinggroups.md)
- [IGameInputDevice::GetSupportedLightingGroupSize](https://docs.xbox.com/zh-TW/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getsupportedlightinggroupsize.md)
- [IGameInputDevice::GetSupportedSystemButtons](https://docs.xbox.com/zh-TW/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getsupportedsystembuttons.md)
