This commit is contained in:
Serge
2024-04-18 18:03:56 +02:00
parent 51bf22e6a6
commit ae41aedb1e
2 changed files with 11 additions and 5 deletions

View File

@@ -404,6 +404,11 @@ public static class AppConfig
return ContainsModel("GA503") || IsSlash(); return ContainsModel("GA503") || IsSlash();
} }
public static bool IsInvertedFNLock()
{
return ContainsModel("M140");
}
public static bool IsOLED() public static bool IsOLED()
{ {
return ContainsModel("OLED") || IsSlash() || ContainsModel("M7600") || ContainsModel("UX64") || ContainsModel("UX34") || ContainsModel("UX53") || ContainsModel("K360") || ContainsModel("X150") || ContainsModel("M350") || ContainsModel("K650") || ContainsModel("UM53") || ContainsModel("K660") || ContainsModel("UX84") || ContainsModel("M650") || ContainsModel("K340") || ContainsModel("K350") || ContainsModel("M140"); return ContainsModel("OLED") || IsSlash() || ContainsModel("M7600") || ContainsModel("UX64") || ContainsModel("UX34") || ContainsModel("UX53") || ContainsModel("K360") || ContainsModel("X150") || ContainsModel("M350") || ContainsModel("K650") || ContainsModel("UM53") || ContainsModel("K660") || ContainsModel("UX84") || ContainsModel("M650") || ContainsModel("K340") || ContainsModel("K350") || ContainsModel("M140");

View File

@@ -85,7 +85,8 @@ namespace GHelper.Input
InitBacklightTimer(); InitBacklightTimer();
if (AppConfig.IsVivoZenbook()) Program.acpi.DeviceSet(AsusACPI.FnLock, AppConfig.Is("fn_lock") ? 1 : 0, "FnLock"); if (AppConfig.IsVivoZenbook())
Program.acpi.DeviceSet(AsusACPI.FnLock, AppConfig.Is("fn_lock") ^ AppConfig.IsInvertedFNLock() ? 1 : 0, "FnLock");
} }
@@ -585,17 +586,17 @@ namespace GHelper.Input
public static void ToggleFnLock() public static void ToggleFnLock()
{ {
int fnLock = AppConfig.Is("fn_lock") ? 0 : 1; bool fnLock = AppConfig.Is("fn_lock");
AppConfig.Set("fn_lock", fnLock); AppConfig.Set("fn_lock", fnLock ? 1 : 0);
if (AppConfig.IsVivoZenbook()) if (AppConfig.IsVivoZenbook())
Program.acpi.DeviceSet(AsusACPI.FnLock, fnLock == 1 ? 1 : 0, "FnLock"); Program.acpi.DeviceSet(AsusACPI.FnLock, fnLock ^ AppConfig.IsInvertedFNLock() ? 1 : 0, "FnLock");
else else
Program.settingsForm.BeginInvoke(Program.inputDispatcher.RegisterKeys); Program.settingsForm.BeginInvoke(Program.inputDispatcher.RegisterKeys);
Program.settingsForm.BeginInvoke(Program.settingsForm.VisualiseFnLock); Program.settingsForm.BeginInvoke(Program.settingsForm.VisualiseFnLock);
Program.toast.RunToast(fnLock == 1 ? Properties.Strings.FnLockOn : Properties.Strings.FnLockOff, ToastIcon.FnLock); Program.toast.RunToast(fnLock ? Properties.Strings.FnLockOn : Properties.Strings.FnLockOff, ToastIcon.FnLock);
} }
public static void TabletMode() public static void TabletMode()