From d764a20dc7aa66201b701b869d5b9ae2bb9b05d0 Mon Sep 17 00:00:00 2001 From: Serge <5920850+seerge@users.noreply.github.com> Date: Sun, 6 Aug 2023 14:49:17 +0200 Subject: [PATCH] TUF brightness fix https://github.com/seerge/g-helper/issues/990 --- app/Input/InputDispatcher.cs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/app/Input/InputDispatcher.cs b/app/Input/InputDispatcher.cs index a6c1f956..5454a818 100644 --- a/app/Input/InputDispatcher.cs +++ b/app/Input/InputDispatcher.cs @@ -155,17 +155,13 @@ namespace GHelper.Input int brightness = -1; if (isTUF) brightness = ScreenBrightness.Get(); + if (AppConfig.SwappedBrightness()) delta = -delta; - if (AppConfig.SwappedBrightness()) - { - HandleOptimizationEvent(delta > 0 ? 32 : 16); - } else - { - HandleOptimizationEvent(delta > 0 ? 16 : 32); - } + Program.acpi.DeviceSet(AsusACPI.UniversalControl, delta > 0 ? AsusACPI.Brightness_Up : AsusACPI.Brightness_Down, "Brightness"); if (isTUF) { + if (AppConfig.SwappedBrightness()) return; if (delta < 0 && brightness <= 0) return; if (delta > 0 && brightness >= 100) return;