mirror of
https://github.com/jkocon/g-helper.git
synced 2026-02-23 13:00:52 +01:00
Support for inverted fn-lock https://github.com/seerge/g-helper/issues/2445
This commit is contained in:
@@ -404,6 +404,11 @@ public static class AppConfig
|
||||
return ContainsModel("GA503") || IsSlash();
|
||||
}
|
||||
|
||||
public static bool IsInvertedFNLock()
|
||||
{
|
||||
return ContainsModel("M140");
|
||||
}
|
||||
|
||||
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");
|
||||
|
||||
@@ -85,7 +85,8 @@ namespace GHelper.Input
|
||||
|
||||
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()
|
||||
{
|
||||
int fnLock = AppConfig.Is("fn_lock") ? 0 : 1;
|
||||
AppConfig.Set("fn_lock", fnLock);
|
||||
bool fnLock = AppConfig.Is("fn_lock");
|
||||
AppConfig.Set("fn_lock", fnLock ? 1 : 0);
|
||||
|
||||
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
|
||||
Program.settingsForm.BeginInvoke(Program.inputDispatcher.RegisterKeys);
|
||||
|
||||
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()
|
||||
|
||||
Reference in New Issue
Block a user