Skip to content

Commit

Permalink
Pro Art Hotkeys and visual modes support (#2962)
Browse files Browse the repository at this point in the history
* Init

* Update AsusACPI.cs

* Visual modes and gamuts

* Emoji popup

* Emojis Popup

* ProArt F12

* Softwar FN-Lock for ProArt

* Cleanup

* Cleanup
  • Loading branch information
seerge committed Aug 11, 2024
1 parent b8af931 commit 6fe8ff6
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 9 deletions.
5 changes: 5 additions & 0 deletions app/AppConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,11 @@ public static bool IsVivoZenbook()
return ContainsModel("Vivobook") || ContainsModel("Zenbook");
}

public static bool IsVivoZenPro()
{
return ContainsModel("Vivobook") || ContainsModel("Zenbook") || ContainsModel("ProArt");
}

// Devices with bugged bios command to change brightness
public static bool SwappedBrightness()
{
Expand Down
5 changes: 3 additions & 2 deletions app/AsusACPI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ public class AsusACPI

public const int KB_TouchpadToggle = 0x6b;
public const int KB_MuteToggle = 0x7c;
public const int KB_NumlockToggle = 0x4e;

public const int KB_DUO_PgUpDn = 0x4B;
public const int KB_DUO_SecondDisplay = 0x6A;
Expand Down Expand Up @@ -171,8 +172,8 @@ public class AsusACPI
private bool? _allAMD = null;
private bool? _overdrive = null;

public static uint GPUEco => (AppConfig.IsVivoZenbook() || AppConfig.IsProArt()) ? GPUEcoVivo : GPUEcoROG;
public static uint GPUMux => AppConfig.IsVivoZenbook() ? GPUMuxVivo : GPUMuxROG;
public static uint GPUEco => AppConfig.IsVivoZenPro() ? GPUEcoVivo : GPUEcoROG;
public static uint GPUMux => AppConfig.IsVivoZenPro() ? GPUMuxVivo : GPUMuxROG;

[DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
private static extern IntPtr CreateFile(
Expand Down
10 changes: 5 additions & 5 deletions app/Display/VisualControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,13 @@ public static string GetVivobookPath()

public static SplendidGamut GetDefaultGamut()
{
return AppConfig.IsVivoZenbook() ? SplendidGamut.VivoNative : SplendidGamut.Native;
return AppConfig.IsVivoZenPro() ? SplendidGamut.VivoNative : SplendidGamut.Native;
}

public static Dictionary<SplendidGamut, string> GetGamutModes()
{

bool isVivo = AppConfig.IsVivoZenbook();
bool isVivo = AppConfig.IsVivoZenPro();

Dictionary<SplendidGamut, string> _modes = new Dictionary<SplendidGamut, string>();

Expand Down Expand Up @@ -148,13 +148,13 @@ public static Dictionary<SplendidGamut, string> GetGamutModes()

public static SplendidCommand GetDefaultVisualMode()
{
return AppConfig.IsVivoZenbook() ? SplendidCommand.VivoNormal : SplendidCommand.Default;
return AppConfig.IsVivoZenPro() ? SplendidCommand.VivoNormal : SplendidCommand.Default;
}

public static Dictionary<SplendidCommand, string> GetVisualModes()
{

if (AppConfig.IsVivoZenbook())
if (AppConfig.IsVivoZenPro())
{
return new Dictionary<SplendidCommand, string>
{
Expand Down Expand Up @@ -291,7 +291,7 @@ private static string GetSplendidPath()
private static bool RunSplendid(SplendidCommand command, int? param1 = null, int? param2 = null)
{
var splendid = GetSplendidPath();
bool isVivo = AppConfig.IsVivoZenbook();
bool isVivo = AppConfig.IsVivoZenPro();
bool isSplenddid = File.Exists(splendid);

if (isSplenddid)
Expand Down
43 changes: 42 additions & 1 deletion app/Input/InputDispatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,43 @@ public void KeyPressed(object sender, KeyPressedEventArgs e)
}
}

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


}
Expand Down
2 changes: 1 addition & 1 deletion app/USB/Aura.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public static class Aura
public static Color Color1 = Color.White;
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 isStrix4Zone = AppConfig.Is4ZoneRGB();
Expand Down

0 comments on commit 6fe8ff6

Please sign in to comment.