mirror of
https://github.com/jkocon/g-helper.git
synced 2026-02-23 13:00:52 +01:00
Softwar FN-Lock for ProArt
This commit is contained in:
@@ -372,6 +372,11 @@ public static class AppConfig
|
|||||||
return ContainsModel("ProArt");
|
return ContainsModel("ProArt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static bool IsHWFNLock()
|
||||||
|
{
|
||||||
|
return ContainsModel("Vivobook") || ContainsModel("Zenbook");
|
||||||
|
}
|
||||||
|
|
||||||
public static bool IsVivoZenPro()
|
public static bool IsVivoZenPro()
|
||||||
{
|
{
|
||||||
return ContainsModel("Vivobook") || ContainsModel("Zenbook") || ContainsModel("ProArt");
|
return ContainsModel("Vivobook") || ContainsModel("Zenbook") || ContainsModel("ProArt");
|
||||||
|
|||||||
@@ -46,6 +46,7 @@ public class AsusACPI
|
|||||||
|
|
||||||
public const int KB_TouchpadToggle = 0x6b;
|
public const int KB_TouchpadToggle = 0x6b;
|
||||||
public const int KB_MuteToggle = 0x7c;
|
public const int KB_MuteToggle = 0x7c;
|
||||||
|
public const int KB_NumlockToggle = 0x4e;
|
||||||
|
|
||||||
public const int KB_DUO_PgUpDn = 0x4B;
|
public const int KB_DUO_PgUpDn = 0x4B;
|
||||||
public const int KB_DUO_SecondDisplay = 0x6A;
|
public const int KB_DUO_SecondDisplay = 0x6A;
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ namespace GHelper.Input
|
|||||||
|
|
||||||
InitBacklightTimer();
|
InitBacklightTimer();
|
||||||
|
|
||||||
if (AppConfig.IsVivoZenPro())
|
if (AppConfig.IsHWFNLock())
|
||||||
Program.acpi.DeviceSet(AsusACPI.FnLock, AppConfig.Is("fn_lock") ^ AppConfig.IsInvertedFNLock() ? 1 : 0, "FnLock");
|
Program.acpi.DeviceSet(AsusACPI.FnLock, AppConfig.Is("fn_lock") ^ AppConfig.IsInvertedFNLock() ? 1 : 0, "FnLock");
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -155,7 +155,7 @@ namespace GHelper.Input
|
|||||||
|
|
||||||
// FN-Lock group
|
// FN-Lock group
|
||||||
|
|
||||||
if (AppConfig.Is("fn_lock") && !AppConfig.IsVivoZenPro())
|
if (AppConfig.Is("fn_lock") && !AppConfig.IsHWFNLock())
|
||||||
for (Keys i = Keys.F1; i <= Keys.F11; i++) hook.RegisterHotKey(ModifierKeys.None, i);
|
for (Keys i = Keys.F1; i <= Keys.F11; i++) hook.RegisterHotKey(ModifierKeys.None, i);
|
||||||
|
|
||||||
// Arrow-lock group
|
// Arrow-lock group
|
||||||
@@ -281,6 +281,43 @@ namespace GHelper.Input
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (AppConfig.IsProArt())
|
||||||
|
{
|
||||||
|
switch (e.Key)
|
||||||
|
{
|
||||||
|
case Keys.F2:
|
||||||
|
KeyboardHook.KeyPress(Keys.VolumeDown);
|
||||||
|
return;
|
||||||
|
case Keys.F3:
|
||||||
|
KeyboardHook.KeyPress(Keys.VolumeUp);
|
||||||
|
return;
|
||||||
|
case Keys.F4:
|
||||||
|
HandleEvent(199); // Backlight cycle
|
||||||
|
return;
|
||||||
|
case Keys.F5:
|
||||||
|
SetBrightness(-10);
|
||||||
|
return;
|
||||||
|
case Keys.F6:
|
||||||
|
SetBrightness(+10);
|
||||||
|
return;
|
||||||
|
case Keys.F7:
|
||||||
|
KeyboardHook.KeyKeyPress(Keys.LWin, Keys.P);
|
||||||
|
return;
|
||||||
|
case Keys.F8:
|
||||||
|
HandleEvent(126); // Emojis
|
||||||
|
return;
|
||||||
|
case Keys.F9:
|
||||||
|
KeyProcess("m3"); // MicMute
|
||||||
|
return;
|
||||||
|
case Keys.F10:
|
||||||
|
HandleEvent(133); // Camera Toggle
|
||||||
|
return;
|
||||||
|
case Keys.F11:
|
||||||
|
KeyboardHook.KeyPress(Keys.Snapshot); // PrintScreen
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (AppConfig.IsZ13() || AppConfig.IsDUO())
|
if (AppConfig.IsZ13() || AppConfig.IsDUO())
|
||||||
{
|
{
|
||||||
switch (e.Key)
|
switch (e.Key)
|
||||||
@@ -597,7 +634,7 @@ namespace GHelper.Input
|
|||||||
bool fnLock = !AppConfig.Is("fn_lock");
|
bool fnLock = !AppConfig.Is("fn_lock");
|
||||||
AppConfig.Set("fn_lock", fnLock ? 1 : 0);
|
AppConfig.Set("fn_lock", fnLock ? 1 : 0);
|
||||||
|
|
||||||
if (AppConfig.IsVivoZenPro())
|
if (AppConfig.IsHWFNLock())
|
||||||
Program.acpi.DeviceSet(AsusACPI.FnLock, fnLock ^ AppConfig.IsInvertedFNLock() ? 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);
|
||||||
|
|||||||
Reference in New Issue
Block a user