Support for proper "Off" Lighting mode

This commit is contained in:
IceStormNG
2023-07-24 15:29:03 +02:00
parent 93ad46a685
commit 03a942b57e
2 changed files with 7 additions and 0 deletions

View File

@@ -15,6 +15,7 @@ namespace GHelper
{ LightingMode.React, Properties.Strings.AuraReact}, { LightingMode.React, Properties.Strings.AuraReact},
{ LightingMode.Comet, Properties.Strings.AuraComet}, { LightingMode.Comet, Properties.Strings.AuraComet},
{ LightingMode.BatteryState, Properties.Strings.AuraBatteryState}, { LightingMode.BatteryState, Properties.Strings.AuraBatteryState},
{ LightingMode.Off, Properties.Strings.MatrixOff},
}; };
private List<LightingMode> supportedLightingModes = new List<LightingMode>(); private List<LightingMode> supportedLightingModes = new List<LightingMode>();

View File

@@ -46,6 +46,7 @@ namespace GHelper.Peripherals.Mouse
} }
public enum LightingMode public enum LightingMode
{ {
Off = 0xF0,
Static = 0x0, Static = 0x0,
Breathing = 0x1, Breathing = 0x1,
ColorCycle = 0x2, ColorCycle = 0x2,
@@ -873,6 +874,11 @@ namespace GHelper.Peripherals.Mouse
//Also override this for the reverse mapping //Also override this for the reverse mapping
protected virtual LightingMode LightingModeForIndex(byte lightingMode) 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); return ((LightingMode)lightingMode);
} }