This commit is contained in:
Serge
2024-05-13 17:05:03 +02:00
parent c7d3b4ea3a
commit a6b2291586
2 changed files with 19 additions and 0 deletions

View File

@@ -1,5 +1,6 @@
using GHelper.AnimeMatrix.Communication; using GHelper.AnimeMatrix.Communication;
using GHelper.AnimeMatrix.Communication.Platform; using GHelper.AnimeMatrix.Communication.Platform;
using GHelper.Input;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using System.Text; using System.Text;
@@ -1744,6 +1745,17 @@ namespace GHelper.Peripherals.Mouse
} }
} }
public void SetColor(Color color)
{
var ls = new LightingSetting();
ls.RGBColor = color;
ls.Brightness = InputDispatcher.GetBacklight() * 25;
WriteForResponse(GetUpdateLightingModePacket(ls, LightingZone.All));
WriteForResponse(GetSaveProfilePacket());
}
public void SetLightingSetting(LightingSetting lightingSetting, LightingZone zone) public void SetLightingSetting(LightingSetting lightingSetting, LightingZone zone)
{ {
if (!HasRGB() || lightingSetting is null) if (!HasRGB() || lightingSetting is null)

View File

@@ -1,6 +1,7 @@
using GHelper.Gpu; using GHelper.Gpu;
using GHelper.Helpers; using GHelper.Helpers;
using GHelper.Input; using GHelper.Input;
using GHelper.Peripherals;
using System.Drawing.Drawing2D; using System.Drawing.Drawing2D;
using System.Drawing.Imaging; using System.Drawing.Imaging;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
@@ -767,6 +768,12 @@ namespace GHelper.USB
{ {
if (isStrix) ApplyDirect(AmbientData.result, init); if (isStrix) ApplyDirect(AmbientData.result, init);
else ApplyDirect(AmbientData.result[0], init); else ApplyDirect(AmbientData.result[0], init);
foreach (var mouse in PeripheralsProvider.ConnectedMice)
{
mouse.SetColor(AmbientData.result[0]);
}
} }
} }