diff --git a/app/Input/InputDispatcher.cs b/app/Input/InputDispatcher.cs index 1255a5c1..26e92f7d 100644 --- a/app/Input/InputDispatcher.cs +++ b/app/Input/InputDispatcher.cs @@ -12,7 +12,7 @@ namespace GHelper.Input public class InputDispatcher { System.Timers.Timer timer = new System.Timers.Timer(1000); - public bool backlightActivity = true; + public static bool backlightActivity = true; public static Keys keyProfile = Keys.F5; public static Keys keyApp = Keys.F12; @@ -342,6 +342,7 @@ namespace GHelper.Input public static void TabletMode() { + bool touchpadState = GetTouchpadState(); bool tabletState = Program.acpi.DeviceGet(AsusACPI.TabletState) > 0; diff --git a/app/Input/KeyboardListener.cs b/app/Input/KeyboardListener.cs index 6e182e9b..693e320d 100644 --- a/app/Input/KeyboardListener.cs +++ b/app/Input/KeyboardListener.cs @@ -10,7 +10,20 @@ namespace GHelper.Input public KeyboardListener(Action KeyHandler) { HidDevice? input = AsusUSB.GetDevice(); - if (input == null) return; + + // Fallback + if (input == null) + { + AsusUSB.Init(); + Thread.Sleep(1000); + input = AsusUSB.GetDevice(); + } + + if (input == null) + { + Logger.WriteLine($"Input device not found"); + return; + } Logger.WriteLine($"Input: {input.DevicePath}");