From ceb1c9a2500710fcac4b4e2a367fb51d1fff8622 Mon Sep 17 00:00:00 2001 From: Serge <5920850+seerge@users.noreply.github.com> Date: Sun, 3 Nov 2024 11:02:18 +0100 Subject: [PATCH] Skip auto-backlight when lid is closed https://github.com/seerge/g-helper/issues/3335 --- app/Input/InputDispatcher.cs | 2 ++ app/Settings.cs | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/Input/InputDispatcher.cs b/app/Input/InputDispatcher.cs index 5c29a8af..278f849d 100644 --- a/app/Input/InputDispatcher.cs +++ b/app/Input/InputDispatcher.cs @@ -14,6 +14,7 @@ namespace GHelper.Input { System.Timers.Timer timer = new System.Timers.Timer(1000); public static bool backlightActivity = true; + public static bool lidClose = false; public static Keys keyProfile = (Keys)AppConfig.Get("keybind_profile", (int)Keys.F5); public static Keys keyApp = (Keys)AppConfig.Get("keybind_app", (int)Keys.F12); @@ -874,6 +875,7 @@ namespace GHelper.Input public static void SetBacklightAuto(bool init = false) { + if (lidClose) return; if (init) Aura.Init(); Aura.ApplyBrightness(GetBacklight(), "Auto", init); } diff --git a/app/Settings.cs b/app/Settings.cs index 08258bcb..7b06ba3c 100644 --- a/app/Settings.cs +++ b/app/Settings.cs @@ -674,14 +674,14 @@ namespace GHelper { case 0: Logger.WriteLine("Lid Closed"); + InputDispatcher.lidClose = AniMatrixControl.lidClose = true; Aura.ApplyBrightness(0, "Lid"); - AniMatrixControl.lidClose = true; matrixControl.SetLidMode(); break; case 1: Logger.WriteLine("Lid Open"); + InputDispatcher.lidClose = AniMatrixControl.lidClose = false; Aura.ApplyBrightness(InputDispatcher.GetBacklight(), "Lid"); - AniMatrixControl.lidClose = false; matrixControl.SetLidMode(); break; }