Pro Art Hotkeys and visual modes support (#2962)

* Init

* Update AsusACPI.cs

* Visual modes and gamuts

* Emoji popup

* Emojis Popup

* ProArt F12

* Softwar FN-Lock for ProArt

* Cleanup

* Cleanup
This commit is contained in:
Serge
2024-08-11 11:08:32 +02:00
committed by GitHub
parent b8af931248
commit 6fe8ff65b1
5 changed files with 56 additions and 9 deletions

View File

@@ -377,6 +377,11 @@ public static class AppConfig
return ContainsModel("Vivobook") || ContainsModel("Zenbook"); return ContainsModel("Vivobook") || ContainsModel("Zenbook");
} }
public static bool IsVivoZenPro()
{
return ContainsModel("Vivobook") || ContainsModel("Zenbook") || ContainsModel("ProArt");
}
// Devices with bugged bios command to change brightness // Devices with bugged bios command to change brightness
public static bool SwappedBrightness() public static bool SwappedBrightness()
{ {

View File

@@ -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;
@@ -171,8 +172,8 @@ public class AsusACPI
private bool? _allAMD = null; private bool? _allAMD = null;
private bool? _overdrive = null; private bool? _overdrive = null;
public static uint GPUEco => (AppConfig.IsVivoZenbook() || AppConfig.IsProArt()) ? GPUEcoVivo : GPUEcoROG; public static uint GPUEco => AppConfig.IsVivoZenPro() ? GPUEcoVivo : GPUEcoROG;
public static uint GPUMux => AppConfig.IsVivoZenbook() ? GPUMuxVivo : GPUMuxROG; public static uint GPUMux => AppConfig.IsVivoZenPro() ? GPUMuxVivo : GPUMuxROG;
[DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Unicode)] [DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
private static extern IntPtr CreateFile( private static extern IntPtr CreateFile(

View File

@@ -70,13 +70,13 @@ namespace GHelper.Display
public static SplendidGamut GetDefaultGamut() public static SplendidGamut GetDefaultGamut()
{ {
return AppConfig.IsVivoZenbook() ? SplendidGamut.VivoNative : SplendidGamut.Native; return AppConfig.IsVivoZenPro() ? SplendidGamut.VivoNative : SplendidGamut.Native;
} }
public static Dictionary<SplendidGamut, string> GetGamutModes() public static Dictionary<SplendidGamut, string> GetGamutModes()
{ {
bool isVivo = AppConfig.IsVivoZenbook(); bool isVivo = AppConfig.IsVivoZenPro();
Dictionary<SplendidGamut, string> _modes = new Dictionary<SplendidGamut, string>(); Dictionary<SplendidGamut, string> _modes = new Dictionary<SplendidGamut, string>();
@@ -148,13 +148,13 @@ namespace GHelper.Display
public static SplendidCommand GetDefaultVisualMode() public static SplendidCommand GetDefaultVisualMode()
{ {
return AppConfig.IsVivoZenbook() ? SplendidCommand.VivoNormal : SplendidCommand.Default; return AppConfig.IsVivoZenPro() ? SplendidCommand.VivoNormal : SplendidCommand.Default;
} }
public static Dictionary<SplendidCommand, string> GetVisualModes() public static Dictionary<SplendidCommand, string> GetVisualModes()
{ {
if (AppConfig.IsVivoZenbook()) if (AppConfig.IsVivoZenPro())
{ {
return new Dictionary<SplendidCommand, string> return new Dictionary<SplendidCommand, string>
{ {
@@ -291,7 +291,7 @@ namespace GHelper.Display
private static bool RunSplendid(SplendidCommand command, int? param1 = null, int? param2 = null) private static bool RunSplendid(SplendidCommand command, int? param1 = null, int? param2 = null)
{ {
var splendid = GetSplendidPath(); var splendid = GetSplendidPath();
bool isVivo = AppConfig.IsVivoZenbook(); bool isVivo = AppConfig.IsVivoZenPro();
bool isSplenddid = File.Exists(splendid); bool isSplenddid = File.Exists(splendid);
if (isSplenddid) if (isSplenddid)

View File

@@ -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)
@@ -658,6 +695,7 @@ namespace GHelper.Input
switch (EventID) switch (EventID)
{ {
case 134: // FN + F12 ON OLD DEVICES case 134: // FN + F12 ON OLD DEVICES
case 139: // ProArt F12
KeyProcess("m4"); KeyProcess("m4");
return; return;
case 124: // M3 case 124: // M3
@@ -691,7 +729,7 @@ namespace GHelper.Input
case 78: // Fn + ESC case 78: // Fn + ESC
ToggleFnLock(); ToggleFnLock();
return; return;
case 75: // Fn + ESC case 75: // Fn + Arrow Lock
ToggleArrowLock(); ToggleArrowLock();
return; return;
case 189: // Tablet mode case 189: // Tablet mode
@@ -780,6 +818,9 @@ namespace GHelper.Input
case 53: // Fn+F6 on GA-502DU model case 53: // Fn+F6 on GA-502DU model
NativeMethods.TurnOffScreen(); NativeMethods.TurnOffScreen();
return; return;
case 126: // Fn+F8 emojis popup
KeyboardHook.KeyKeyPress(Keys.LWin, Keys.OemSemicolon);
return;
} }

View File

@@ -79,7 +79,7 @@ namespace GHelper.USB
public static Color Color1 = Color.White; public static Color Color1 = Color.White;
public static Color Color2 = Color.Black; public static Color Color2 = Color.Black;
static bool isACPI = AppConfig.IsTUF() || AppConfig.IsVivoZenbook() || AppConfig.IsProArt(); static bool isACPI = AppConfig.IsTUF() || AppConfig.IsVivoZenPro();
static bool isStrix = AppConfig.IsAdvancedRGB() && !AppConfig.IsNoDirectRGB(); static bool isStrix = AppConfig.IsAdvancedRGB() && !AppConfig.IsNoDirectRGB();
static bool isStrix4Zone = AppConfig.Is4ZoneRGB(); static bool isStrix4Zone = AppConfig.Is4ZoneRGB();