Variable max brightness as some mice do not use 0-100 but 0-4 as brightness values.

This commit is contained in:
IceStormNG
2023-07-30 10:49:26 +02:00
parent 8c2ee50c93
commit 4b3d18347c
2 changed files with 7 additions and 0 deletions

View File

@@ -473,6 +473,8 @@ namespace GHelper
if (mouse.HasRGB()) if (mouse.HasRGB())
{ {
sliderBrightness.Max = mouse.MaxBrightness();
foreach (LightingMode lm in Enum.GetValues(typeof(LightingMode))) foreach (LightingMode lm in Enum.GetValues(typeof(LightingMode)))
{ {
if (mouse.IsLightingModeSupported(lm)) if (mouse.IsLightingModeSupported(lm))

View File

@@ -936,6 +936,11 @@ namespace GHelper.Peripherals.Mouse
return false; return false;
} }
public virtual int MaxBrightness()
{
return 100;
}
//Override to remap lighting mode IDs. //Override to remap lighting mode IDs.
//From OpenRGB code it looks like some mice have different orders of the modes or do not support some modes at all. //From OpenRGB code it looks like some mice have different orders of the modes or do not support some modes at all.
protected virtual byte IndexForLightingMode(LightingMode lightingMode) protected virtual byte IndexForLightingMode(LightingMode lightingMode)