mirror of
https://github.com/jkocon/g-helper.git
synced 2026-02-23 13:00:52 +01:00
Compare commits
29 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
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 |
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
|
||||||
@@ -648,7 +648,7 @@ namespace GHelper.Ally
|
|||||||
if (init)
|
if (init)
|
||||||
{
|
{
|
||||||
WakeUp();
|
WakeUp();
|
||||||
InputDispatcher.SetBacklightAuto(true);
|
InputDispatcher.SetBacklightAuto();
|
||||||
}
|
}
|
||||||
|
|
||||||
AsusHid.WriteInput([AsusHid.INPUT_ID, 0xD1, 0x01, 0x01, (byte)_applyMode], "Controller");
|
AsusHid.WriteInput([AsusHid.INPUT_ID, 0xD1, 0x01, 0x01, (byte)_applyMode], "Controller");
|
||||||
|
|||||||
@@ -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())
|
||||||
|
|||||||
@@ -432,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");
|
||||||
@@ -648,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");
|
||||||
@@ -691,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") || ContainsModel("G834JZR") || 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");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|
||||||
|
|||||||
615
app/Extra.Designer.cs
generated
615
app/Extra.Designer.cs
generated
File diff suppressed because it is too large
Load Diff
@@ -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)
|
||||||
|
|||||||
@@ -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.198</AssemblyVersion>
|
<AssemblyVersion>0.199</AssemblyVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|
||||||
|
|||||||
@@ -285,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();
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ 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)AppConfig.Get("keybind_profile", (int)Keys.F5);
|
public static Keys keyProfile = (Keys)AppConfig.Get("keybind_profile", (int)Keys.F5);
|
||||||
public static Keys keyApp = (Keys)AppConfig.Get("keybind_app", (int)Keys.F12);
|
public static Keys keyApp = (Keys)AppConfig.Get("keybind_app", (int)Keys.F12);
|
||||||
@@ -85,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();
|
||||||
|
|
||||||
@@ -426,7 +432,7 @@ namespace GHelper.Input
|
|||||||
if (e.Modifier == (ModifierKeys.Control | ModifierKeys.Shift | ModifierKeys.Alt))
|
if (e.Modifier == (ModifierKeys.Control | ModifierKeys.Shift | ModifierKeys.Alt))
|
||||||
{
|
{
|
||||||
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 == keyProfile0) modeControl.SetPerformanceMode(0, true);
|
||||||
if (e.Key == keyProfile1) modeControl.SetPerformanceMode(1, true);
|
if (e.Key == keyProfile1) modeControl.SetPerformanceMode(1, true);
|
||||||
if (e.Key == keyProfile2) modeControl.SetPerformanceMode(2, true);
|
if (e.Key == keyProfile2) modeControl.SetPerformanceMode(2, true);
|
||||||
@@ -663,7 +669,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);
|
||||||
@@ -872,10 +878,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)
|
||||||
@@ -931,33 +949,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;
|
||||||
@@ -975,7 +1015,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);
|
||||||
}
|
}
|
||||||
@@ -1026,6 +1066,21 @@ namespace GHelper.Input
|
|||||||
if (brightness >= 0) ApplyScreenpadAction(brightness);
|
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;
|
||||||
|
|||||||
@@ -56,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]}");
|
||||||
|
|||||||
@@ -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
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -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,10 +233,8 @@ namespace GHelper
|
|||||||
Logger.WriteLine("AutoSetting for " + isPlugged.ToString());
|
Logger.WriteLine("AutoSetting for " + isPlugged.ToString());
|
||||||
|
|
||||||
BatteryControl.AutoBattery(init);
|
BatteryControl.AutoBattery(init);
|
||||||
|
|
||||||
if (init)
|
if (init)
|
||||||
{
|
{
|
||||||
screenControl.InitMiniled();
|
|
||||||
InputDispatcher.InitScreenpad();
|
InputDispatcher.InitScreenpad();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -258,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;
|
||||||
@@ -273,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");
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
@@ -272,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;
|
||||||
@@ -293,9 +294,9 @@ namespace GHelper
|
|||||||
|
|
||||||
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)
|
||||||
@@ -674,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;
|
||||||
}
|
}
|
||||||
@@ -1541,24 +1542,6 @@ namespace GHelper
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void AutoKeyboard()
|
|
||||||
{
|
|
||||||
|
|
||||||
if (!AppConfig.Is("skip_aura"))
|
|
||||||
{
|
|
||||||
Aura.ApplyPower();
|
|
||||||
Aura.ApplyAura();
|
|
||||||
}
|
|
||||||
|
|
||||||
InputDispatcher.SetBacklightAuto(true);
|
|
||||||
|
|
||||||
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)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -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()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -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