From 03a942b57ec93cdd820c9638964482f7740f85a5 Mon Sep 17 00:00:00 2001 From: IceStormNG Date: Mon, 24 Jul 2023 15:29:03 +0200 Subject: [PATCH] Support for proper "Off" Lighting mode --- app/AsusMouseSettings.cs | 1 + app/Peripherals/Mouse/AsusMouse.cs | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/app/AsusMouseSettings.cs b/app/AsusMouseSettings.cs index 8f1c816a..89890286 100644 --- a/app/AsusMouseSettings.cs +++ b/app/AsusMouseSettings.cs @@ -15,6 +15,7 @@ namespace GHelper { LightingMode.React, Properties.Strings.AuraReact}, { LightingMode.Comet, Properties.Strings.AuraComet}, { LightingMode.BatteryState, Properties.Strings.AuraBatteryState}, + { LightingMode.Off, Properties.Strings.MatrixOff}, }; private List supportedLightingModes = new List(); diff --git a/app/Peripherals/Mouse/AsusMouse.cs b/app/Peripherals/Mouse/AsusMouse.cs index 90e7e09e..1752cc2c 100644 --- a/app/Peripherals/Mouse/AsusMouse.cs +++ b/app/Peripherals/Mouse/AsusMouse.cs @@ -46,6 +46,7 @@ namespace GHelper.Peripherals.Mouse } public enum LightingMode { + Off = 0xF0, Static = 0x0, Breathing = 0x1, ColorCycle = 0x2, @@ -873,6 +874,11 @@ namespace GHelper.Peripherals.Mouse //Also override this for the reverse mapping protected virtual LightingMode LightingModeForIndex(byte lightingMode) { + //We do not support other mods. we treat them as off. True off is actually 0xF0. + if (lightingMode > 0x06) + { + return LightingMode.Off; + } return ((LightingMode)lightingMode); }