Serge
2023-11-15 14:12:08 +01:00
parent f8df547afb
commit 7eb6884aa4

View File

@@ -35,8 +35,6 @@ namespace GHelper.Input
Program.acpi.SubscribeToEvents(WatcherEventArrived); Program.acpi.SubscribeToEvents(WatcherEventArrived);
//Task.Run(Program.acpi.RunListener); //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<KeyPressedEventArgs>(KeyPressed); hook.KeyPressed += new EventHandler<KeyPressedEventArgs>(KeyPressed);
RegisterKeys(); RegisterKeys();
@@ -86,6 +84,9 @@ namespace GHelper.Input
Logger.WriteLine("Optimization service is running"); Logger.WriteLine("Optimization service is running");
InitBacklightTimer(); InitBacklightTimer();
if (AppConfig.ContainsModel("VivoBook")) Program.acpi.DeviceSet(AsusACPI.FnLock, AppConfig.Is("fn_lock") ? 1 : 0, "FnLock");
} }
public void InitBacklightTimer() public void InitBacklightTimer()
@@ -511,7 +512,7 @@ namespace GHelper.Input
AppConfig.Set("fn_lock", fnLock); AppConfig.Set("fn_lock", fnLock);
if (AppConfig.ContainsModel("VivoBook")) if (AppConfig.ContainsModel("VivoBook"))
Program.acpi.DeviceSet(AsusACPI.FnLock, fnLock == 1 ? 0 : 1, "FnLock"); Program.acpi.DeviceSet(AsusACPI.FnLock, fnLock == 1 ? 1 : 0, "FnLock");
else else
Program.settingsForm.BeginInvoke(Program.inputDispatcher.RegisterKeys); Program.settingsForm.BeginInvoke(Program.inputDispatcher.RegisterKeys);