From f8df547afbe551de21a178e7fea6494a9fd94a87 Mon Sep 17 00:00:00 2001 From: Serge <5920850+seerge@users.noreply.github.com> Date: Tue, 14 Nov 2023 19:01:49 +0100 Subject: [PATCH] Init FnLock for vivobooks on startup https://github.com/seerge/g-helper/issues/1596 --- app/GHelper.csproj | 2 +- app/Input/InputDispatcher.cs | 2 ++ app/USB/Aura.cs | 3 ++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/GHelper.csproj b/app/GHelper.csproj index 9112b20d..9e5deec4 100644 --- a/app/GHelper.csproj +++ b/app/GHelper.csproj @@ -15,7 +15,7 @@ AnyCPU False True - 0.131 + 0.132 diff --git a/app/Input/InputDispatcher.cs b/app/Input/InputDispatcher.cs index 8154f6ed..b5d06200 100644 --- a/app/Input/InputDispatcher.cs +++ b/app/Input/InputDispatcher.cs @@ -35,6 +35,8 @@ namespace GHelper.Input Program.acpi.SubscribeToEvents(WatcherEventArrived); //Task.Run(Program.acpi.RunListener); + if (AppConfig.ContainsModel("VivoBook")) Program.acpi.DeviceSet(AsusACPI.FnLock, AppConfig.Is("fn_lock") ? 1 : 0, "FnLock"); + hook.KeyPressed += new EventHandler(KeyPressed); RegisterKeys(); diff --git a/app/USB/Aura.cs b/app/USB/Aura.cs index 475e6260..74da514e 100644 --- a/app/USB/Aura.cs +++ b/app/USB/Aura.cs @@ -538,8 +538,9 @@ namespace GHelper.USB else { screeb_pxl = AmbientData.ResizeImage(screen_low, 1, 1); + var average = ColorUtils.HSV.UpSaturation(screeb_pxl.GetPixel(0, 0), (float)0.7); for (int i = 0; i < 4; i++) //just color transfer from the bottom screen on keyboard - AmbientData.Colors[i].RGB = ColorUtils.HSV.UpSaturation(screeb_pxl.GetPixel(0, 0), (float)0.7); + AmbientData.Colors[i].RGB = average; }