mirror of
https://github.com/jkocon/g-helper.git
synced 2026-02-23 13:00:52 +01:00
Hardware FN-Lock for ProArt https://github.com/seerge/g-helper/issues/2973 https://github.com/seerge/g-helper/issues/3012
This commit is contained in:
@@ -391,6 +391,11 @@ public static class AppConfig
|
||||
return ContainsModel("Vivobook") || ContainsModel("Zenbook") || ContainsModel("ProArt");
|
||||
}
|
||||
|
||||
public static bool IsHardwareFnLock()
|
||||
{
|
||||
return IsVivoZenPro();
|
||||
}
|
||||
|
||||
// Devices with bugged bios command to change brightness
|
||||
public static bool SwappedBrightness()
|
||||
{
|
||||
|
||||
@@ -85,8 +85,7 @@ namespace GHelper.Input
|
||||
|
||||
InitBacklightTimer();
|
||||
|
||||
if (AppConfig.IsVivoZenbook())
|
||||
Program.acpi.DeviceSet(AsusACPI.FnLock, AppConfig.Is("fn_lock") ^ AppConfig.IsInvertedFNLock() ? 1 : 0, "FnLock");
|
||||
if (AppConfig.IsHardwareFnLock()) HardwareFnLock(AppConfig.Is("fn_lock"));
|
||||
|
||||
}
|
||||
|
||||
@@ -155,7 +154,7 @@ namespace GHelper.Input
|
||||
|
||||
// FN-Lock group
|
||||
|
||||
if (AppConfig.Is("fn_lock") && !AppConfig.IsVivoZenbook())
|
||||
if (AppConfig.Is("fn_lock") && !AppConfig.IsHardwareFnLock())
|
||||
for (Keys i = Keys.F1; i <= Keys.F11; i++) hook.RegisterHotKey(ModifierKeys.None, i);
|
||||
|
||||
// Arrow-lock group
|
||||
@@ -629,13 +628,19 @@ namespace GHelper.Input
|
||||
Program.toast.RunToast("Arrow-Lock " + (arLock == 1 ? Properties.Strings.On : Properties.Strings.Off), ToastIcon.FnLock);
|
||||
}
|
||||
|
||||
public static void HardwareFnLock(bool fnLock)
|
||||
{
|
||||
Program.acpi.DeviceSet(AsusACPI.FnLock, fnLock ^ AppConfig.IsInvertedFNLock() ? 1 : 0, "FnLock");
|
||||
AsusHid.WriteInput([AsusHid.INPUT_ID, 0xD0, 0x4E, fnLock ? (byte)0x01 : (byte)0x00], "USB FnLock");
|
||||
}
|
||||
|
||||
public static void ToggleFnLock()
|
||||
{
|
||||
bool fnLock = !AppConfig.Is("fn_lock");
|
||||
AppConfig.Set("fn_lock", fnLock ? 1 : 0);
|
||||
|
||||
if (AppConfig.IsVivoZenbook())
|
||||
Program.acpi.DeviceSet(AsusACPI.FnLock, fnLock ^ AppConfig.IsInvertedFNLock() ? 1 : 0, "FnLock");
|
||||
if (AppConfig.IsHardwareFnLock())
|
||||
HardwareFnLock(fnLock);
|
||||
else
|
||||
Program.settingsForm.BeginInvoke(Program.inputDispatcher.RegisterKeys);
|
||||
|
||||
|
||||
@@ -272,11 +272,11 @@ namespace GHelper.USB
|
||||
if (AppConfig.IsProArt())
|
||||
{
|
||||
AsusHid.WriteInput([AsusHid.INPUT_ID, 0x05, 0x20, 0x31, 0x00, 0x08], "ProArt Init");
|
||||
AsusHid.WriteInput([AsusHid.INPUT_ID, 0xD0, 0x4E], "ProArt Init");
|
||||
//AsusHid.WriteInput([AsusHid.INPUT_ID, 0xD0, 0x4E], "ProArt Init");
|
||||
AsusHid.WriteInput([AsusHid.INPUT_ID, 0xBA, 0xC5, 0xC4], "ProArt Init");
|
||||
AsusHid.WriteInput([AsusHid.INPUT_ID, 0xD0, 0x8F, 0x01], "ProArt Init");
|
||||
AsusHid.WriteInput([AsusHid.INPUT_ID, 0xD0, 0x85, 0xFF], "ProArt Init");
|
||||
AsusHid.WriteInput([AsusHid.INPUT_ID, 0xD0, 0x4E], "ProArt Init");
|
||||
//AsusHid.WriteInput([AsusHid.INPUT_ID, 0xD0, 0x4E], "ProArt Init");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user