mirror of
https://github.com/jkocon/g-helper.git
synced 2026-02-23 13:00:52 +01:00
Compare commits
93 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
138b7699d9 | ||
|
|
d7202b12bf | ||
|
|
7e7c90d4fb | ||
|
|
50503e126e | ||
|
|
2f2d64135a | ||
|
|
dea88f87df | ||
|
|
819207c4f1 | ||
|
|
63d3393b7b | ||
|
|
960ebf3bbb | ||
|
|
dba6b1a24f | ||
|
|
5968788105 | ||
|
|
819f750591 | ||
|
|
be3e15cd6e | ||
|
|
871f80f654 | ||
|
|
c2c5d2a0c5 | ||
|
|
86e08bc3f5 | ||
|
|
c63c64967f | ||
|
|
468ed27390 | ||
|
|
c6ea0b0e3e | ||
|
|
000162b989 | ||
|
|
df5bdfde33 | ||
|
|
815d033a56 | ||
|
|
857d858987 | ||
|
|
9d130ca540 | ||
|
|
0a503d286a | ||
|
|
f72e3a69dd | ||
|
|
35867a434c | ||
|
|
5570513eeb | ||
|
|
ceb1c9a250 | ||
|
|
e942d3fd49 | ||
|
|
482fe00014 | ||
|
|
54fdf9231c | ||
|
|
b9be9a9c97 | ||
|
|
501d0a1666 | ||
|
|
a7e50f89ca | ||
|
|
083e918086 | ||
|
|
e6a547dbfd | ||
|
|
1321b2eb31 | ||
|
|
5e96e3e9bc | ||
|
|
5e4bd13aa9 | ||
|
|
f320da9245 | ||
|
|
a024c05bc1 | ||
|
|
15501c7845 | ||
|
|
011fdeeb36 | ||
|
|
3df0aa04de | ||
|
|
9f364a331c | ||
|
|
08af10afef | ||
|
|
4ea59d2669 | ||
|
|
5eb0c1d095 | ||
|
|
a8c32470b3 | ||
|
|
45709eb7d6 | ||
|
|
ecbd926d81 | ||
|
|
1cca7a5881 | ||
|
|
0d3332faf3 | ||
|
|
aa74730e12 | ||
|
|
9b5e2acf90 | ||
|
|
3fafe63c42 | ||
|
|
6c0252156c | ||
|
|
3a750c08b5 | ||
|
|
e28f51cce6 | ||
|
|
b0c48b9e63 | ||
|
|
ec17d8cb80 | ||
|
|
42ac2d627c | ||
|
|
3c241cafba | ||
|
|
873fcc0591 | ||
|
|
73d5a0bb90 | ||
|
|
ff5ac7de7e | ||
|
|
917fe112b8 | ||
|
|
4855733274 | ||
|
|
740a34fa9c | ||
|
|
534dc3d344 | ||
|
|
a52a87bcfd | ||
|
|
cdeb4951dc | ||
|
|
77d89505b3 | ||
|
|
4be790dce0 | ||
|
|
c9698a1613 | ||
|
|
819506e7ee | ||
|
|
489616d255 | ||
|
|
1103ab70f6 | ||
|
|
dbf0cbc3ac | ||
|
|
a45d693937 | ||
|
|
0db49af310 | ||
|
|
28daaf9a4c | ||
|
|
38d02ee7f9 | ||
|
|
c6d1b29a49 | ||
|
|
79cd773632 | ||
|
|
897de4ed27 | ||
|
|
afa6dbb542 | ||
|
|
80fbee2609 | ||
|
|
e1c83da19b | ||
|
|
59b5888632 | ||
|
|
cd74c62908 | ||
|
|
000fbe466f |
2
.github/FUNDING.yml
vendored
Normal file
2
.github/FUNDING.yml
vendored
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
# These are supported funding model platforms
|
||||||
|
custom: https://g-helper.com/support
|
||||||
@@ -616,9 +616,9 @@ namespace GHelper.Ally
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void ApplyXBoxStatus()
|
public static void DisableXBoxController(bool disabled)
|
||||||
{
|
{
|
||||||
AsusHid.WriteInput(new byte[] { AsusHid.INPUT_ID, 0xD1, 0x0B, 0x01, AppConfig.Is("controller_disabled") ? (byte)0x02 : (byte)0x01 }, "Status");
|
AsusHid.WriteInput([AsusHid.INPUT_ID, 0xD1, 0x0B, 0x01, disabled ? (byte)0x02 : (byte)0x01], $"ControllerDisabled: {disabled}");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void ApplyMode(ControllerMode applyMode = ControllerMode.Auto, bool init = false)
|
public static void ApplyMode(ControllerMode applyMode = ControllerMode.Auto, bool init = false)
|
||||||
@@ -648,10 +648,10 @@ namespace GHelper.Ally
|
|||||||
if (init)
|
if (init)
|
||||||
{
|
{
|
||||||
WakeUp();
|
WakeUp();
|
||||||
InputDispatcher.SetBacklightAuto(true);
|
InputDispatcher.SetBacklightAuto();
|
||||||
}
|
}
|
||||||
|
|
||||||
AsusHid.WriteInput(new byte[] { AsusHid.INPUT_ID, 0xD1, 0x01, 0x01, (byte)_applyMode }, "Controller");
|
AsusHid.WriteInput([AsusHid.INPUT_ID, 0xD1, 0x01, 0x01, (byte)_applyMode], "Controller");
|
||||||
//AsusHid.WriteInput(CommandSave, null);
|
//AsusHid.WriteInput(CommandSave, null);
|
||||||
|
|
||||||
BindZone(BindingZone.M1M2);
|
BindZone(BindingZone.M1M2);
|
||||||
@@ -668,6 +668,13 @@ namespace GHelper.Ally
|
|||||||
|
|
||||||
SetDeadzones();
|
SetDeadzones();
|
||||||
|
|
||||||
|
if (init && AppConfig.Is("controller_disabled"))
|
||||||
|
{
|
||||||
|
Thread.Sleep(500);
|
||||||
|
DisableXBoxController(false);
|
||||||
|
DisableXBoxController(true);
|
||||||
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -36,7 +36,8 @@ namespace GHelper.AnimeMatrix
|
|||||||
public AniMatrixControl(SettingsForm settingsForm)
|
public AniMatrixControl(SettingsForm settingsForm)
|
||||||
{
|
{
|
||||||
settings = settingsForm;
|
settings = settingsForm;
|
||||||
|
if (!AppConfig.IsSlash() && !AppConfig.IsAnimeMatrix()) return;
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (AppConfig.IsSlash())
|
if (AppConfig.IsSlash())
|
||||||
@@ -111,8 +112,6 @@ namespace GHelper.AnimeMatrix
|
|||||||
deviceSlash.SetEnabled(true);
|
deviceSlash.SetEnabled(true);
|
||||||
deviceSlash.Init();
|
deviceSlash.Init();
|
||||||
|
|
||||||
deviceSlash.SetLidMode(false);
|
|
||||||
|
|
||||||
switch ((SlashMode)running)
|
switch ((SlashMode)running)
|
||||||
{
|
{
|
||||||
case SlashMode.Static:
|
case SlashMode.Static:
|
||||||
@@ -150,6 +149,11 @@ namespace GHelper.AnimeMatrix
|
|||||||
{
|
{
|
||||||
bool matrixLid = AppConfig.Is("matrix_lid");
|
bool matrixLid = AppConfig.Is("matrix_lid");
|
||||||
|
|
||||||
|
if (deviceSlash is not null)
|
||||||
|
{
|
||||||
|
deviceSlash.SetLidMode(!matrixLid && AppConfig.Is("slash_sleep"));
|
||||||
|
}
|
||||||
|
|
||||||
if (matrixLid || force)
|
if (matrixLid || force)
|
||||||
{
|
{
|
||||||
Logger.WriteLine($"Matrix LidClosed: {lidClose}");
|
Logger.WriteLine($"Matrix LidClosed: {lidClose}");
|
||||||
@@ -210,7 +214,7 @@ namespace GHelper.AnimeMatrix
|
|||||||
switch (running)
|
switch (running)
|
||||||
{
|
{
|
||||||
case 2:
|
case 2:
|
||||||
SetMatrixPicture(AppConfig.GetString("matrix_picture"));
|
SetMatrixPicture(AppConfig.GetString("matrix_picture"), false);
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
SetMatrixClock();
|
SetMatrixClock();
|
||||||
|
|||||||
@@ -410,7 +410,7 @@ namespace GHelper.AnimeMatrix
|
|||||||
if (DateTime.Now.Second % 2 != 0) timeFormat = timeFormat.Replace(":", " ");
|
if (DateTime.Now.Second % 2 != 0) timeFormat = timeFormat.Replace(":", " ");
|
||||||
|
|
||||||
Clear();
|
Clear();
|
||||||
Text(DateTime.Now.ToString(timeFormat), 15, 2, 25);
|
Text(DateTime.Now.ToString(timeFormat), 15, 7 - FullRows / 2, 25);
|
||||||
Text(DateTime.Now.ToString(dateFormat), 11.5F, 0, 14);
|
Text(DateTime.Now.ToString(dateFormat), 11.5F, 0, 14);
|
||||||
Present();
|
Present();
|
||||||
|
|
||||||
|
|||||||
@@ -209,7 +209,7 @@ namespace GHelper.AnimeMatrix
|
|||||||
|
|
||||||
public void SetLidMode(bool status)
|
public void SetLidMode(bool status)
|
||||||
{
|
{
|
||||||
Set(CreatePacket([0xD8, 0x00, 0x00, 0x02, 0xA5, status ? (byte)0x80 : (byte)0x00]), $"DisableLidClose {status}");
|
Set(CreatePacket([0xD8, 0x00, 0x00, 0x02, 0xA5, status ? (byte)0x80 : (byte)0x00]), $"SlashLidCloseAnimation {status}");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SetSleepActive(bool status)
|
public void SetSleepActive(bool status)
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ public static class AppConfig
|
|||||||
private static string? _bios;
|
private static string? _bios;
|
||||||
|
|
||||||
private static Dictionary<string, object> config = new Dictionary<string, object>();
|
private static Dictionary<string, object> config = new Dictionary<string, object>();
|
||||||
private static System.Timers.Timer timer = new System.Timers.Timer(1000);
|
private static System.Timers.Timer timer = new System.Timers.Timer(2000);
|
||||||
|
|
||||||
static AppConfig()
|
static AppConfig()
|
||||||
{
|
{
|
||||||
@@ -92,7 +92,9 @@ public static class AppConfig
|
|||||||
|
|
||||||
Thread.Sleep(500);
|
Thread.Sleep(500);
|
||||||
|
|
||||||
if (File.ReadAllText(backup).Contains("}"))
|
var backupText = File.ReadAllText(backup);
|
||||||
|
|
||||||
|
if (backupText.Contains("{") && backupText.Contains("}"))
|
||||||
{
|
{
|
||||||
File.Copy(backup, configFile, true);
|
File.Copy(backup, configFile, true);
|
||||||
}
|
}
|
||||||
@@ -219,6 +221,7 @@ public static class AppConfig
|
|||||||
|
|
||||||
private static void Write()
|
private static void Write()
|
||||||
{
|
{
|
||||||
|
timer.Stop();
|
||||||
timer.Start();
|
timer.Start();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -302,27 +305,32 @@ public static class AppConfig
|
|||||||
|
|
||||||
switch (mode)
|
switch (mode)
|
||||||
{
|
{
|
||||||
case 1:
|
case AsusACPI.PerformanceTurbo:
|
||||||
if (device == AsusFan.GPU)
|
switch (device)
|
||||||
curve = StringToBytes("14-3F-44-48-4C-50-54-62-16-1F-26-2D-39-47-55-5F");
|
{
|
||||||
else
|
case AsusFan.GPU:
|
||||||
curve = StringToBytes("14-3F-44-48-4C-50-54-62-11-1A-22-29-34-43-51-5A");
|
return StringToBytes("14-3F-44-48-4C-50-54-62-16-1F-26-2D-39-47-55-5F");
|
||||||
break;
|
default:
|
||||||
case 2:
|
return StringToBytes("14-3F-44-48-4C-50-54-62-11-1A-22-29-34-43-51-5A");
|
||||||
if (device == AsusFan.GPU)
|
}
|
||||||
curve = StringToBytes("3C-41-42-46-47-4B-4C-62-08-11-11-1D-1D-26-26-2D");
|
case AsusACPI.PerformanceSilent:
|
||||||
else
|
switch (device)
|
||||||
curve = StringToBytes("3C-41-42-46-47-4B-4C-62-03-0C-0C-16-16-22-22-29");
|
{
|
||||||
break;
|
case AsusFan.GPU:
|
||||||
|
return StringToBytes("3C-41-42-46-47-4B-4C-62-08-11-11-1D-1D-26-26-2D");
|
||||||
|
default:
|
||||||
|
return StringToBytes("3C-41-42-46-47-4B-4C-62-03-0C-0C-16-16-22-22-29");
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
if (device == AsusFan.GPU)
|
switch (device)
|
||||||
curve = StringToBytes("3A-3D-40-44-48-4D-51-62-0C-16-1D-1F-26-2D-34-4A");
|
{
|
||||||
else
|
case AsusFan.GPU:
|
||||||
curve = StringToBytes("3A-3D-40-44-48-4D-51-62-08-11-16-1A-22-29-30-45");
|
return StringToBytes("3A-3D-40-44-48-4D-51-62-0C-16-1D-1F-26-2D-34-4A");
|
||||||
break;
|
default:
|
||||||
|
return StringToBytes("3A-3D-40-44-48-4D-51-62-08-11-16-1A-22-29-30-45");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return curve;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static string GetModeString(string name)
|
public static string GetModeString(string name)
|
||||||
@@ -405,7 +413,7 @@ public static class AppConfig
|
|||||||
|
|
||||||
public static bool IsDUO()
|
public static bool IsDUO()
|
||||||
{
|
{
|
||||||
return ContainsModel("Duo") || ContainsModel("GX550") || ContainsModel("GX650");
|
return ContainsModel("Duo") || ContainsModel("GX550") || ContainsModel("GX650") || ContainsModel("UX840");
|
||||||
}
|
}
|
||||||
|
|
||||||
// G14 2020 has no aura, but media keys instead
|
// G14 2020 has no aura, but media keys instead
|
||||||
@@ -424,6 +432,11 @@ public static class AppConfig
|
|||||||
return ContainsModel("GA401") || ContainsModel("FX517Z") || ContainsModel("FX516P") || ContainsModel("X13") || IsARCNM() || ContainsModel("FA617N") || ContainsModel("FA617X") || NoAura();
|
return ContainsModel("GA401") || ContainsModel("FX517Z") || ContainsModel("FX516P") || ContainsModel("X13") || IsARCNM() || ContainsModel("FA617N") || ContainsModel("FA617X") || NoAura();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static bool IsAnimeMatrix()
|
||||||
|
{
|
||||||
|
return ContainsModel("GA401") || ContainsModel("GA402") || ContainsModel("GU604V");
|
||||||
|
}
|
||||||
|
|
||||||
public static bool IsSlash()
|
public static bool IsSlash()
|
||||||
{
|
{
|
||||||
return ContainsModel("GA403") || ContainsModel("GU605") || ContainsModel("GA605");
|
return ContainsModel("GA403") || ContainsModel("GU605") || ContainsModel("GA605");
|
||||||
@@ -446,7 +459,7 @@ public static class AppConfig
|
|||||||
|
|
||||||
public static bool IsOLED()
|
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("M550") || ContainsModel("K340") || ContainsModel("K350") || ContainsModel("M140") || ContainsModel("UM340") || ContainsModel("S540") || ContainsModel("M7400") || ContainsModel("N650") || ContainsModel("HN7306") || ContainsModel("H7606");
|
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("M550") || ContainsModel("K340") || ContainsModel("K350") || ContainsModel("M140") || ContainsModel("UM340") || ContainsModel("S540") || ContainsModel("M7400") || ContainsModel("N650") || ContainsModel("HN7306") || ContainsModel("H7606") || ContainsModel("UX5406") || ContainsModel("M5606");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static bool IsNoOverdrive()
|
public static bool IsNoOverdrive()
|
||||||
@@ -496,7 +509,7 @@ public static class AppConfig
|
|||||||
|
|
||||||
public static bool NoWMI()
|
public static bool NoWMI()
|
||||||
{
|
{
|
||||||
return ContainsModel("GL704G") || ContainsModel("GM501G");
|
return ContainsModel("GL704G") || ContainsModel("GM501G") || ContainsModel("GX501G");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static bool IsNoDirectRGB()
|
public static bool IsNoDirectRGB()
|
||||||
@@ -632,7 +645,7 @@ public static class AppConfig
|
|||||||
|
|
||||||
public static bool IsForceSetGPUMode()
|
public static bool IsForceSetGPUMode()
|
||||||
{
|
{
|
||||||
return Is("gpu_mode_force_set") || ContainsModel("503");
|
return Is("gpu_mode_force_set") || (ContainsModel("503") && IsNotFalse("gpu_mode_force_set"));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static bool IsNoGPUModes()
|
public static bool IsNoGPUModes()
|
||||||
@@ -640,6 +653,11 @@ public static class AppConfig
|
|||||||
return ContainsModel("GV301RA") || ContainsModel("GV302XA") || IsAlly();
|
return ContainsModel("GV301RA") || ContainsModel("GV302XA") || IsAlly();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static bool NoGpu()
|
||||||
|
{
|
||||||
|
return Is("no_gpu") || ContainsModel("UX540");
|
||||||
|
}
|
||||||
|
|
||||||
public static bool IsHardwareTouchpadToggle()
|
public static bool IsHardwareTouchpadToggle()
|
||||||
{
|
{
|
||||||
return ContainsModel("FA507");
|
return ContainsModel("FA507");
|
||||||
@@ -683,17 +701,22 @@ public static class AppConfig
|
|||||||
// 2024 Models support Dynamic Lighting
|
// 2024 Models support Dynamic Lighting
|
||||||
public static bool IsDynamicLighting()
|
public static bool IsDynamicLighting()
|
||||||
{
|
{
|
||||||
return IsSlash() || IsIntelHX() || ContainsModel("FA607P") || ContainsModel("FX607J") || ContainsModel("FA507U");
|
return IsSlash() || IsIntelHX() || IsTUF();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static bool IsForceMiniled()
|
public static bool IsForceMiniled()
|
||||||
{
|
{
|
||||||
return ContainsModel("G834JYR") || Is("force_miniled");
|
return ContainsModel("G834JYR") || ContainsModel("G834JZR") || Is("force_miniled");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static bool SaveDimming()
|
public static bool SaveDimming()
|
||||||
{
|
{
|
||||||
return Is("save_dimming");
|
return Is("save_dimming");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static bool IsAutoStatusLed()
|
||||||
|
{
|
||||||
|
return Is("auto_status_led");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -114,7 +114,7 @@ public class AsusACPI
|
|||||||
public const int APU_MEM = 0x000600C1;
|
public const int APU_MEM = 0x000600C1;
|
||||||
|
|
||||||
public const int TUF_KB_BRIGHTNESS = 0x00050021;
|
public const int TUF_KB_BRIGHTNESS = 0x00050021;
|
||||||
public const int VIVO_KB_BRIGHTNESS = 0x0005002F;
|
public const int KBD_BACKLIGHT_OOBE = 0x0005002F;
|
||||||
|
|
||||||
public const int TUF_KB = 0x00100056;
|
public const int TUF_KB = 0x00100056;
|
||||||
public const int TUF_KB2 = 0x0010005a;
|
public const int TUF_KB2 = 0x0010005a;
|
||||||
@@ -129,6 +129,7 @@ public class AsusACPI
|
|||||||
public const int ScreenPadToggle = 0x00050031;
|
public const int ScreenPadToggle = 0x00050031;
|
||||||
public const int ScreenPadBrightness = 0x00050032;
|
public const int ScreenPadBrightness = 0x00050032;
|
||||||
|
|
||||||
|
public const int CameraShutter = 0x00060078;
|
||||||
public const int CameraLed = 0x00060079;
|
public const int CameraLed = 0x00060079;
|
||||||
public const int StatusLed = 0x000600C2;
|
public const int StatusLed = 0x000600C2;
|
||||||
|
|
||||||
@@ -788,7 +789,6 @@ public class AsusACPI
|
|||||||
{
|
{
|
||||||
int param = 0x80 | (brightness & 0x7F);
|
int param = 0x80 | (brightness & 0x7F);
|
||||||
DeviceSet(TUF_KB_BRIGHTNESS, param, "TUF Brightness");
|
DeviceSet(TUF_KB_BRIGHTNESS, param, "TUF Brightness");
|
||||||
if (AppConfig.IsVivoZenPro()) DeviceSet(VIVO_KB_BRIGHTNESS, param, "VIVO Brightness");
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -831,6 +831,7 @@ public class AsusACPI
|
|||||||
state = state | 0x01 << 8;
|
state = state | 0x01 << 8;
|
||||||
|
|
||||||
DeviceSet(TUF_KB_STATE, state, "TUF_KB");
|
DeviceSet(TUF_KB_STATE, state, "TUF_KB");
|
||||||
|
if (AppConfig.IsVivoZenPro() && DeviceGet(KBD_BACKLIGHT_OOBE) >= 0) DeviceSet(KBD_BACKLIGHT_OOBE, 1, "VIVO OOBE");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SubscribeToEvents(Action<object, EventArrivedEventArgs> EventHandler)
|
public void SubscribeToEvents(Action<object, EventArrivedEventArgs> EventHandler)
|
||||||
|
|||||||
@@ -326,7 +326,8 @@ namespace GHelper
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
LightingMode lm = supportedLightingModes[comboBoxLightingMode.SelectedIndex];
|
var index = comboBoxLightingMode.SelectedIndex;
|
||||||
|
LightingMode lm = supportedLightingModes[index < supportedLightingModes.Count ? index : 0 ];
|
||||||
|
|
||||||
LightingSetting? ls = mouse.LightingSettingForZone(visibleZone);
|
LightingSetting? ls = mouse.LightingSettingForZone(visibleZone);
|
||||||
if (ls.LightingMode == lm)
|
if (ls.LightingMode == lm)
|
||||||
|
|||||||
@@ -145,7 +145,7 @@ namespace GHelper.AutoUpdate
|
|||||||
Logger.WriteLine(ex.Message);
|
Logger.WriteLine(ex.Message);
|
||||||
}
|
}
|
||||||
|
|
||||||
Environment.Exit(0);
|
Application.Exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,31 +2,46 @@
|
|||||||
|
|
||||||
namespace GHelper.Battery
|
namespace GHelper.Battery
|
||||||
{
|
{
|
||||||
internal class BatteryControl
|
public static class BatteryControl
|
||||||
{
|
{
|
||||||
|
|
||||||
|
static bool _chargeFull = AppConfig.Is("charge_full");
|
||||||
|
public static bool chargeFull
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return _chargeFull;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
AppConfig.Set("charge_full", value ? 1 : 0);
|
||||||
|
_chargeFull = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static void ToggleBatteryLimitFull()
|
public static void ToggleBatteryLimitFull()
|
||||||
{
|
{
|
||||||
if (AppConfig.Is("charge_full")) SetBatteryChargeLimit();
|
if (chargeFull) SetBatteryChargeLimit();
|
||||||
else SetBatteryLimitFull();
|
else SetBatteryLimitFull();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void SetBatteryLimitFull()
|
public static void SetBatteryLimitFull()
|
||||||
{
|
{
|
||||||
AppConfig.Set("charge_full", 1);
|
chargeFull = true;
|
||||||
Program.acpi.DeviceSet(AsusACPI.BatteryLimit, 100, "BatteryLimit");
|
Program.acpi.DeviceSet(AsusACPI.BatteryLimit, 100, "BatteryLimit");
|
||||||
Program.settingsForm.VisualiseBatteryFull();
|
Program.settingsForm.VisualiseBatteryFull();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void UnSetBatteryLimitFull()
|
public static void UnSetBatteryLimitFull()
|
||||||
{
|
{
|
||||||
AppConfig.Set("charge_full", 0);
|
chargeFull = false;
|
||||||
|
Logger.WriteLine("Battery fully charged");
|
||||||
Program.settingsForm.Invoke(Program.settingsForm.VisualiseBatteryFull);
|
Program.settingsForm.Invoke(Program.settingsForm.VisualiseBatteryFull);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void AutoBattery(bool init = false)
|
public static void AutoBattery(bool init = false)
|
||||||
{
|
{
|
||||||
if (AppConfig.Is("charge_full") && !init) SetBatteryLimitFull();
|
if (chargeFull && !init) SetBatteryLimitFull();
|
||||||
else SetBatteryChargeLimit();
|
else SetBatteryChargeLimit();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -46,7 +61,7 @@ namespace GHelper.Battery
|
|||||||
Program.acpi.DeviceSet(AsusACPI.BatteryLimit, limit, "BatteryLimit");
|
Program.acpi.DeviceSet(AsusACPI.BatteryLimit, limit, "BatteryLimit");
|
||||||
|
|
||||||
AppConfig.Set("charge_limit", limit);
|
AppConfig.Set("charge_limit", limit);
|
||||||
AppConfig.Set("charge_full", 0);
|
chargeFull = false;
|
||||||
|
|
||||||
Program.settingsForm.VisualiseBattery(limit);
|
Program.settingsForm.VisualiseBattery(limit);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,14 @@ namespace GHelper.Display
|
|||||||
{
|
{
|
||||||
|
|
||||||
public const int MAX_REFRESH = 1000;
|
public const int MAX_REFRESH = 1000;
|
||||||
|
public static int MIN_RATE = AppConfig.Get("min_rate", 60);
|
||||||
|
public static int MAX_RATE = AppConfig.Get("max_rate");
|
||||||
|
|
||||||
|
public static int GetMaxRate(string? laptopScreen)
|
||||||
|
{
|
||||||
|
if (MAX_RATE > 0) return MAX_RATE;
|
||||||
|
else return ScreenNative.GetMaxRefreshRate(laptopScreen);
|
||||||
|
}
|
||||||
|
|
||||||
public void AutoScreen(bool force = false)
|
public void AutoScreen(bool force = false)
|
||||||
{
|
{
|
||||||
@@ -15,7 +22,7 @@ namespace GHelper.Display
|
|||||||
if (SystemInformation.PowerStatus.PowerLineStatus == PowerLineStatus.Online)
|
if (SystemInformation.PowerStatus.PowerLineStatus == PowerLineStatus.Online)
|
||||||
SetScreen(MAX_REFRESH, 1);
|
SetScreen(MAX_REFRESH, 1);
|
||||||
else
|
else
|
||||||
SetScreen(60, 0);
|
SetScreen(MIN_RATE, 0);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -29,7 +36,7 @@ namespace GHelper.Display
|
|||||||
var refreshRate = ScreenNative.GetRefreshRate(laptopScreen);
|
var refreshRate = ScreenNative.GetRefreshRate(laptopScreen);
|
||||||
if (refreshRate < 0) return;
|
if (refreshRate < 0) return;
|
||||||
|
|
||||||
ScreenNative.SetRefreshRate(laptopScreen, refreshRate > 60 ? 60 : ScreenNative.GetMaxRefreshRate(laptopScreen));
|
ScreenNative.SetRefreshRate(laptopScreen, refreshRate > MIN_RATE ? MIN_RATE : GetMaxRate(laptopScreen));
|
||||||
InitScreen();
|
InitScreen();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -43,7 +50,7 @@ namespace GHelper.Display
|
|||||||
|
|
||||||
if (frequency >= MAX_REFRESH)
|
if (frequency >= MAX_REFRESH)
|
||||||
{
|
{
|
||||||
frequency = ScreenNative.GetMaxRefreshRate(laptopScreen);
|
frequency = GetMaxRate(laptopScreen);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (frequency > 0 && frequency != refreshRate)
|
if (frequency > 0 && frequency != refreshRate)
|
||||||
@@ -151,7 +158,7 @@ namespace GHelper.Display
|
|||||||
{
|
{
|
||||||
var laptopScreen = ScreenNative.FindLaptopScreen();
|
var laptopScreen = ScreenNative.FindLaptopScreen();
|
||||||
int frequency = ScreenNative.GetRefreshRate(laptopScreen);
|
int frequency = ScreenNative.GetRefreshRate(laptopScreen);
|
||||||
int maxFrequency = ScreenNative.GetMaxRefreshRate(laptopScreen);
|
int maxFrequency = GetMaxRate(laptopScreen);
|
||||||
|
|
||||||
if (maxFrequency > 0) AppConfig.Set("max_frequency", maxFrequency);
|
if (maxFrequency > 0) AppConfig.Set("max_frequency", maxFrequency);
|
||||||
else maxFrequency = AppConfig.Get("max_frequency");
|
else maxFrequency = AppConfig.Get("max_frequency");
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using GHelper.Helpers;
|
using GHelper.Helpers;
|
||||||
|
using Microsoft.Win32;
|
||||||
using System.Management;
|
using System.Management;
|
||||||
|
|
||||||
namespace GHelper.Display
|
namespace GHelper.Display
|
||||||
@@ -37,6 +38,7 @@ namespace GHelper.Display
|
|||||||
Cinema = 25,
|
Cinema = 25,
|
||||||
Vivid = 13,
|
Vivid = 13,
|
||||||
Eyecare = 17,
|
Eyecare = 17,
|
||||||
|
Disabled = 18,
|
||||||
}
|
}
|
||||||
public static class VisualControl
|
public static class VisualControl
|
||||||
{
|
{
|
||||||
@@ -44,6 +46,7 @@ namespace GHelper.Display
|
|||||||
|
|
||||||
private static int _brightness = 100;
|
private static int _brightness = 100;
|
||||||
private static bool _init = true;
|
private static bool _init = true;
|
||||||
|
private static bool _download = true;
|
||||||
private static string? _splendidPath = null;
|
private static string? _splendidPath = null;
|
||||||
|
|
||||||
private static System.Timers.Timer brightnessTimer = new System.Timers.Timer(200);
|
private static System.Timers.Timer brightnessTimer = new System.Timers.Timer(200);
|
||||||
@@ -98,7 +101,7 @@ namespace GHelper.Display
|
|||||||
foreach (FileInfo icm in icms)
|
foreach (FileInfo icm in icms)
|
||||||
{
|
{
|
||||||
//Logger.WriteLine(icm.FullName);
|
//Logger.WriteLine(icm.FullName);
|
||||||
|
|
||||||
if (icm.Name.Contains("sRGB"))
|
if (icm.Name.Contains("sRGB"))
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
@@ -106,7 +109,7 @@ namespace GHelper.Display
|
|||||||
_modes.Add(isVivo ? SplendidGamut.VivoSRGB : SplendidGamut.sRGB, "Gamut: sRGB");
|
_modes.Add(isVivo ? SplendidGamut.VivoSRGB : SplendidGamut.sRGB, "Gamut: sRGB");
|
||||||
Logger.WriteLine(icm.FullName + " sRGB");
|
Logger.WriteLine(icm.FullName + " sRGB");
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -174,7 +177,8 @@ namespace GHelper.Display
|
|||||||
{ SplendidCommand.FPS, "FPS"},
|
{ SplendidCommand.FPS, "FPS"},
|
||||||
{ SplendidCommand.Cinema, "Cinema"},
|
{ SplendidCommand.Cinema, "Cinema"},
|
||||||
{ SplendidCommand.Vivid, "Vivid" },
|
{ SplendidCommand.Vivid, "Vivid" },
|
||||||
{ SplendidCommand.Eyecare, "Eyecare"}
|
{ SplendidCommand.Eyecare, "Eyecare"},
|
||||||
|
{ SplendidCommand.Disabled, "Disabled"}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -204,6 +208,20 @@ namespace GHelper.Display
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const string GameVisualKey = @"HKEY_CURRENT_USER\Software\ASUS\ARMOURY CRATE Service\GameVisual";
|
||||||
|
const string GameVisualValue = "ActiveGVStatus";
|
||||||
|
|
||||||
|
public static bool IsEnabled()
|
||||||
|
{
|
||||||
|
var status = (int?)Registry.GetValue(GameVisualKey, GameVisualValue, 1);
|
||||||
|
return status > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void SetRegStatus(int status = 1)
|
||||||
|
{
|
||||||
|
Registry.SetValue(GameVisualKey, GameVisualValue, status, RegistryValueKind.DWord);
|
||||||
|
}
|
||||||
|
|
||||||
public static void SetGamut(int mode = -1)
|
public static void SetGamut(int mode = -1)
|
||||||
{
|
{
|
||||||
if (skipGamut) return;
|
if (skipGamut) return;
|
||||||
@@ -217,6 +235,11 @@ namespace GHelper.Display
|
|||||||
{
|
{
|
||||||
Logger.WriteLine("Gamut setting refused, reverting.");
|
Logger.WriteLine("Gamut setting refused, reverting.");
|
||||||
RunSplendid(SplendidCommand.GamutMode, 0, (int)GetDefaultGamut());
|
RunSplendid(SplendidCommand.GamutMode, 0, (int)GetDefaultGamut());
|
||||||
|
if (ProcessHelper.IsUserAdministrator() && _download)
|
||||||
|
{
|
||||||
|
_download = false;
|
||||||
|
ColorProfileHelper.InstallProfile();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (result == 1 && _init)
|
if (result == 1 && _init)
|
||||||
{
|
{
|
||||||
@@ -229,7 +252,7 @@ namespace GHelper.Display
|
|||||||
public static void SetVisual(SplendidCommand mode = SplendidCommand.Default, int whiteBalance = DefaultColorTemp, bool init = false)
|
public static void SetVisual(SplendidCommand mode = SplendidCommand.Default, int whiteBalance = DefaultColorTemp, bool init = false)
|
||||||
{
|
{
|
||||||
if (mode == SplendidCommand.None) return;
|
if (mode == SplendidCommand.None) return;
|
||||||
if ((mode == SplendidCommand.Default || mode == SplendidCommand.VivoNormal) && init) return; // Skip default setting on init
|
if ((mode == SplendidCommand.Disabled || mode == SplendidCommand.Default || mode == SplendidCommand.VivoNormal) && init) return; // Skip default setting on init
|
||||||
|
|
||||||
if (!forceVisual && ScreenCCD.GetHDRStatus(true)) return;
|
if (!forceVisual && ScreenCCD.GetHDRStatus(true)) return;
|
||||||
if (!forceVisual && ScreenNative.GetRefreshRate(ScreenNative.FindLaptopScreen(true)) < 0) return;
|
if (!forceVisual && ScreenNative.GetRefreshRate(ScreenNative.FindLaptopScreen(true)) < 0) return;
|
||||||
@@ -239,12 +262,16 @@ namespace GHelper.Display
|
|||||||
|
|
||||||
if (whiteBalance != DefaultColorTemp && !init) ProcessHelper.RunAsAdmin();
|
if (whiteBalance != DefaultColorTemp && !init) ProcessHelper.RunAsAdmin();
|
||||||
|
|
||||||
int? balance;
|
int? balance = null;
|
||||||
|
int command = 0;
|
||||||
|
|
||||||
switch (mode)
|
switch (mode)
|
||||||
{
|
{
|
||||||
|
case SplendidCommand.Disabled:
|
||||||
|
command = 2;
|
||||||
|
break;
|
||||||
case SplendidCommand.Eyecare:
|
case SplendidCommand.Eyecare:
|
||||||
balance = 2;
|
balance = 4;
|
||||||
break;
|
break;
|
||||||
case SplendidCommand.VivoNormal:
|
case SplendidCommand.VivoNormal:
|
||||||
case SplendidCommand.VivoVivid:
|
case SplendidCommand.VivoVivid:
|
||||||
@@ -258,12 +285,17 @@ namespace GHelper.Display
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
var result = RunSplendid(mode, 0, balance);
|
int result = RunSplendid(mode, command, balance);
|
||||||
if (result == 0) return;
|
if (result == 0) return;
|
||||||
if (result == -1)
|
if (result == -1)
|
||||||
{
|
{
|
||||||
Logger.WriteLine("Visual setting refused, reverting.");
|
Logger.WriteLine("Visual mode setting refused, reverting.");
|
||||||
RunSplendid(SplendidCommand.Default, 0, DefaultColorTemp);
|
RunSplendid(SplendidCommand.Default, 0, DefaultColorTemp);
|
||||||
|
if (ProcessHelper.IsUserAdministrator() && _download)
|
||||||
|
{
|
||||||
|
_download = false;
|
||||||
|
ColorProfileHelper.InstallProfile();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (result == 1 && _init)
|
if (result == 1 && _init)
|
||||||
{
|
{
|
||||||
@@ -310,6 +342,11 @@ namespace GHelper.Display
|
|||||||
var result = ProcessHelper.RunCMD(splendid, (int)command + " " + param1 + " " + param2);
|
var result = ProcessHelper.RunCMD(splendid, (int)command + " " + param1 + " " + param2);
|
||||||
if (result.Contains("file not exist") || (result.Length == 0 && !isVivo)) return 1;
|
if (result.Contains("file not exist") || (result.Length == 0 && !isVivo)) return 1;
|
||||||
if (result.Contains("return code: -1")) return -1;
|
if (result.Contains("return code: -1")) return -1;
|
||||||
|
if (result.Contains("Visual is disabled"))
|
||||||
|
{
|
||||||
|
SetRegStatus(1);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@@ -356,7 +393,7 @@ namespace GHelper.Display
|
|||||||
public static int SetBrightness(int brightness = -1, int delta = 0)
|
public static int SetBrightness(int brightness = -1, int delta = 0)
|
||||||
{
|
{
|
||||||
if (!AppConfig.IsOLED()) return -1;
|
if (!AppConfig.IsOLED()) return -1;
|
||||||
if (brightness < 0) GetBrightness();
|
if (brightness < 0) brightness = GetBrightness();
|
||||||
|
|
||||||
_brightness = Math.Max(0, Math.Min(100, brightness + delta));
|
_brightness = Math.Max(0, Math.Min(100, brightness + delta));
|
||||||
AppConfig.Set(IsOnBattery() ? "brightness_battery" : "brightness", _brightness);
|
AppConfig.Set(IsOnBattery() ? "brightness_battery" : "brightness", _brightness);
|
||||||
|
|||||||
615
app/Extra.Designer.cs
generated
615
app/Extra.Designer.cs
generated
File diff suppressed because it is too large
Load Diff
11
app/Extra.cs
11
app/Extra.cs
@@ -37,6 +37,7 @@ namespace GHelper
|
|||||||
{"brightness_up", Properties.Strings.BrightnessUp},
|
{"brightness_up", Properties.Strings.BrightnessUp},
|
||||||
{"visual", Properties.Strings.VisualMode},
|
{"visual", Properties.Strings.VisualMode},
|
||||||
{"touchscreen", Properties.Strings.ToggleTouchscreen },
|
{"touchscreen", Properties.Strings.ToggleTouchscreen },
|
||||||
|
{"micmute", Properties.Strings.MuteMic},
|
||||||
{"ghelper", Properties.Strings.OpenGHelper},
|
{"ghelper", Properties.Strings.OpenGHelper},
|
||||||
{"custom", Properties.Strings.Custom}
|
{"custom", Properties.Strings.Custom}
|
||||||
};
|
};
|
||||||
@@ -62,6 +63,7 @@ namespace GHelper
|
|||||||
break;
|
break;
|
||||||
case "m3":
|
case "m3":
|
||||||
customActions[""] = Properties.Strings.MuteMic;
|
customActions[""] = Properties.Strings.MuteMic;
|
||||||
|
customActions.Remove("micmute");
|
||||||
break;
|
break;
|
||||||
case "m4":
|
case "m4":
|
||||||
customActions[""] = Properties.Strings.OpenGHelper;
|
customActions[""] = Properties.Strings.OpenGHelper;
|
||||||
@@ -421,7 +423,7 @@ namespace GHelper
|
|||||||
var statusLed = Program.acpi.DeviceGet(AsusACPI.StatusLed);
|
var statusLed = Program.acpi.DeviceGet(AsusACPI.StatusLed);
|
||||||
checkStatusLed.Visible = statusLed >= 0;
|
checkStatusLed.Visible = statusLed >= 0;
|
||||||
checkStatusLed.Checked = (statusLed > 0);
|
checkStatusLed.Checked = (statusLed > 0);
|
||||||
checkStatusLed.CheckedChanged += CheckLEDStatus_CheckedChanged; ;
|
checkStatusLed.CheckedChanged += CheckLEDStatus_CheckedChanged;
|
||||||
|
|
||||||
|
|
||||||
checkBWIcon.Checked = AppConfig.IsBWIcon();
|
checkBWIcon.Checked = AppConfig.IsBWIcon();
|
||||||
@@ -458,7 +460,7 @@ namespace GHelper
|
|||||||
|
|
||||||
private void CheckLEDStatus_CheckedChanged(object? sender, EventArgs e)
|
private void CheckLEDStatus_CheckedChanged(object? sender, EventArgs e)
|
||||||
{
|
{
|
||||||
Program.acpi.DeviceSet(AsusACPI.StatusLed, (checkStatusLed.Checked ? 7 : 0), "StatusLED");
|
InputDispatcher.SetStatusLED(checkStatusLed.Checked);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void CheckBWIcon_CheckedChanged(object? sender, EventArgs e)
|
private void CheckBWIcon_CheckedChanged(object? sender, EventArgs e)
|
||||||
@@ -505,7 +507,10 @@ namespace GHelper
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
eCoresMax = Math.Max(8, eCoresMax);
|
if (eCoresMax == 0) eCoresMax = 8;
|
||||||
|
if (pCoresMax == 0) pCoresMax = 6;
|
||||||
|
|
||||||
|
eCoresMax = Math.Max(4, eCoresMax);
|
||||||
pCoresMax = Math.Max(6, pCoresMax);
|
pCoresMax = Math.Max(6, pCoresMax);
|
||||||
|
|
||||||
panelCores.Visible = true;
|
panelCores.Visible = true;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<root>
|
<root>
|
||||||
<!--
|
<!--
|
||||||
Microsoft ResX Schema
|
Microsoft ResX Schema
|
||||||
|
|
||||||
Version 2.0
|
Version 2.0
|
||||||
|
|
||||||
@@ -48,7 +48,7 @@
|
|||||||
value : The object must be serialized with
|
value : The object must be serialized with
|
||||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||||
: and then encoded with base64 encoding.
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
mimetype: application/x-microsoft.net.object.soap.base64
|
mimetype: application/x-microsoft.net.object.soap.base64
|
||||||
value : The object must be serialized with
|
value : The object must be serialized with
|
||||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
<ProduceReferenceAssembly>False</ProduceReferenceAssembly>
|
<ProduceReferenceAssembly>False</ProduceReferenceAssembly>
|
||||||
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
|
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
|
||||||
<AssemblyVersion>0.191</AssemblyVersion>
|
<AssemblyVersion>0.199</AssemblyVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||||
@@ -63,8 +63,8 @@
|
|||||||
<PackageReference Include="NAudio" Version="2.1.0" />
|
<PackageReference Include="NAudio" Version="2.1.0" />
|
||||||
<PackageReference Include="NvAPIWrapper.Net" Version="0.8.1.101" />
|
<PackageReference Include="NvAPIWrapper.Net" Version="0.8.1.101" />
|
||||||
<PackageReference Include="System.Management" Version="8.0.0" />
|
<PackageReference Include="System.Management" Version="8.0.0" />
|
||||||
<PackageReference Include="TaskScheduler" Version="2.10.1" />
|
<PackageReference Include="TaskScheduler" Version="2.11.0" />
|
||||||
<PackageReference Include="WinForms.DataVisualization" Version="1.8.0" />
|
<PackageReference Include="WinForms.DataVisualization" Version="1.9.2" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
@@ -62,8 +62,7 @@ public class AmdGpuControl : IGpuControl
|
|||||||
|
|
||||||
public AmdGpuControl()
|
public AmdGpuControl()
|
||||||
{
|
{
|
||||||
if (!Adl2.Load())
|
if (AppConfig.NoGpu() || !Adl2.Load()) return;
|
||||||
return;
|
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -22,6 +22,12 @@ namespace GHelper.Gpu
|
|||||||
|
|
||||||
public void InitGPUMode()
|
public void InitGPUMode()
|
||||||
{
|
{
|
||||||
|
if (AppConfig.NoGpu())
|
||||||
|
{
|
||||||
|
settings.HideGPUModes(false);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
int eco = Program.acpi.DeviceGet(AsusACPI.GPUEco);
|
int eco = Program.acpi.DeviceGet(AsusACPI.GPUEco);
|
||||||
int mux = Program.acpi.DeviceGet(AsusACPI.GPUMux);
|
int mux = Program.acpi.DeviceGet(AsusACPI.GPUMux);
|
||||||
|
|
||||||
@@ -92,13 +98,16 @@ namespace GHelper.Gpu
|
|||||||
{
|
{
|
||||||
if (AppConfig.NoAutoUltimate())
|
if (AppConfig.NoAutoUltimate())
|
||||||
{
|
{
|
||||||
int standardStatus = Program.acpi.SetGPUEco(0);
|
Program.acpi.SetGPUEco(0);
|
||||||
if (standardStatus == 0)
|
Thread.Sleep(500);
|
||||||
|
|
||||||
|
int eco = Program.acpi.DeviceGet(AsusACPI.GPUEco);
|
||||||
|
Logger.WriteLine("Eco flag : " + eco);
|
||||||
|
if (eco == 1)
|
||||||
{
|
{
|
||||||
settings.VisualiseGPUMode();
|
settings.VisualiseGPUMode();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Thread.Sleep(100);
|
|
||||||
}
|
}
|
||||||
status = Program.acpi.DeviceSet(AsusACPI.GPUMux, 0, "GPUMux");
|
status = Program.acpi.DeviceSet(AsusACPI.GPUMux, 0, "GPUMux");
|
||||||
restart = true;
|
restart = true;
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ namespace GHelper
|
|||||||
private void CheckController_CheckedChanged(object? sender, EventArgs e)
|
private void CheckController_CheckedChanged(object? sender, EventArgs e)
|
||||||
{
|
{
|
||||||
AppConfig.Set("controller_disabled", checkController.Checked ? 1 : 0);
|
AppConfig.Set("controller_disabled", checkController.Checked ? 1 : 0);
|
||||||
AllyControl.ApplyXBoxStatus();
|
AllyControl.DisableXBoxController(checkController.Checked);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ComboBinding(RComboBox combo)
|
private void ComboBinding(RComboBox combo)
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ public static class HardwareControl
|
|||||||
public static decimal? fullCapacity;
|
public static decimal? fullCapacity;
|
||||||
public static decimal? chargeCapacity;
|
public static decimal? chargeCapacity;
|
||||||
|
|
||||||
|
public static string? batteryCharge;
|
||||||
|
|
||||||
public static string? cpuFan;
|
public static string? cpuFan;
|
||||||
public static string? gpuFan;
|
public static string? gpuFan;
|
||||||
@@ -34,6 +34,20 @@ public static class HardwareControl
|
|||||||
|
|
||||||
static long lastUpdate;
|
static long lastUpdate;
|
||||||
|
|
||||||
|
static bool _chargeWatt = AppConfig.Is("charge_watt");
|
||||||
|
public static bool chargeWatt
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return _chargeWatt;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
AppConfig.Set("charge_watt", value ? 1 : 0);
|
||||||
|
_chargeWatt = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private static int GetGpuUse()
|
private static int GetGpuUse()
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
@@ -226,11 +240,17 @@ public static class HardwareControl
|
|||||||
|
|
||||||
if (fullCapacity > 0 && chargeCapacity > 0)
|
if (fullCapacity > 0 && chargeCapacity > 0)
|
||||||
{
|
{
|
||||||
batteryCapacity = Math.Min(100, ((decimal)chargeCapacity / (decimal)fullCapacity) * 100);
|
batteryCapacity = Math.Min(100, (decimal)chargeCapacity / (decimal)fullCapacity * 100);
|
||||||
if (batteryCapacity > 99) BatteryControl.UnSetBatteryLimitFull();
|
if (batteryCapacity > 99 && BatteryControl.chargeFull) BatteryControl.UnSetBatteryLimitFull();
|
||||||
|
if (chargeWatt)
|
||||||
|
{
|
||||||
|
batteryCharge = Math.Round((decimal)chargeCapacity / 1000, 1).ToString() + "Wh";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
batteryCharge = Math.Round(batteryCapacity, 1) + "%";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static bool IsUsedGPU(int threshold = 10)
|
public static bool IsUsedGPU(int threshold = 10)
|
||||||
@@ -265,6 +285,7 @@ public static class HardwareControl
|
|||||||
|
|
||||||
public static void RecreateGpuControl()
|
public static void RecreateGpuControl()
|
||||||
{
|
{
|
||||||
|
if (AppConfig.NoGpu()) return;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
GpuControl?.Dispose();
|
GpuControl?.Dispose();
|
||||||
|
|||||||
@@ -106,7 +106,7 @@ public class Startup
|
|||||||
{
|
{
|
||||||
|
|
||||||
td.RegistrationInfo.Description = "G-Helper Auto Start";
|
td.RegistrationInfo.Description = "G-Helper Auto Start";
|
||||||
td.Triggers.Add(new LogonTrigger { UserId = WindowsIdentity.GetCurrent().Name, Delay = TimeSpan.FromSeconds(1) });
|
td.Triggers.Add(new LogonTrigger { UserId = WindowsIdentity.GetCurrent().Name, Delay = TimeSpan.FromSeconds(2) });
|
||||||
td.Actions.Add(strExeFilePath);
|
td.Actions.Add(strExeFilePath);
|
||||||
|
|
||||||
if (ProcessHelper.IsUserAdministrator())
|
if (ProcessHelper.IsUserAdministrator())
|
||||||
|
|||||||
@@ -2,21 +2,31 @@
|
|||||||
|
|
||||||
public static class TouchscreenHelper
|
public static class TouchscreenHelper
|
||||||
{
|
{
|
||||||
public static bool? ToggleTouchscreen()
|
|
||||||
|
public static bool? GetStatus()
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
ProcessHelper.RunAsAdmin();
|
ProcessHelper.RunAsAdmin();
|
||||||
|
return ProcessHelper.RunCMD("powershell", "(Get-PnpDevice -FriendlyName '*touch*screen*').Status").Contains("OK");
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Logger.WriteLine($"Can't get touchscreen status: {ex.Message}");
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
var status = !ProcessHelper.RunCMD("powershell", "(Get-PnpDevice -FriendlyName '*touch*screen*').Status").Contains("OK");
|
public static void ToggleTouchscreen(bool status)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
ProcessHelper.RunAsAdmin();
|
||||||
ProcessHelper.RunCMD("powershell", (status ? "Enable-PnpDevice" : "Disable-PnpDevice") + " -InstanceId (Get-PnpDevice -FriendlyName '*touch*screen*').InstanceId -Confirm:$false");
|
ProcessHelper.RunCMD("powershell", (status ? "Enable-PnpDevice" : "Disable-PnpDevice") + " -InstanceId (Get-PnpDevice -FriendlyName '*touch*screen*').InstanceId -Confirm:$false");
|
||||||
|
|
||||||
return status;
|
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
Logger.WriteLine($"Can't toggle touchscreen: {ex.Message}");
|
Logger.WriteLine($"Can't toggle touchscreen: {ex.Message}");
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,9 +14,16 @@ namespace GHelper.Input
|
|||||||
{
|
{
|
||||||
System.Timers.Timer timer = new System.Timers.Timer(1000);
|
System.Timers.Timer timer = new System.Timers.Timer(1000);
|
||||||
public static bool backlightActivity = true;
|
public static bool backlightActivity = true;
|
||||||
|
public static bool lidClose = false;
|
||||||
|
|
||||||
public static Keys keyProfile = Keys.F5;
|
public static Keys keyProfile = (Keys)AppConfig.Get("keybind_profile", (int)Keys.F5);
|
||||||
public static Keys keyApp = Keys.F12;
|
public static Keys keyApp = (Keys)AppConfig.Get("keybind_app", (int)Keys.F12);
|
||||||
|
|
||||||
|
public static Keys keyProfile0 = (Keys)AppConfig.Get("keybind_profile_0", (int)Keys.F17);
|
||||||
|
public static Keys keyProfile1 = (Keys)AppConfig.Get("keybind_profile_1", (int)Keys.F18);
|
||||||
|
public static Keys keyProfile2 = (Keys)AppConfig.Get("keybind_profile_2", (int)Keys.F16);
|
||||||
|
public static Keys keyProfile3 = (Keys)AppConfig.Get("keybind_profile_3", (int)Keys.F19);
|
||||||
|
public static Keys keyProfile4 = (Keys)AppConfig.Get("keybind_profile_4", (int)Keys.F20);
|
||||||
|
|
||||||
static ModeControl modeControl = Program.modeControl;
|
static ModeControl modeControl = Program.modeControl;
|
||||||
static ScreenControl screenControl = new ScreenControl();
|
static ScreenControl screenControl = new ScreenControl();
|
||||||
@@ -79,9 +86,14 @@ namespace GHelper.Input
|
|||||||
Program.acpi.DeviceInit();
|
Program.acpi.DeviceInit();
|
||||||
|
|
||||||
if (!OptimizationService.IsRunning())
|
if (!OptimizationService.IsRunning())
|
||||||
|
{
|
||||||
|
Program.acpi.DeviceGet(AsusACPI.CameraShutter);
|
||||||
listener = new KeyboardListener(HandleEvent);
|
listener = new KeyboardListener(HandleEvent);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
Logger.WriteLine("Optimization service is running");
|
Logger.WriteLine("Optimization service is running");
|
||||||
|
}
|
||||||
|
|
||||||
InitBacklightTimer();
|
InitBacklightTimer();
|
||||||
|
|
||||||
@@ -101,10 +113,6 @@ namespace GHelper.Input
|
|||||||
{
|
{
|
||||||
hook.UnregisterAll();
|
hook.UnregisterAll();
|
||||||
|
|
||||||
// CTRL + SHIFT + F5 to cycle profiles
|
|
||||||
if (AppConfig.Get("keybind_profile") != -1) keyProfile = (Keys)AppConfig.Get("keybind_profile");
|
|
||||||
if (AppConfig.Get("keybind_app") != -1) keyApp = (Keys)AppConfig.Get("keybind_app");
|
|
||||||
|
|
||||||
string actionM1 = AppConfig.GetString("m1");
|
string actionM1 = AppConfig.GetString("m1");
|
||||||
string actionM2 = AppConfig.GetString("m2");
|
string actionM2 = AppConfig.GetString("m2");
|
||||||
|
|
||||||
@@ -118,18 +126,24 @@ namespace GHelper.Input
|
|||||||
|
|
||||||
if (!AppConfig.Is("skip_hotkeys"))
|
if (!AppConfig.Is("skip_hotkeys"))
|
||||||
{
|
{
|
||||||
|
if (AppConfig.IsDUO())
|
||||||
|
{
|
||||||
|
hook.RegisterHotKey(ModifierKeys.Shift | ModifierKeys.Control | ModifierKeys.Alt, Keys.F7);
|
||||||
|
hook.RegisterHotKey(ModifierKeys.Shift | ModifierKeys.Control | ModifierKeys.Alt, Keys.F8);
|
||||||
|
}
|
||||||
|
|
||||||
hook.RegisterHotKey(ModifierKeys.Shift | ModifierKeys.Control | ModifierKeys.Alt, Keys.F13);
|
hook.RegisterHotKey(ModifierKeys.Shift | ModifierKeys.Control | ModifierKeys.Alt, Keys.F13);
|
||||||
|
|
||||||
hook.RegisterHotKey(ModifierKeys.Shift | ModifierKeys.Control | ModifierKeys.Alt, Keys.F14);
|
hook.RegisterHotKey(ModifierKeys.Shift | ModifierKeys.Control | ModifierKeys.Alt, Keys.F14);
|
||||||
hook.RegisterHotKey(ModifierKeys.Shift | ModifierKeys.Control | ModifierKeys.Alt, Keys.F15);
|
hook.RegisterHotKey(ModifierKeys.Shift | ModifierKeys.Control | ModifierKeys.Alt, Keys.F15);
|
||||||
|
hook.RegisterHotKey(ModifierKeys.Shift | ModifierKeys.Control | ModifierKeys.Alt, Keys.F21);
|
||||||
|
hook.RegisterHotKey(ModifierKeys.Shift | ModifierKeys.Control | ModifierKeys.Alt, Keys.F22);
|
||||||
|
|
||||||
hook.RegisterHotKey(ModifierKeys.Shift | ModifierKeys.Control | ModifierKeys.Alt, Keys.F16);
|
hook.RegisterHotKey(ModifierKeys.Shift | ModifierKeys.Control | ModifierKeys.Alt, keyProfile0);
|
||||||
hook.RegisterHotKey(ModifierKeys.Shift | ModifierKeys.Control | ModifierKeys.Alt, Keys.F17);
|
hook.RegisterHotKey(ModifierKeys.Shift | ModifierKeys.Control | ModifierKeys.Alt, keyProfile1);
|
||||||
hook.RegisterHotKey(ModifierKeys.Shift | ModifierKeys.Control | ModifierKeys.Alt, Keys.F18);
|
hook.RegisterHotKey(ModifierKeys.Shift | ModifierKeys.Control | ModifierKeys.Alt, keyProfile2);
|
||||||
hook.RegisterHotKey(ModifierKeys.Shift | ModifierKeys.Control | ModifierKeys.Alt, Keys.F19);
|
hook.RegisterHotKey(ModifierKeys.Shift | ModifierKeys.Control | ModifierKeys.Alt, keyProfile3);
|
||||||
hook.RegisterHotKey(ModifierKeys.Shift | ModifierKeys.Control | ModifierKeys.Alt, Keys.F20);
|
hook.RegisterHotKey(ModifierKeys.Shift | ModifierKeys.Control | ModifierKeys.Alt, keyProfile4);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
hook.RegisterHotKey(ModifierKeys.Control, Keys.VolumeDown);
|
hook.RegisterHotKey(ModifierKeys.Control, Keys.VolumeDown);
|
||||||
hook.RegisterHotKey(ModifierKeys.Control, Keys.VolumeUp);
|
hook.RegisterHotKey(ModifierKeys.Control, Keys.VolumeUp);
|
||||||
@@ -421,6 +435,12 @@ namespace GHelper.Input
|
|||||||
{
|
{
|
||||||
if (e.Key == keyProfile) modeControl.CyclePerformanceMode(true);
|
if (e.Key == keyProfile) modeControl.CyclePerformanceMode(true);
|
||||||
|
|
||||||
|
if (e.Key == keyProfile0) modeControl.SetPerformanceMode(0, true);
|
||||||
|
if (e.Key == keyProfile1) modeControl.SetPerformanceMode(1, true);
|
||||||
|
if (e.Key == keyProfile2) modeControl.SetPerformanceMode(2, true);
|
||||||
|
if (e.Key == keyProfile3) modeControl.SetPerformanceMode(3, true);
|
||||||
|
if (e.Key == keyProfile4) modeControl.SetPerformanceMode(4, true);
|
||||||
|
|
||||||
switch (e.Key)
|
switch (e.Key)
|
||||||
{
|
{
|
||||||
case Keys.F1:
|
case Keys.F1:
|
||||||
@@ -435,29 +455,30 @@ namespace GHelper.Input
|
|||||||
case Keys.F4:
|
case Keys.F4:
|
||||||
Program.settingsForm.BeginInvoke(Program.settingsForm.allyControl.ToggleModeHotkey);
|
Program.settingsForm.BeginInvoke(Program.settingsForm.allyControl.ToggleModeHotkey);
|
||||||
break;
|
break;
|
||||||
|
case Keys.F7:
|
||||||
|
SetScreenpad(-10);
|
||||||
|
break;
|
||||||
|
case Keys.F8:
|
||||||
|
SetScreenpad(10);
|
||||||
|
break;
|
||||||
case Keys.F13:
|
case Keys.F13:
|
||||||
ToggleScreenRate();
|
ToggleScreenRate();
|
||||||
break;
|
break;
|
||||||
case Keys.F14:
|
case Keys.F14:
|
||||||
|
Program.toast.RunToast(Properties.Strings.EcoMode);
|
||||||
Program.settingsForm.gpuControl.SetGPUMode(AsusACPI.GPUModeEco);
|
Program.settingsForm.gpuControl.SetGPUMode(AsusACPI.GPUModeEco);
|
||||||
break;
|
break;
|
||||||
case Keys.F15:
|
case Keys.F15:
|
||||||
|
Program.toast.RunToast(Properties.Strings.StandardMode);
|
||||||
Program.settingsForm.gpuControl.SetGPUMode(AsusACPI.GPUModeStandard);
|
Program.settingsForm.gpuControl.SetGPUMode(AsusACPI.GPUModeStandard);
|
||||||
break;
|
break;
|
||||||
case Keys.F16:
|
case Keys.F21:
|
||||||
modeControl.SetPerformanceMode(2, true);
|
Program.toast.RunToast("Activating XGM");
|
||||||
|
Program.settingsForm.gpuControl.ToggleXGM(true);
|
||||||
break;
|
break;
|
||||||
case Keys.F17:
|
case Keys.F22:
|
||||||
modeControl.SetPerformanceMode(0, true);
|
Program.toast.RunToast("Deactivating XGM");
|
||||||
break;
|
Program.settingsForm.gpuControl.ToggleXGM(false);
|
||||||
case Keys.F18:
|
|
||||||
modeControl.SetPerformanceMode(1, true);
|
|
||||||
break;
|
|
||||||
case Keys.F19:
|
|
||||||
modeControl.SetPerformanceMode(3, true);
|
|
||||||
break;
|
|
||||||
case Keys.F20:
|
|
||||||
modeControl.SetPerformanceMode(4, true);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -591,9 +612,13 @@ namespace GHelper.Input
|
|||||||
Program.settingsForm.BeginInvoke(Program.settingsForm.allyControl.ToggleModeHotkey);
|
Program.settingsForm.BeginInvoke(Program.settingsForm.allyControl.ToggleModeHotkey);
|
||||||
break;
|
break;
|
||||||
case "touchscreen":
|
case "touchscreen":
|
||||||
var touchscreenStatus = TouchscreenHelper.ToggleTouchscreen();
|
var status = !TouchscreenHelper.GetStatus();
|
||||||
if (touchscreenStatus is not null)
|
Logger.WriteLine("Touchscreen status: " + status);
|
||||||
Program.toast.RunToast(Properties.Strings.Touchscreen + " " + ((bool)touchscreenStatus ? Properties.Strings.On : Properties.Strings.Off), ToastIcon.Touchpad);
|
if (status is not null)
|
||||||
|
{
|
||||||
|
Program.toast.RunToast(Properties.Strings.Touchscreen + " " + ((bool)status ? Properties.Strings.On : Properties.Strings.Off), ToastIcon.Touchpad);
|
||||||
|
TouchscreenHelper.ToggleTouchscreen((bool)status);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@@ -654,7 +679,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.IsHardwareFnLock())
|
if (AppConfig.IsHardwareFnLock())
|
||||||
HardwareFnLock(fnLock);
|
HardwareFnLock(fnLock);
|
||||||
else
|
else
|
||||||
Program.settingsForm.BeginInvoke(Program.inputDispatcher.RegisterKeys);
|
Program.settingsForm.BeginInvoke(Program.inputDispatcher.RegisterKeys);
|
||||||
@@ -731,6 +756,8 @@ namespace GHelper.Input
|
|||||||
KeyProcess("fne");
|
KeyProcess("fne");
|
||||||
return;
|
return;
|
||||||
case 174: // FN+F5
|
case 174: // FN+F5
|
||||||
|
case 153: // FN+F5 OLD MODELS
|
||||||
|
case 157: // Zenbook DUO FN+F
|
||||||
modeControl.CyclePerformanceMode(Control.ModifierKeys == Keys.Shift);
|
modeControl.CyclePerformanceMode(Control.ModifierKeys == Keys.Shift);
|
||||||
return;
|
return;
|
||||||
case 179: // FN+F4
|
case 179: // FN+F4
|
||||||
@@ -861,10 +888,22 @@ namespace GHelper.Input
|
|||||||
return Math.Max(Math.Min(3, backlight), 0);
|
return Math.Max(Math.Min(3, backlight), 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void SetBacklightAuto(bool init = false)
|
public static void AutoKeyboard()
|
||||||
{
|
{
|
||||||
if (init) Aura.Init();
|
if (AppConfig.HasTabletMode()) TabletMode();
|
||||||
Aura.ApplyBrightness(GetBacklight(), "Auto", init);
|
if (lidClose || AppConfig.Is("skip_aura")) return;
|
||||||
|
|
||||||
|
Aura.Init();
|
||||||
|
Aura.ApplyPower();
|
||||||
|
Aura.ApplyAura();
|
||||||
|
SetBacklightAuto();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static void SetBacklightAuto()
|
||||||
|
{
|
||||||
|
if (lidClose) return;
|
||||||
|
Aura.ApplyBrightness(GetBacklight(), "Auto");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void SetBacklight(int delta, bool force = false)
|
public static void SetBacklight(int delta, bool force = false)
|
||||||
@@ -920,33 +959,55 @@ namespace GHelper.Input
|
|||||||
|
|
||||||
public static void ToggleCamera()
|
public static void ToggleCamera()
|
||||||
{
|
{
|
||||||
if (!ProcessHelper.IsUserAdministrator()) return;
|
int cameraShutter = Program.acpi.DeviceGet(AsusACPI.CameraShutter);
|
||||||
|
|
||||||
string CameraRegistryKeyPath = @"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\webcam";
|
if (cameraShutter == 0)
|
||||||
string CameraRegistryValueName = "Value";
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
{
|
||||||
var status = (string?)Registry.GetValue(CameraRegistryKeyPath, CameraRegistryValueName, "");
|
Program.acpi.DeviceSet(AsusACPI.CameraShutter, 1, "CameraShutterOn");
|
||||||
|
Program.toast.RunToast($"Camera Off");
|
||||||
|
}
|
||||||
|
else if (cameraShutter == 1)
|
||||||
|
{
|
||||||
|
Program.acpi.DeviceSet(AsusACPI.CameraShutter, 0, "CameraShutterOff");
|
||||||
|
Program.toast.RunToast($"Camera On");
|
||||||
|
}
|
||||||
|
else if (cameraShutter == 262144)
|
||||||
|
{
|
||||||
|
Program.toast.RunToast($"Camera Off");
|
||||||
|
}
|
||||||
|
else if (cameraShutter == 262145)
|
||||||
|
{
|
||||||
|
Program.toast.RunToast($"Camera On");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (!ProcessHelper.IsUserAdministrator()) return;
|
||||||
|
|
||||||
if (status == "Allow") status = "Deny";
|
string CameraRegistryKeyPath = @"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\webcam";
|
||||||
else if (status == "Deny") status = "Allow";
|
string CameraRegistryValueName = "Value";
|
||||||
else
|
|
||||||
|
try
|
||||||
{
|
{
|
||||||
Logger.WriteLine("Unknown camera status");
|
var status = (string?)Registry.GetValue(CameraRegistryKeyPath, CameraRegistryValueName, "");
|
||||||
return;
|
|
||||||
|
if (status == "Allow") status = "Deny";
|
||||||
|
else if (status == "Deny") status = "Allow";
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Logger.WriteLine("Unknown camera status");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Registry.SetValue(CameraRegistryKeyPath, CameraRegistryValueName, status, RegistryValueKind.String);
|
||||||
|
Program.acpi.DeviceSet(AsusACPI.CameraLed, (status == "Deny" ? 1 : 0), "Camera");
|
||||||
|
Program.toast.RunToast($"Camera " + (status == "Deny" ? "Off" : "On"));
|
||||||
|
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Logger.WriteLine(ex.ToString());
|
||||||
}
|
}
|
||||||
|
|
||||||
Registry.SetValue(CameraRegistryKeyPath, CameraRegistryValueName, status, RegistryValueKind.String);
|
|
||||||
Program.acpi.DeviceSet(AsusACPI.CameraLed, (status == "Deny" ? 1 : 0), "Camera");
|
|
||||||
Program.toast.RunToast($"Camera " + (status == "Deny" ? "Off" : "On"));
|
|
||||||
|
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
Logger.WriteLine(ex.ToString());
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static System.Threading.Timer screenpadActionTimer;
|
private static System.Threading.Timer screenpadActionTimer;
|
||||||
@@ -964,7 +1025,7 @@ namespace GHelper.Input
|
|||||||
if (b < 0) Program.acpi.DeviceSet(AsusACPI.ScreenPadToggle, 0, "ScreenpadOff");
|
if (b < 0) Program.acpi.DeviceSet(AsusACPI.ScreenPadToggle, 0, "ScreenpadOff");
|
||||||
};
|
};
|
||||||
|
|
||||||
if(delay <= 0 || instant) //instant action
|
if (delay <= 0 || instant) //instant action
|
||||||
{
|
{
|
||||||
action(brightness);
|
action(brightness);
|
||||||
}
|
}
|
||||||
@@ -1008,6 +1069,28 @@ namespace GHelper.Input
|
|||||||
Program.toast.RunToast($"Screen Pad {toast}", delta > 0 ? ToastIcon.BrightnessUp : ToastIcon.BrightnessDown);
|
Program.toast.RunToast($"Screen Pad {toast}", delta > 0 ? ToastIcon.BrightnessUp : ToastIcon.BrightnessDown);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void InitScreenpad()
|
||||||
|
{
|
||||||
|
if (!AppConfig.IsDUO()) return;
|
||||||
|
int brightness = AppConfig.Get("screenpad");
|
||||||
|
if (brightness >= 0) ApplyScreenpadAction(brightness);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void SetStatusLED(bool status)
|
||||||
|
{
|
||||||
|
Program.acpi.DeviceSet(AsusACPI.StatusLed, status ? 7 : 0, "StatusLED");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void InitStatusLed()
|
||||||
|
{
|
||||||
|
if (AppConfig.IsAutoStatusLed()) SetStatusLED(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void ShutdownStatusLed()
|
||||||
|
{
|
||||||
|
if (AppConfig.IsAutoStatusLed()) SetStatusLED(false);
|
||||||
|
}
|
||||||
|
|
||||||
static void LaunchProcess(string command = "")
|
static void LaunchProcess(string command = "")
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(command)) return;
|
if (string.IsNullOrEmpty(command)) return;
|
||||||
|
|||||||
@@ -10,6 +10,8 @@ namespace GHelper.Input
|
|||||||
CancellationTokenSource cancellationTokenSource = new CancellationTokenSource();
|
CancellationTokenSource cancellationTokenSource = new CancellationTokenSource();
|
||||||
Action<int> _handler;
|
Action<int> _handler;
|
||||||
|
|
||||||
|
static int retry = 0;
|
||||||
|
|
||||||
public KeyboardListener(Action<int> KeyHandler)
|
public KeyboardListener(Action<int> KeyHandler)
|
||||||
{
|
{
|
||||||
_handler = KeyHandler;
|
_handler = KeyHandler;
|
||||||
@@ -54,6 +56,7 @@ namespace GHelper.Input
|
|||||||
input.ReadTimeout = int.MaxValue;
|
input.ReadTimeout = int.MaxValue;
|
||||||
|
|
||||||
var data = input.Read();
|
var data = input.Read();
|
||||||
|
if (cancellationTokenSource.Token.IsCancellationRequested) break;
|
||||||
if (data.Length > 1 && data[0] == AsusHid.INPUT_ID && data[1] > 0 && data[1] != 236)
|
if (data.Length > 1 && data[0] == AsusHid.INPUT_ID && data[1] > 0 && data[1] != 236)
|
||||||
{
|
{
|
||||||
Logger.WriteLine($"Key: {data[1]}");
|
Logger.WriteLine($"Key: {data[1]}");
|
||||||
@@ -67,6 +70,12 @@ namespace GHelper.Input
|
|||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
Logger.WriteLine($"Listener exited: {ex.Message}");
|
Logger.WriteLine($"Listener exited: {ex.Message}");
|
||||||
|
if (retry++ < 2)
|
||||||
|
{
|
||||||
|
Thread.Sleep(300);
|
||||||
|
Logger.WriteLine($"Restarting listener {retry}");
|
||||||
|
Listen();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ namespace GHelper
|
|||||||
{
|
{
|
||||||
AppConfig.Set("matrix_contrast", trackContrast.Value);
|
AppConfig.Set("matrix_contrast", trackContrast.Value);
|
||||||
AppConfig.Set("matrix_gamma", trackGamma.Value);
|
AppConfig.Set("matrix_gamma", trackGamma.Value);
|
||||||
SetMatrixPicture();
|
SetMatrixPicture(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -110,30 +110,24 @@ namespace GHelper.Mode
|
|||||||
|
|
||||||
if (notify) Toast();
|
if (notify) Toast();
|
||||||
|
|
||||||
// Power plan from config or defaulting to balanced
|
if (!AppConfig.Is("skip_powermode"))
|
||||||
if (AppConfig.GetModeString("scheme") is not null)
|
{
|
||||||
PowerNative.SetPowerPlan(AppConfig.GetModeString("scheme"));
|
// Power plan from config or defaulting to balanced
|
||||||
else
|
if (AppConfig.GetModeString("scheme") is not null)
|
||||||
PowerNative.SetBalancedPowerPlan();
|
PowerNative.SetPowerPlan(AppConfig.GetModeString("scheme"));
|
||||||
|
else
|
||||||
|
PowerNative.SetBalancedPowerPlan();
|
||||||
|
|
||||||
// Windows power mode
|
// Windows power mode
|
||||||
if (AppConfig.GetModeString("powermode") is not null)
|
if (AppConfig.GetModeString("powermode") is not null)
|
||||||
PowerNative.SetPowerMode(AppConfig.GetModeString("powermode"));
|
PowerNative.SetPowerMode(AppConfig.GetModeString("powermode"));
|
||||||
else
|
else
|
||||||
PowerNative.SetPowerMode(Modes.GetBase(mode));
|
PowerNative.SetPowerMode(Modes.GetBase(mode));
|
||||||
|
}
|
||||||
|
|
||||||
// CPU Boost setting override
|
// CPU Boost setting override
|
||||||
if (AppConfig.GetMode("auto_boost") != -1)
|
if (AppConfig.GetMode("auto_boost") != -1)
|
||||||
PowerNative.SetCPUBoost(AppConfig.GetMode("auto_boost"));
|
PowerNative.SetCPUBoost(AppConfig.GetMode("auto_boost"));
|
||||||
|
|
||||||
//BatteryControl.SetBatteryChargeLimit();
|
|
||||||
|
|
||||||
/*
|
|
||||||
if (NativeMethods.PowerGetEffectiveOverlayScheme(out Guid activeScheme) == 0)
|
|
||||||
{
|
|
||||||
Debug.WriteLine("Effective :" + activeScheme);
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
settings.FansInit();
|
settings.FansInit();
|
||||||
}
|
}
|
||||||
@@ -162,7 +156,8 @@ namespace GHelper.Mode
|
|||||||
modeToggleTimer.Start();
|
modeToggleTimer.Start();
|
||||||
Modes.SetCurrent(Modes.GetNext(back));
|
Modes.SetCurrent(Modes.GetNext(back));
|
||||||
Toast();
|
Toast();
|
||||||
} else
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
SetPerformanceMode(Modes.GetNext(back), true);
|
SetPerformanceMode(Modes.GetNext(back), true);
|
||||||
}
|
}
|
||||||
@@ -270,9 +265,6 @@ namespace GHelper.Mode
|
|||||||
var stapmResult = SendCommand.set_stapm_limit((uint)limit_total * 1000);
|
var stapmResult = SendCommand.set_stapm_limit((uint)limit_total * 1000);
|
||||||
if (init) Logger.WriteLine($"STAPM: {limit_total} {stapmResult}");
|
if (init) Logger.WriteLine($"STAPM: {limit_total} {stapmResult}");
|
||||||
|
|
||||||
var stapmResult2 = SendCommand.set_stapm2_limit((uint)limit_total * 1000);
|
|
||||||
if (init) Logger.WriteLine($"STAPM2: {limit_total} {stapmResult2}");
|
|
||||||
|
|
||||||
var slowResult = SendCommand.set_slow_limit((uint)limit_slow * 1000);
|
var slowResult = SendCommand.set_slow_limit((uint)limit_slow * 1000);
|
||||||
if (init) Logger.WriteLine($"SLOW: {limit_slow} {slowResult}");
|
if (init) Logger.WriteLine($"SLOW: {limit_slow} {slowResult}");
|
||||||
|
|
||||||
@@ -388,7 +380,7 @@ namespace GHelper.Mode
|
|||||||
if (gpu_power >= AsusACPI.MinGPUPower && gpu_power <= AsusACPI.MaxGPUPower && Program.acpi.DeviceGet(AsusACPI.GPU_POWER) >= 0)
|
if (gpu_power >= AsusACPI.MinGPUPower && gpu_power <= AsusACPI.MaxGPUPower && Program.acpi.DeviceGet(AsusACPI.GPU_POWER) >= 0)
|
||||||
Program.acpi.DeviceSet(AsusACPI.GPU_POWER, gpu_power, "PowerLimit TGP (GPU VAR)");
|
Program.acpi.DeviceSet(AsusACPI.GPU_POWER, gpu_power, "PowerLimit TGP (GPU VAR)");
|
||||||
|
|
||||||
if (gpu_boost >= AsusACPI.MinGPUBoost && gpu_boost <= AsusACPI.MaxGPUBoost && Program.acpi.DeviceGet(AsusACPI.PPT_GPUC0) >= 0)
|
if (gpu_boost >= AsusACPI.MinGPUBoost && gpu_boost <= AsusACPI.MaxGPUBoost && Program.acpi.DeviceGet(AsusACPI.PPT_GPUC0) >= 0)
|
||||||
boostResult = Program.acpi.DeviceSet(AsusACPI.PPT_GPUC0, gpu_boost, "PowerLimit C0 (GPU BOOST)");
|
boostResult = Program.acpi.DeviceSet(AsusACPI.PPT_GPUC0, gpu_boost, "PowerLimit C0 (GPU BOOST)");
|
||||||
|
|
||||||
if (gpu_temp >= AsusACPI.MinGPUTemp && gpu_temp <= AsusACPI.MaxGPUTemp && Program.acpi.DeviceGet(AsusACPI.PPT_GPUC2) >= 0)
|
if (gpu_temp >= AsusACPI.MinGPUTemp && gpu_temp <= AsusACPI.MaxGPUTemp && Program.acpi.DeviceGet(AsusACPI.PPT_GPUC2) >= 0)
|
||||||
|
|||||||
@@ -175,6 +175,7 @@ namespace GHelper.Mode
|
|||||||
|
|
||||||
if (activeSchemeGuid.ToString() != balanced && !AppConfig.Is("skip_power_plan"))
|
if (activeSchemeGuid.ToString() != balanced && !AppConfig.Is("skip_power_plan"))
|
||||||
{
|
{
|
||||||
|
Logger.WriteLine($"Changing power plan from {activeSchemeGuid.ToString()} to Balanced");
|
||||||
SetPowerPlan(balanced);
|
SetPowerPlan(balanced);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -481,9 +481,8 @@ namespace GHelper.Peripherals.Mouse
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
HidSharp.DeviceList.Local.GetHidDevices(VendorID(), ProductID())
|
return HidSharp.DeviceList.Local.GetHidDevices(VendorID(), ProductID())
|
||||||
.First(x => x.DevicePath.Contains(path));
|
.FirstOrDefault(x => x.DevicePath.Contains(path)) != null;
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -86,7 +86,7 @@
|
|||||||
|
|
||||||
public override int DPIIncrements()
|
public override int DPIIncrements()
|
||||||
{
|
{
|
||||||
return 100;
|
return 50;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ using GHelper.Helpers;
|
|||||||
using GHelper.Input;
|
using GHelper.Input;
|
||||||
using GHelper.Mode;
|
using GHelper.Mode;
|
||||||
using GHelper.Peripherals;
|
using GHelper.Peripherals;
|
||||||
|
using GHelper.USB;
|
||||||
using Microsoft.Win32;
|
using Microsoft.Win32;
|
||||||
using Ryzen;
|
using Ryzen;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
@@ -172,6 +173,7 @@ namespace GHelper
|
|||||||
{
|
{
|
||||||
gpuControl.StandardModeFix();
|
gpuControl.StandardModeFix();
|
||||||
BatteryControl.AutoBattery();
|
BatteryControl.AutoBattery();
|
||||||
|
InputDispatcher.ShutdownStatusLed();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void SystemEvents_SessionSwitch(object sender, SessionSwitchEventArgs e)
|
private static void SystemEvents_SessionSwitch(object sender, SessionSwitchEventArgs e)
|
||||||
@@ -231,7 +233,10 @@ namespace GHelper
|
|||||||
Logger.WriteLine("AutoSetting for " + isPlugged.ToString());
|
Logger.WriteLine("AutoSetting for " + isPlugged.ToString());
|
||||||
|
|
||||||
BatteryControl.AutoBattery(init);
|
BatteryControl.AutoBattery(init);
|
||||||
if (init) screenControl.InitMiniled();
|
if (init)
|
||||||
|
{
|
||||||
|
InputDispatcher.InitScreenpad();
|
||||||
|
}
|
||||||
|
|
||||||
inputDispatcher.Init();
|
inputDispatcher.Init();
|
||||||
|
|
||||||
@@ -253,9 +258,12 @@ namespace GHelper
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
settingsForm.AutoKeyboard();
|
InputDispatcher.AutoKeyboard();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
screenControl.InitMiniled();
|
||||||
|
InputDispatcher.InitStatusLed();
|
||||||
|
XGM.InitLight();
|
||||||
VisualControl.InitBrightness();
|
VisualControl.InitBrightness();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@@ -268,6 +276,7 @@ namespace GHelper
|
|||||||
{
|
{
|
||||||
Logger.WriteLine("Power Mode Changed:" + e.Mode.ToString());
|
Logger.WriteLine("Power Mode Changed:" + e.Mode.ToString());
|
||||||
gpuControl.StandardModeFix();
|
gpuControl.StandardModeFix();
|
||||||
|
InputDispatcher.ShutdownStatusLed();
|
||||||
}
|
}
|
||||||
|
|
||||||
int delay = AppConfig.Get("charger_delay");
|
int delay = AppConfig.Get("charger_delay");
|
||||||
@@ -278,6 +287,7 @@ namespace GHelper
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (SystemInformation.PowerStatus.PowerLineStatus == isPlugged) return;
|
if (SystemInformation.PowerStatus.PowerLineStatus == isPlugged) return;
|
||||||
|
if (AppConfig.Is("disable_power_event")) return;
|
||||||
SetAutoModes(true);
|
SetAutoModes(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -151,7 +151,7 @@
|
|||||||
<value>Animationsgeschwindigkeit</value>
|
<value>Animationsgeschwindigkeit</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="AnimeMatrix" xml:space="preserve">
|
<data name="AnimeMatrix" xml:space="preserve">
|
||||||
<value>AniMeMatrix</value>
|
<value>AniMe Matrix</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="AppAlreadyRunning" xml:space="preserve">
|
<data name="AppAlreadyRunning" xml:space="preserve">
|
||||||
<value>Die Anwendung läuft bereits</value>
|
<value>Die Anwendung läuft bereits</value>
|
||||||
|
|||||||
@@ -250,13 +250,13 @@
|
|||||||
<value>Pabudęs</value>
|
<value>Pabudęs</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="BacklightLow" xml:space="preserve">
|
<data name="BacklightLow" xml:space="preserve">
|
||||||
<value>Low</value>
|
<value>Žem.</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="BacklightMax" xml:space="preserve">
|
<data name="BacklightMax" xml:space="preserve">
|
||||||
<value>Max</value>
|
<value>Maks.</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="BacklightMid" xml:space="preserve">
|
<data name="BacklightMid" xml:space="preserve">
|
||||||
<value>Mid</value>
|
<value>Vid.</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="BacklightOff" xml:space="preserve">
|
<data name="BacklightOff" xml:space="preserve">
|
||||||
<value>Išjungta</value>
|
<value>Išjungta</value>
|
||||||
@@ -265,10 +265,10 @@
|
|||||||
<value>Laiko riba su lizdu / akumuliatoriumi (0 – ĮJUNGTA)</value>
|
<value>Laiko riba su lizdu / akumuliatoriumi (0 – ĮJUNGTA)</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="BacklightTimeoutBattery" xml:space="preserve">
|
<data name="BacklightTimeoutBattery" xml:space="preserve">
|
||||||
<value>Backlight Timeout when on battery</value>
|
<value>Foninio apšvietimo laikas akumuliatoriaus režimu</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="BacklightTimeoutPlugged" xml:space="preserve">
|
<data name="BacklightTimeoutPlugged" xml:space="preserve">
|
||||||
<value>Backlight Timeout when plugged</value>
|
<value>Foninio apšvietimo laikas įkraunant</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Balanced" xml:space="preserve">
|
<data name="Balanced" xml:space="preserve">
|
||||||
<value>Balansuotas</value>
|
<value>Balansuotas</value>
|
||||||
@@ -519,7 +519,7 @@ Vis tiek norite tęsti?</value>
|
|||||||
<value>Kairiojo jungiklio nejautrumo zonos</value>
|
<value>Kairiojo jungiklio nejautrumo zonos</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="LTDeadzones" xml:space="preserve">
|
<data name="LTDeadzones" xml:space="preserve">
|
||||||
<value>Left Trigger Deadzones</value>
|
<value>Kairiojo jungiklio nejautrumo zonos</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="MatrixAudio" xml:space="preserve">
|
<data name="MatrixAudio" xml:space="preserve">
|
||||||
<value>Garso vizualizatorius</value>
|
<value>Garso vizualizatorius</value>
|
||||||
@@ -585,13 +585,13 @@ Vis tiek norite tęsti?</value>
|
|||||||
<value>Sinchronizuoti su pele</value>
|
<value>Sinchronizuoti su pele</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Multizone" xml:space="preserve">
|
<data name="Multizone" xml:space="preserve">
|
||||||
<value>Multi Zone</value>
|
<value>Kelios zonos</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="MultizoneStrong" xml:space="preserve">
|
<data name="MultizoneStrong" xml:space="preserve">
|
||||||
<value>Multi Zone Strong</value>
|
<value>Kelių zonų stiprumas</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Muted" xml:space="preserve">
|
<data name="Muted" xml:space="preserve">
|
||||||
<value>Muted</value>
|
<value>Išjungta</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="MuteMic" xml:space="preserve">
|
<data name="MuteMic" xml:space="preserve">
|
||||||
<value>Mikrofono nutildymas</value>
|
<value>Mikrofono nutildymas</value>
|
||||||
@@ -615,7 +615,7 @@ Vis tiek norite tęsti?</value>
|
|||||||
<value>Įjungta</value>
|
<value>Įjungta</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="OneZone" xml:space="preserve">
|
<data name="OneZone" xml:space="preserve">
|
||||||
<value>One Zone</value>
|
<value>Viena zona</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="OpenGHelper" xml:space="preserve">
|
<data name="OpenGHelper" xml:space="preserve">
|
||||||
<value>Atidaryti G-Helper langą</value>
|
<value>Atidaryti G-Helper langą</value>
|
||||||
@@ -675,16 +675,16 @@ Vis tiek norite tęsti?</value>
|
|||||||
<value>RPM</value>
|
<value>RPM</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="RSDeadzones" xml:space="preserve">
|
<data name="RSDeadzones" xml:space="preserve">
|
||||||
<value>Right Stick Deadzones</value>
|
<value>Dešiniojo jungiklio nejautrumo zonos</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="RTDeadzones" xml:space="preserve">
|
<data name="RTDeadzones" xml:space="preserve">
|
||||||
<value>Right Trigger Deadzones</value>
|
<value>Dešiniojo jungiklio nejautrumo zonos</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="RunOnStartup" xml:space="preserve">
|
<data name="RunOnStartup" xml:space="preserve">
|
||||||
<value>Paleisti įjungus sistemą</value>
|
<value>Paleisti įjungus sistemą</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="ScalingQuality" xml:space="preserve">
|
<data name="ScalingQuality" xml:space="preserve">
|
||||||
<value>Scaling Quality</value>
|
<value>Mastelio kokybė</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="ScreenPadDown" xml:space="preserve">
|
<data name="ScreenPadDown" xml:space="preserve">
|
||||||
<value>Ekrano skydelio ryškumo mažinimas</value>
|
<value>Ekrano skydelio ryškumo mažinimas</value>
|
||||||
@@ -741,10 +741,10 @@ Vis tiek norite tęsti?</value>
|
|||||||
<value>Perjungti ekraną</value>
|
<value>Perjungti ekraną</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="ToggleTouchscreen" xml:space="preserve">
|
<data name="ToggleTouchscreen" xml:space="preserve">
|
||||||
<value>Toggle Touchscreen</value>
|
<value>Valdyti jutiklinį ekraną</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Touchscreen" xml:space="preserve">
|
<data name="Touchscreen" xml:space="preserve">
|
||||||
<value>Touchscreen</value>
|
<value>Jutiklinis ekranas</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Turbo" xml:space="preserve">
|
<data name="Turbo" xml:space="preserve">
|
||||||
<value>Turbo</value>
|
<value>Turbo</value>
|
||||||
@@ -765,7 +765,7 @@ Vis tiek norite tęsti?</value>
|
|||||||
<value>Įtampos mažinimas yra eksperimentinė ir pavojinga funkcija. Jei pritaikytos reikšmės yra per mažos jūsų aparatinei įrangai, ji gali tapti nestabili, išsijungti arba pažeisti duomenų vientisumą. Jei norite pabandyti, iš pirmo pradėkite nuo mažų reikšmių, spustelėkite „Taikyti“ ir išbandykite, kas jums tinka.</value>
|
<value>Įtampos mažinimas yra eksperimentinė ir pavojinga funkcija. Jei pritaikytos reikšmės yra per mažos jūsų aparatinei įrangai, ji gali tapti nestabili, išsijungti arba pažeisti duomenų vientisumą. Jei norite pabandyti, iš pirmo pradėkite nuo mažų reikšmių, spustelėkite „Taikyti“ ir išbandykite, kas jums tinka.</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Unmuted" xml:space="preserve">
|
<data name="Unmuted" xml:space="preserve">
|
||||||
<value>Unmuted</value>
|
<value>Įjungta</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Updates" xml:space="preserve">
|
<data name="Updates" xml:space="preserve">
|
||||||
<value>Naujinimai</value>
|
<value>Naujinimai</value>
|
||||||
@@ -798,24 +798,24 @@ Vis tiek norite tęsti?</value>
|
|||||||
<value>Visada rodyti programėlės langą viršuje</value>
|
<value>Visada rodyti programėlės langą viršuje</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Zoom" xml:space="preserve">
|
<data name="Zoom" xml:space="preserve">
|
||||||
<value>Zoom</value>
|
<value>Mastelis</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Donate" xml:space="preserve">
|
<data name="Donate" xml:space="preserve">
|
||||||
<value>Donate</value>
|
<value>Paremti</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Legend" xml:space="preserve">
|
<data name="Legend" xml:space="preserve">
|
||||||
<value>Legend</value>
|
<value>Legenda</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="LegendGray" xml:space="preserve">
|
<data name="LegendGray" xml:space="preserve">
|
||||||
<value>Can't check local version</value>
|
<value>Nepavyko patikrinti vietinės versijos</value>
|
||||||
<comment>Can't check local version</comment>
|
<comment>Can't check local version</comment>
|
||||||
</data>
|
</data>
|
||||||
<data name="LegendRed" xml:space="preserve">
|
<data name="LegendRed" xml:space="preserve">
|
||||||
<value>Update Available</value>
|
<value>Išleista nauja versija</value>
|
||||||
<comment>Update Available</comment>
|
<comment>Update Available</comment>
|
||||||
</data>
|
</data>
|
||||||
<data name="LegendGreen" xml:space="preserve">
|
<data name="LegendGreen" xml:space="preserve">
|
||||||
<value>Updated</value>
|
<value>Atnaujinta</value>
|
||||||
<comment>Updated</comment>
|
<comment>Updated</comment>
|
||||||
</data>
|
</data>
|
||||||
</root>
|
</root>
|
||||||
@@ -157,7 +157,7 @@
|
|||||||
<value>程式正在執行</value>
|
<value>程式正在執行</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="AppAlreadyRunningText" xml:space="preserve">
|
<data name="AppAlreadyRunningText" xml:space="preserve">
|
||||||
<value>G-Helper正在執行。 請檢查右下系統匣。</value>
|
<value>G-Helper 正在執行。 請檢查右下系統匣。</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Apply" xml:space="preserve">
|
<data name="Apply" xml:space="preserve">
|
||||||
<value>套用</value>
|
<value>套用</value>
|
||||||
@@ -169,10 +169,10 @@
|
|||||||
<value>套用功率限制</value>
|
<value>套用功率限制</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="ApplyWindowsPowerPlan" xml:space="preserve">
|
<data name="ApplyWindowsPowerPlan" xml:space="preserve">
|
||||||
<value>自動調整Windows電源模式</value>
|
<value>自動調整 Windows 電源模式</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="APUMemory" xml:space="preserve">
|
<data name="APUMemory" xml:space="preserve">
|
||||||
<value>分配給GPU的記憶體</value>
|
<value>分配給 GPU 的記憶體</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="AsusServicesRunning" xml:space="preserve">
|
<data name="AsusServicesRunning" xml:space="preserve">
|
||||||
<value>執行中的華碩服務</value>
|
<value>執行中的華碩服務</value>
|
||||||
@@ -295,7 +295,7 @@
|
|||||||
<value>次要</value>
|
<value>次要</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="BiosAndDriverUpdates" xml:space="preserve">
|
<data name="BiosAndDriverUpdates" xml:space="preserve">
|
||||||
<value>BIOS與驅動程式更新</value>
|
<value>BIOS 與驅動程式更新</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Boot" xml:space="preserve">
|
<data name="Boot" xml:space="preserve">
|
||||||
<value>開機時</value>
|
<value>開機時</value>
|
||||||
|
|||||||
@@ -40,7 +40,8 @@ namespace Ryzen
|
|||||||
//PHEONIX - 9
|
//PHEONIX - 9
|
||||||
//RAPHAEL/DRAGON RANGE - 10
|
//RAPHAEL/DRAGON RANGE - 10
|
||||||
//MENDOCINO - 11
|
//MENDOCINO - 11
|
||||||
//HAWKPOINT/STRIXPOINT - 12
|
//HAWKPOINT - 12
|
||||||
|
//STRIXPOINT - 13
|
||||||
|
|
||||||
public static void Init()
|
public static void Init()
|
||||||
{
|
{
|
||||||
@@ -129,7 +130,7 @@ namespace Ryzen
|
|||||||
|
|
||||||
if (CPUModel.Contains("Family " + Convert.ToString(26)) && CPUModel.Contains("Model " + Convert.ToString(36)))
|
if (CPUModel.Contains("Family " + Convert.ToString(26)) && CPUModel.Contains("Model " + Convert.ToString(36)))
|
||||||
{
|
{
|
||||||
FAMID = 12; //STRIXPOINT
|
FAMID = 13; //STRIXPOINT
|
||||||
}
|
}
|
||||||
|
|
||||||
Logger.WriteLine($"CPU: {FAMID} - {CPUName} - {CPUModel}");
|
Logger.WriteLine($"CPU: {FAMID} - {CPUName} - {CPUModel}");
|
||||||
@@ -243,6 +244,16 @@ namespace Ryzen
|
|||||||
Smu.PSMU_ADDR_RSP = 0x3B10a80;
|
Smu.PSMU_ADDR_RSP = 0x3B10a80;
|
||||||
Smu.PSMU_ADDR_ARG = 0x3B10a88;
|
Smu.PSMU_ADDR_ARG = 0x3B10a88;
|
||||||
}
|
}
|
||||||
|
else if (FAMID == 13)
|
||||||
|
{
|
||||||
|
Smu.MP1_ADDR_MSG = 0x3B10928;
|
||||||
|
Smu.MP1_ADDR_RSP = 0x3B10978;
|
||||||
|
Smu.MP1_ADDR_ARG = 0x3B10998;
|
||||||
|
|
||||||
|
Smu.PSMU_ADDR_MSG = 0x3B10a20;
|
||||||
|
Smu.PSMU_ADDR_RSP = 0x3B10a80;
|
||||||
|
Smu.PSMU_ADDR_ARG = 0x3B10a88;
|
||||||
|
}
|
||||||
else if (FAMID == 4 || FAMID == 6)
|
else if (FAMID == 4 || FAMID == 6)
|
||||||
{
|
{
|
||||||
Smu.MP1_ADDR_MSG = 0x3B10530;
|
Smu.MP1_ADDR_MSG = 0x3B10530;
|
||||||
|
|||||||
@@ -21,7 +21,8 @@ namespace Ryzen
|
|||||||
//PHEONIX - 9
|
//PHEONIX - 9
|
||||||
//RAPHAEL/DRAGON RANGE - 10
|
//RAPHAEL/DRAGON RANGE - 10
|
||||||
//MENDOCINO - 11
|
//MENDOCINO - 11
|
||||||
//HAWKPOINT/STRIXPOINT - 12
|
//HAWKPOINT - 12
|
||||||
|
//STRIXPOINT - 13
|
||||||
|
|
||||||
public static Smu RyzenAccess = new Smu(false);
|
public static Smu RyzenAccess = new Smu(false);
|
||||||
public static int FAMID = RyzenControl.FAMID;
|
public static int FAMID = RyzenControl.FAMID;
|
||||||
@@ -49,7 +50,8 @@ namespace Ryzen
|
|||||||
case 9:
|
case 9:
|
||||||
case 11:
|
case 11:
|
||||||
case 12:
|
case 12:
|
||||||
RyzenAccess.SendMp1(0x14, ref Args);
|
case 13:
|
||||||
|
result = RyzenAccess.SendMp1(0x14, ref Args);
|
||||||
result = RyzenAccess.SendPsmu(0x31, ref Args);
|
result = RyzenAccess.SendPsmu(0x31, ref Args);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@@ -61,32 +63,6 @@ namespace Ryzen
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//STAMP2 Limit
|
|
||||||
public static Smu.Status? set_stapm2_limit(uint value)
|
|
||||||
{
|
|
||||||
RyzenAccess.Initialize();
|
|
||||||
uint[] Args = new uint[6];
|
|
||||||
Args[0] = value;
|
|
||||||
Smu.Status? result = null;
|
|
||||||
|
|
||||||
switch (FAMID)
|
|
||||||
{
|
|
||||||
case 3:
|
|
||||||
case 5:
|
|
||||||
case 7:
|
|
||||||
case 8:
|
|
||||||
case 9:
|
|
||||||
case 11:
|
|
||||||
case 12:
|
|
||||||
result = RyzenAccess.SendPsmu(0x31, ref Args);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
RyzenAccess.Deinitialize();
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
//Fast Limit
|
//Fast Limit
|
||||||
public static Smu.Status? set_fast_limit(uint value)
|
public static Smu.Status? set_fast_limit(uint value)
|
||||||
{
|
{
|
||||||
@@ -109,7 +85,9 @@ namespace Ryzen
|
|||||||
case 9:
|
case 9:
|
||||||
case 11:
|
case 11:
|
||||||
case 12:
|
case 12:
|
||||||
|
case 13:
|
||||||
result = RyzenAccess.SendMp1(0x15, ref Args);
|
result = RyzenAccess.SendMp1(0x15, ref Args);
|
||||||
|
result = RyzenAccess.SendPsmu(0x32, ref Args);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@@ -140,7 +118,10 @@ namespace Ryzen
|
|||||||
case 9:
|
case 9:
|
||||||
case 11:
|
case 11:
|
||||||
case 12:
|
case 12:
|
||||||
|
case 13:
|
||||||
result = RyzenAccess.SendMp1(0x16, ref Args);
|
result = RyzenAccess.SendMp1(0x16, ref Args);
|
||||||
|
result = RyzenAccess.SendPsmu(0x33, ref Args);
|
||||||
|
result = RyzenAccess.SendPsmu(0x34, ref Args);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@@ -176,11 +157,12 @@ namespace Ryzen
|
|||||||
case 9:
|
case 9:
|
||||||
case 11:
|
case 11:
|
||||||
case 12:
|
case 12:
|
||||||
|
case 13:
|
||||||
result = RyzenAccess.SendMp1(0x19, ref Args);
|
result = RyzenAccess.SendMp1(0x19, ref Args);
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
case 6:
|
case 6:
|
||||||
RyzenAccess.SendMp1(0x23, ref Args);
|
result = RyzenAccess.SendMp1(0x23, ref Args);
|
||||||
result = RyzenAccess.SendPsmu(0x56, ref Args);
|
result = RyzenAccess.SendPsmu(0x56, ref Args);
|
||||||
break;
|
break;
|
||||||
case 10:
|
case 10:
|
||||||
@@ -194,37 +176,6 @@ namespace Ryzen
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Skin Temp limit
|
|
||||||
public static Smu.Status? set_apu_skin_temp_limit(uint value)
|
|
||||||
{
|
|
||||||
RyzenAccess.Initialize();
|
|
||||||
uint[] Args = new uint[6];
|
|
||||||
Args[0] = value;
|
|
||||||
|
|
||||||
Smu.Status? result = null;
|
|
||||||
|
|
||||||
switch (FAMID)
|
|
||||||
{
|
|
||||||
case 5:
|
|
||||||
case 8:
|
|
||||||
case 9:
|
|
||||||
case 11:
|
|
||||||
case 12:
|
|
||||||
result = RyzenAccess.SendMp1(0x33, ref Args);
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
case 7:
|
|
||||||
result = RyzenAccess.SendMp1(0x38, ref Args);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
RyzenAccess.Deinitialize();
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
//Set All Core Curve Optimiser
|
//Set All Core Curve Optimiser
|
||||||
public static Smu.Status? set_coall(int value)
|
public static Smu.Status? set_coall(int value)
|
||||||
{
|
{
|
||||||
@@ -241,12 +192,12 @@ namespace Ryzen
|
|||||||
{
|
{
|
||||||
case 3:
|
case 3:
|
||||||
case 7:
|
case 7:
|
||||||
RyzenAccess.SendMp1(0x55, ref Args);
|
result = RyzenAccess.SendMp1(0x55, ref Args);
|
||||||
result = RyzenAccess.SendPsmu(0xB1, ref Args);
|
result = RyzenAccess.SendPsmu(0xB1, ref Args);
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
case 6:
|
case 6:
|
||||||
RyzenAccess.SendMp1(0x36, ref Args);
|
result = RyzenAccess.SendMp1(0x36, ref Args);
|
||||||
result = RyzenAccess.SendPsmu(0xB, ref Args);
|
result = RyzenAccess.SendPsmu(0xB, ref Args);
|
||||||
break;
|
break;
|
||||||
case 5:
|
case 5:
|
||||||
@@ -254,6 +205,7 @@ namespace Ryzen
|
|||||||
case 9:
|
case 9:
|
||||||
case 11:
|
case 11:
|
||||||
case 12:
|
case 12:
|
||||||
|
case 13:
|
||||||
result = RyzenAccess.SendPsmu(0x5D, ref Args);
|
result = RyzenAccess.SendPsmu(0x5D, ref Args);
|
||||||
break;
|
break;
|
||||||
case 10:
|
case 10:
|
||||||
@@ -285,7 +237,7 @@ namespace Ryzen
|
|||||||
{
|
{
|
||||||
case 3:
|
case 3:
|
||||||
case 7:
|
case 7:
|
||||||
RyzenAccess.SendMp1(0x64, ref Args);
|
result = RyzenAccess.SendMp1(0x64, ref Args);
|
||||||
result = RyzenAccess.SendPsmu(0x57, ref Args);
|
result = RyzenAccess.SendPsmu(0x57, ref Args);
|
||||||
break;
|
break;
|
||||||
case 5:
|
case 5:
|
||||||
@@ -293,6 +245,7 @@ namespace Ryzen
|
|||||||
case 9:
|
case 9:
|
||||||
case 11:
|
case 11:
|
||||||
case 12:
|
case 12:
|
||||||
|
case 13:
|
||||||
result = RyzenAccess.SendPsmu(0xb7, ref Args);
|
result = RyzenAccess.SendPsmu(0xb7, ref Args);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|||||||
@@ -235,6 +235,7 @@ namespace GHelper
|
|||||||
|
|
||||||
labelCharge.MouseEnter += PanelBattery_MouseEnter;
|
labelCharge.MouseEnter += PanelBattery_MouseEnter;
|
||||||
labelCharge.MouseLeave += PanelBattery_MouseLeave;
|
labelCharge.MouseLeave += PanelBattery_MouseLeave;
|
||||||
|
labelBattery.Click += LabelBattery_Click;
|
||||||
|
|
||||||
buttonPeripheral1.Click += ButtonPeripheral_Click;
|
buttonPeripheral1.Click += ButtonPeripheral_Click;
|
||||||
buttonPeripheral2.Click += ButtonPeripheral_Click;
|
buttonPeripheral2.Click += ButtonPeripheral_Click;
|
||||||
@@ -271,8 +272,9 @@ namespace GHelper
|
|||||||
labelCharge.Click += LabelCharge_Click;
|
labelCharge.Click += LabelCharge_Click;
|
||||||
|
|
||||||
buttonDonate.Click += ButtonDonate_Click;
|
buttonDonate.Click += ButtonDonate_Click;
|
||||||
|
|
||||||
if (AppConfig.Get("start_count") > 10 && !AppConfig.Is("donate_click"))
|
int click = AppConfig.Get("donate_click");
|
||||||
|
if (AppConfig.Get("start_count") >= ((click < 10) ? 10 : click + 50))
|
||||||
{
|
{
|
||||||
buttonDonate.BorderColor = colorTurbo;
|
buttonDonate.BorderColor = colorTurbo;
|
||||||
buttonDonate.Badge = true;
|
buttonDonate.Badge = true;
|
||||||
@@ -284,11 +286,17 @@ namespace GHelper
|
|||||||
InitVisual();
|
InitVisual();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void LabelBattery_Click(object? sender, EventArgs e)
|
||||||
|
{
|
||||||
|
HardwareControl.chargeWatt = !HardwareControl.chargeWatt;
|
||||||
|
RefreshSensors(true);
|
||||||
|
}
|
||||||
|
|
||||||
private void ButtonDonate_Click(object? sender, EventArgs e)
|
private void ButtonDonate_Click(object? sender, EventArgs e)
|
||||||
{
|
{
|
||||||
AppConfig.Set("donate_click", 1);
|
AppConfig.Set("donate_click", AppConfig.Get("start_count"));
|
||||||
buttonDonate.Badge = false;
|
buttonDonate.Badge = false;
|
||||||
Process.Start(new ProcessStartInfo("https://github.com/seerge/g-helper/wiki/Support-Project") { UseShellExecute = true });
|
Process.Start(new ProcessStartInfo("https://g-helper.com/support") { UseShellExecute = true });
|
||||||
}
|
}
|
||||||
|
|
||||||
private void LabelDynamicLighting_Click(object? sender, EventArgs e)
|
private void LabelDynamicLighting_Click(object? sender, EventArgs e)
|
||||||
@@ -667,14 +675,14 @@ namespace GHelper
|
|||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
Logger.WriteLine("Lid Closed");
|
Logger.WriteLine("Lid Closed");
|
||||||
|
InputDispatcher.lidClose = AniMatrixControl.lidClose = true;
|
||||||
Aura.ApplyBrightness(0, "Lid");
|
Aura.ApplyBrightness(0, "Lid");
|
||||||
AniMatrixControl.lidClose = true;
|
|
||||||
matrixControl.SetLidMode();
|
matrixControl.SetLidMode();
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
Logger.WriteLine("Lid Open");
|
Logger.WriteLine("Lid Open");
|
||||||
|
InputDispatcher.lidClose = AniMatrixControl.lidClose = false;
|
||||||
Aura.ApplyBrightness(InputDispatcher.GetBacklight(), "Lid");
|
Aura.ApplyBrightness(InputDispatcher.GetBacklight(), "Lid");
|
||||||
AniMatrixControl.lidClose = false;
|
|
||||||
matrixControl.SetLidMode();
|
matrixControl.SetLidMode();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -843,7 +851,7 @@ namespace GHelper
|
|||||||
|
|
||||||
private void Button60Hz_MouseHover(object? sender, EventArgs e)
|
private void Button60Hz_MouseHover(object? sender, EventArgs e)
|
||||||
{
|
{
|
||||||
labelTipScreen.Text = Properties.Strings.MinRefreshTooltip;
|
labelTipScreen.Text = Properties.Strings.MinRefreshTooltip.Replace("60", ScreenControl.MIN_RATE.ToString());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ButtonScreen_MouseLeave(object? sender, EventArgs e)
|
private void ButtonScreen_MouseLeave(object? sender, EventArgs e)
|
||||||
@@ -853,7 +861,7 @@ namespace GHelper
|
|||||||
|
|
||||||
private void ButtonScreenAuto_MouseHover(object? sender, EventArgs e)
|
private void ButtonScreenAuto_MouseHover(object? sender, EventArgs e)
|
||||||
{
|
{
|
||||||
labelTipScreen.Text = Properties.Strings.AutoRefreshTooltip;
|
labelTipScreen.Text = Properties.Strings.AutoRefreshTooltip.Replace("60", ScreenControl.MIN_RATE.ToString());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ButtonUltimate_MouseHover(object? sender, EventArgs e)
|
private void ButtonUltimate_MouseHover(object? sender, EventArgs e)
|
||||||
@@ -1208,7 +1216,7 @@ namespace GHelper
|
|||||||
private void Button60Hz_Click(object? sender, EventArgs e)
|
private void Button60Hz_Click(object? sender, EventArgs e)
|
||||||
{
|
{
|
||||||
AppConfig.Set("screen_auto", 0);
|
AppConfig.Set("screen_auto", 0);
|
||||||
screenControl.SetScreen(60, 0);
|
screenControl.SetScreen(ScreenControl.MIN_RATE, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1239,16 +1247,18 @@ namespace GHelper
|
|||||||
{
|
{
|
||||||
buttonScreenAuto.Activated = true;
|
buttonScreenAuto.Activated = true;
|
||||||
}
|
}
|
||||||
else if (frequency == 60)
|
else if (frequency == ScreenControl.MIN_RATE)
|
||||||
{
|
{
|
||||||
button60Hz.Activated = true;
|
button60Hz.Activated = true;
|
||||||
}
|
}
|
||||||
else if (frequency > 60)
|
else if (frequency > ScreenControl.MIN_RATE)
|
||||||
{
|
{
|
||||||
button120Hz.Activated = true;
|
button120Hz.Activated = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (maxFrequency > 60)
|
button60Hz.Text = ScreenControl.MIN_RATE + "Hz";
|
||||||
|
|
||||||
|
if (maxFrequency > ScreenControl.MIN_RATE)
|
||||||
{
|
{
|
||||||
button120Hz.Text = maxFrequency.ToString() + "Hz" + (overdriveSetting ? " + OD" : "");
|
button120Hz.Text = maxFrequency.ToString() + "Hz" + (overdriveSetting ? " + OD" : "");
|
||||||
panelScreen.Visible = true;
|
panelScreen.Visible = true;
|
||||||
@@ -1420,7 +1430,9 @@ namespace GHelper
|
|||||||
cpuTemp = ": " + Math.Round((decimal)HardwareControl.cpuTemp).ToString() + "°C";
|
cpuTemp = ": " + Math.Round((decimal)HardwareControl.cpuTemp).ToString() + "°C";
|
||||||
|
|
||||||
if (HardwareControl.batteryCapacity > 0)
|
if (HardwareControl.batteryCapacity > 0)
|
||||||
charge = Properties.Strings.BatteryCharge + ": " + Math.Round(HardwareControl.batteryCapacity, 1) + "% ";
|
{
|
||||||
|
charge = Properties.Strings.BatteryCharge + ": " + HardwareControl.batteryCharge;
|
||||||
|
}
|
||||||
|
|
||||||
if (HardwareControl.batteryRate < 0)
|
if (HardwareControl.batteryRate < 0)
|
||||||
battery = Properties.Strings.Discharging + ": " + Math.Round(-(decimal)HardwareControl.batteryRate, 1).ToString() + "W";
|
battery = Properties.Strings.Discharging + ": " + Math.Round(-(decimal)HardwareControl.batteryRate, 1).ToString() + "W";
|
||||||
@@ -1530,24 +1542,6 @@ namespace GHelper
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void AutoKeyboard()
|
|
||||||
{
|
|
||||||
|
|
||||||
InputDispatcher.SetBacklightAuto(true);
|
|
||||||
|
|
||||||
if (!AppConfig.Is("skip_aura"))
|
|
||||||
{
|
|
||||||
Aura.ApplyPower();
|
|
||||||
Aura.ApplyAura();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Program.acpi.IsXGConnected())
|
|
||||||
XGM.Light(AppConfig.Is("xmg_light"));
|
|
||||||
|
|
||||||
if (AppConfig.HasTabletMode()) InputDispatcher.TabletMode();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public void VisualizeXGM(int GPUMode = -1)
|
public void VisualizeXGM(int GPUMode = -1)
|
||||||
{
|
{
|
||||||
@@ -1775,7 +1769,7 @@ namespace GHelper
|
|||||||
|
|
||||||
public void VisualiseBatteryFull()
|
public void VisualiseBatteryFull()
|
||||||
{
|
{
|
||||||
if (AppConfig.Is("charge_full"))
|
if (BatteryControl.chargeFull)
|
||||||
{
|
{
|
||||||
buttonBatteryFull.BackColor = colorStandard;
|
buttonBatteryFull.BackColor = colorStandard;
|
||||||
buttonBatteryFull.ForeColor = SystemColors.ControlLightLight;
|
buttonBatteryFull.ForeColor = SystemColors.ControlLightLight;
|
||||||
|
|||||||
@@ -361,6 +361,11 @@ namespace GHelper.USB
|
|||||||
AsusHid.WriteInput(new byte[] { AsusHid.INPUT_ID, 0xD1, 0x09, 0x01, power }, "Aura");
|
AsusHid.WriteInput(new byte[] { AsusHid.INPUT_ID, 0xD1, 0x09, 0x01, power }, "Aura");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void ApplyPowerOff()
|
||||||
|
{
|
||||||
|
AsusHid.Write(AuraPowerMessage(new AuraPower()));
|
||||||
|
}
|
||||||
|
|
||||||
public static void ApplyPower()
|
public static void ApplyPower()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|||||||
@@ -52,6 +52,10 @@ namespace GHelper.USB
|
|||||||
Write(new byte[] { 0x5e, 0xc5, status ? (byte)0x50 : (byte)0 });
|
Write(new byte[] { 0x5e, 0xc5, status ? (byte)0x50 : (byte)0 });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void InitLight()
|
||||||
|
{
|
||||||
|
if (Program.acpi.IsXGConnected()) Light(AppConfig.Is("xmg_light"));
|
||||||
|
}
|
||||||
|
|
||||||
public static void Reset()
|
public static void Reset()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -226,13 +226,10 @@ namespace GHelper
|
|||||||
|
|
||||||
public void _VisualiseNewCount(int updatesCount, TableLayoutPanel table)
|
public void _VisualiseNewCount(int updatesCount, TableLayoutPanel table)
|
||||||
{
|
{
|
||||||
Invoke(delegate
|
labelUpdates.Text = $"{Properties.Strings.NewUpdates}: {updatesCount}";
|
||||||
{
|
labelUpdates.ForeColor = colorTurbo;
|
||||||
labelUpdates.Text = $"{Properties.Strings.NewUpdates}: {updatesCount}";
|
labelUpdates.Font = new Font(labelUpdates.Font, FontStyle.Bold);
|
||||||
labelUpdates.ForeColor = colorTurbo;
|
panelBios.AccessibleName = labelUpdates.Text;
|
||||||
labelUpdates.Font = new Font(labelUpdates.Font, FontStyle.Bold);
|
|
||||||
panelBios.AccessibleName = labelUpdates.Text;
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static string CleanupDeviceId(string input)
|
static string CleanupDeviceId(string input)
|
||||||
|
|||||||
@@ -3,11 +3,9 @@
|
|||||||
[](https://GitHub.com/seerge/g-helper/releases/)
|
[](https://GitHub.com/seerge/g-helper/releases/)
|
||||||
[](https://GitHub.com/seerge/g-helper/releases/) [](https://GitHub.com/seerge/g-helper/stargazers/) <sup>[中文版点这里](https://github.com/seerge/g-helper/blob/main/docs/README.zh-CN.md)</sup> <sup>[日本語はこちら](https://github.com/seerge/g-helper/blob/main/docs/README.ja-JP.md)</sup>
|
[](https://GitHub.com/seerge/g-helper/releases/) [](https://GitHub.com/seerge/g-helper/stargazers/) <sup>[中文版点这里](https://github.com/seerge/g-helper/blob/main/docs/README.zh-CN.md)</sup> <sup>[日本語はこちら](https://github.com/seerge/g-helper/blob/main/docs/README.ja-JP.md)</sup>
|
||||||
|
|
||||||
Small and lightweight Armoury Crate alternative for Asus laptops offering almost same functionality without extra load and unnecessary services.
|
Small and lightweight Armoury Crate alternative for Asus laptops offering almost same functionality with a much smaller footprint. Works with all popular models, such as ROG Zephyrus G14, G15, G16, M16, Flow X13, Flow X16, Flow Z13, DUO, TUF Series, Strix or Scar Series, ProArt, Vivobook, Zenbook, ROG Ally or Ally X and many more!
|
||||||
|
|
||||||
Works with all popular models, such as ROG Zephyrus G14, G15, G16, M16, Flow X13, Flow X16, Flow Z13, DUO, TUF Series, Strix or Scar Series, ProArt, Vivobook, Zenbook, ROG Ally or Ally X and many more!
|
# [:floppy_disk: Download](https://github.com/seerge/g-helper/releases/latest/download/GHelper.zip)
|
||||||
|
|
||||||
# [:floppy_disk:Download](https://github.com/seerge/g-helper/releases/latest/download/GHelper.zip)
|
|
||||||
**⭐ If you like the app - please spread the word about it online**
|
**⭐ If you like the app - please spread the word about it online**
|
||||||
|
|
||||||
<table>
|
<table>
|
||||||
|
|||||||
Reference in New Issue
Block a user