mirror of
https://github.com/jkocon/g-helper.git
synced 2026-02-23 13:00:52 +01:00
Compare commits
26 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bd1a11a15a | ||
|
|
c2262c0f89 | ||
|
|
88aaf94441 | ||
|
|
20b99810cb | ||
|
|
7b327a4481 | ||
|
|
6f40dadfcb | ||
|
|
a004924a42 | ||
|
|
ef442da885 | ||
|
|
eab2ef695d | ||
|
|
0291920a55 | ||
|
|
633c841d7f | ||
|
|
f2f4df5693 | ||
|
|
4592d729d3 | ||
|
|
8cedcb7b5d | ||
|
|
37d133bd7c | ||
|
|
3f87730375 | ||
|
|
d99c3a8301 | ||
|
|
fbc792cb1d | ||
|
|
5498bb9398 | ||
|
|
25f842df9d | ||
|
|
987ee1c000 | ||
|
|
afe760f58d | ||
|
|
b07f0a09fa | ||
|
|
2b26791dc0 | ||
|
|
8db6939b30 | ||
|
|
29bcb810b4 |
2
.github/workflows/release.yml
vendored
2
.github/workflows/release.yml
vendored
@@ -20,7 +20,7 @@ jobs:
|
||||
- name: Publish
|
||||
run: |
|
||||
dotnet publish app/GHelper.sln --configuration Release --runtime win-x64 -p:PublishSingleFile=true --no-self-contained
|
||||
powershell Compress-Archive app/bin/x64/Release/net7.0-windows8.0/win-x64/publish/* GHelper.zip
|
||||
powershell Compress-Archive app/bin/x64/Release/net7.0-windows/win-x64/publish/* GHelper.zip
|
||||
- name: Upload
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
|
||||
173
app/AsusUSB.cs
173
app/AsusUSB.cs
@@ -256,13 +256,13 @@ namespace GHelper
|
||||
public static void ApplyBrightness(int brightness, string log = "Backlight")
|
||||
{
|
||||
|
||||
if (AppConfig.ContainsModel("TUF"))
|
||||
Program.acpi.TUFKeyboardBrightness(brightness);
|
||||
|
||||
|
||||
Task.Run(async () =>
|
||||
{
|
||||
|
||||
if (AppConfig.ContainsModel("TUF"))
|
||||
Program.acpi.TUFKeyboardBrightness(brightness);
|
||||
|
||||
byte[] msg = { AURA_HID_ID, 0xba, 0xc5, 0xc4, (byte)brightness };
|
||||
byte[] msgBackup = { INPUT_HID_ID, 0xba, 0xc5, 0xc4, (byte)brightness };
|
||||
|
||||
@@ -311,55 +311,60 @@ namespace GHelper
|
||||
public static void ApplyAuraPower()
|
||||
{
|
||||
|
||||
List<AuraDev19b6> flags = new();
|
||||
|
||||
// Keyboard
|
||||
if (AppConfig.IsNotFalse("keyboard_awake")) flags.Add(AuraDev19b6.AwakeKeyb);
|
||||
if (AppConfig.IsNotFalse("keyboard_boot")) flags.Add(AuraDev19b6.BootKeyb);
|
||||
if (AppConfig.IsNotFalse("keyboard_sleep")) flags.Add(AuraDev19b6.SleepKeyb);
|
||||
if (AppConfig.IsNotFalse("keyboard_shutdown")) flags.Add(AuraDev19b6.ShutdownKeyb);
|
||||
|
||||
// Lightbar
|
||||
if (AppConfig.IsNotFalse("keyboard_awake_bar")) flags.Add(AuraDev19b6.AwakeBar);
|
||||
if (AppConfig.IsNotFalse("keyboard_boot_bar")) flags.Add(AuraDev19b6.BootBar);
|
||||
if (AppConfig.IsNotFalse("keyboard_sleep_bar")) flags.Add(AuraDev19b6.SleepBar);
|
||||
if (AppConfig.IsNotFalse("keyboard_shutdown_bar")) flags.Add(AuraDev19b6.ShutdownBar);
|
||||
|
||||
// Lid
|
||||
if (AppConfig.IsNotFalse("keyboard_awake_lid")) flags.Add(AuraDev19b6.AwakeLid);
|
||||
if (AppConfig.IsNotFalse("keyboard_boot_lid")) flags.Add(AuraDev19b6.BootLid);
|
||||
if (AppConfig.IsNotFalse("keyboard_sleep_lid")) flags.Add(AuraDev19b6.SleepLid);
|
||||
if (AppConfig.IsNotFalse("keyboard_shutdown_lid")) flags.Add(AuraDev19b6.ShutdownLid);
|
||||
|
||||
// Logo
|
||||
if (AppConfig.IsNotFalse("keyboard_awake_logo")) flags.Add(AuraDev19b6.AwakeLogo);
|
||||
if (AppConfig.IsNotFalse("keyboard_boot_logo")) flags.Add(AuraDev19b6.BootLogo);
|
||||
if (AppConfig.IsNotFalse("keyboard_sleep_logo")) flags.Add(AuraDev19b6.SleepLogo);
|
||||
if (AppConfig.IsNotFalse("keyboard_shutdown_logo")) flags.Add(AuraDev19b6.ShutdownLogo);
|
||||
|
||||
|
||||
byte[] msg = AuraDev19b6Extensions.ToBytes(flags.ToArray());
|
||||
|
||||
|
||||
var devices = GetHidDevices(deviceIds);
|
||||
|
||||
foreach (HidDevice device in devices)
|
||||
Task.Run(async () =>
|
||||
{
|
||||
device.OpenDevice();
|
||||
if (device.ReadFeatureData(out byte[] data, AURA_HID_ID))
|
||||
{
|
||||
device.WriteFeatureData(msg);
|
||||
Logger.WriteLine("USB-KB " + device.Attributes.ProductHexId + ":" + BitConverter.ToString(msg));
|
||||
}
|
||||
device.CloseDevice();
|
||||
}
|
||||
|
||||
if (AppConfig.ContainsModel("TUF"))
|
||||
Program.acpi.TUFKeyboardPower(
|
||||
flags.Contains(AuraDev19b6.AwakeKeyb),
|
||||
flags.Contains(AuraDev19b6.BootKeyb),
|
||||
flags.Contains(AuraDev19b6.SleepKeyb),
|
||||
flags.Contains(AuraDev19b6.ShutdownKeyb));
|
||||
List<AuraDev19b6> flags = new();
|
||||
|
||||
// Keyboard
|
||||
if (AppConfig.IsNotFalse("keyboard_awake")) flags.Add(AuraDev19b6.AwakeKeyb);
|
||||
if (AppConfig.IsNotFalse("keyboard_boot")) flags.Add(AuraDev19b6.BootKeyb);
|
||||
if (AppConfig.IsNotFalse("keyboard_sleep")) flags.Add(AuraDev19b6.SleepKeyb);
|
||||
if (AppConfig.IsNotFalse("keyboard_shutdown")) flags.Add(AuraDev19b6.ShutdownKeyb);
|
||||
|
||||
// Lightbar
|
||||
if (AppConfig.IsNotFalse("keyboard_awake_bar")) flags.Add(AuraDev19b6.AwakeBar);
|
||||
if (AppConfig.IsNotFalse("keyboard_boot_bar")) flags.Add(AuraDev19b6.BootBar);
|
||||
if (AppConfig.IsNotFalse("keyboard_sleep_bar")) flags.Add(AuraDev19b6.SleepBar);
|
||||
if (AppConfig.IsNotFalse("keyboard_shutdown_bar")) flags.Add(AuraDev19b6.ShutdownBar);
|
||||
|
||||
// Lid
|
||||
if (AppConfig.IsNotFalse("keyboard_awake_lid")) flags.Add(AuraDev19b6.AwakeLid);
|
||||
if (AppConfig.IsNotFalse("keyboard_boot_lid")) flags.Add(AuraDev19b6.BootLid);
|
||||
if (AppConfig.IsNotFalse("keyboard_sleep_lid")) flags.Add(AuraDev19b6.SleepLid);
|
||||
if (AppConfig.IsNotFalse("keyboard_shutdown_lid")) flags.Add(AuraDev19b6.ShutdownLid);
|
||||
|
||||
// Logo
|
||||
if (AppConfig.IsNotFalse("keyboard_awake_logo")) flags.Add(AuraDev19b6.AwakeLogo);
|
||||
if (AppConfig.IsNotFalse("keyboard_boot_logo")) flags.Add(AuraDev19b6.BootLogo);
|
||||
if (AppConfig.IsNotFalse("keyboard_sleep_logo")) flags.Add(AuraDev19b6.SleepLogo);
|
||||
if (AppConfig.IsNotFalse("keyboard_shutdown_logo")) flags.Add(AuraDev19b6.ShutdownLogo);
|
||||
|
||||
|
||||
byte[] msg = AuraDev19b6Extensions.ToBytes(flags.ToArray());
|
||||
|
||||
|
||||
var devices = GetHidDevices(deviceIds);
|
||||
|
||||
foreach (HidDevice device in devices)
|
||||
{
|
||||
device.OpenDevice();
|
||||
if (device.ReadFeatureData(out byte[] data, AURA_HID_ID))
|
||||
{
|
||||
device.WriteFeatureData(msg);
|
||||
Logger.WriteLine("USB-KB " + device.Attributes.ProductHexId + ":" + BitConverter.ToString(msg));
|
||||
}
|
||||
device.CloseDevice();
|
||||
}
|
||||
|
||||
if (AppConfig.ContainsModel("TUF"))
|
||||
Program.acpi.TUFKeyboardPower(
|
||||
flags.Contains(AuraDev19b6.AwakeKeyb),
|
||||
flags.Contains(AuraDev19b6.BootKeyb),
|
||||
flags.Contains(AuraDev19b6.SleepKeyb),
|
||||
flags.Contains(AuraDev19b6.ShutdownKeyb));
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@@ -367,44 +372,48 @@ namespace GHelper
|
||||
public static void ApplyAura()
|
||||
{
|
||||
|
||||
Mode = AppConfig.Get("aura_mode");
|
||||
Speed = AppConfig.Get("aura_speed");
|
||||
SetColor(AppConfig.Get("aura_color"));
|
||||
SetColor2(AppConfig.Get("aura_color2"));
|
||||
|
||||
int _speed;
|
||||
|
||||
switch (Speed)
|
||||
Task.Run(async () =>
|
||||
{
|
||||
case 1:
|
||||
_speed = 0xeb;
|
||||
break;
|
||||
case 2:
|
||||
_speed = 0xf5;
|
||||
break;
|
||||
default:
|
||||
_speed = 0xe1;
|
||||
break;
|
||||
}
|
||||
|
||||
byte[] msg = AuraMessage(Mode, Color1, Color2, _speed);
|
||||
var devices = GetHidDevices(deviceIds);
|
||||
Mode = AppConfig.Get("aura_mode");
|
||||
Speed = AppConfig.Get("aura_speed");
|
||||
SetColor(AppConfig.Get("aura_color"));
|
||||
SetColor2(AppConfig.Get("aura_color2"));
|
||||
|
||||
foreach (HidDevice device in devices)
|
||||
{
|
||||
device.OpenDevice();
|
||||
if (device.ReadFeatureData(out byte[] data, AURA_HID_ID))
|
||||
int _speed;
|
||||
|
||||
switch (Speed)
|
||||
{
|
||||
device.WriteFeatureData(msg);
|
||||
device.WriteFeatureData(MESSAGE_SET);
|
||||
device.WriteFeatureData(MESSAGE_APPLY);
|
||||
Logger.WriteLine("USB-KB " + device.Capabilities.FeatureReportByteLength + "|" + device.Capabilities.InputReportByteLength + device.Description + device.DevicePath + ":" + BitConverter.ToString(msg));
|
||||
case 1:
|
||||
_speed = 0xeb;
|
||||
break;
|
||||
case 2:
|
||||
_speed = 0xf5;
|
||||
break;
|
||||
default:
|
||||
_speed = 0xe1;
|
||||
break;
|
||||
}
|
||||
device.CloseDevice();
|
||||
}
|
||||
|
||||
if (AppConfig.ContainsModel("TUF"))
|
||||
Program.acpi.TUFKeyboardRGB(Mode, Color1, _speed);
|
||||
byte[] msg = AuraMessage(Mode, Color1, Color2, _speed);
|
||||
var devices = GetHidDevices(deviceIds);
|
||||
|
||||
foreach (HidDevice device in devices)
|
||||
{
|
||||
device.OpenDevice();
|
||||
if (device.ReadFeatureData(out byte[] data, AURA_HID_ID))
|
||||
{
|
||||
device.WriteFeatureData(msg);
|
||||
device.WriteFeatureData(MESSAGE_SET);
|
||||
device.WriteFeatureData(MESSAGE_APPLY);
|
||||
Logger.WriteLine("USB-KB " + device.Capabilities.FeatureReportByteLength + "|" + device.Capabilities.InputReportByteLength + device.Description + device.DevicePath + ":" + BitConverter.ToString(msg));
|
||||
}
|
||||
device.CloseDevice();
|
||||
}
|
||||
|
||||
if (AppConfig.ContainsModel("TUF"))
|
||||
Program.acpi.TUFKeyboardRGB(Mode, Color1, _speed);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -238,7 +238,7 @@ namespace GHelper.Display
|
||||
//Fallback scenario
|
||||
if (iRet != 0)
|
||||
{
|
||||
Thread.Sleep(1000);
|
||||
Thread.Sleep(500);
|
||||
iRet = ChangeDisplaySettingsEx(laptopScreen, ref dm, IntPtr.Zero, DisplaySettingsFlags.CDS_UPDATEREGISTRY, IntPtr.Zero);
|
||||
Logger.WriteLine("Screen = " + frequency.ToString() + "Hz : " + (iRet == 0 ? "OK" : iRet));
|
||||
}
|
||||
|
||||
66
app/Extra.Designer.cs
generated
66
app/Extra.Designer.cs
generated
@@ -137,7 +137,7 @@ namespace GHelper
|
||||
panelServices.Controls.Add(labelServices);
|
||||
panelServices.Controls.Add(buttonServices);
|
||||
panelServices.Dock = DockStyle.Top;
|
||||
panelServices.Location = new Point(15, 1236);
|
||||
panelServices.Location = new Point(15, 1216);
|
||||
panelServices.Name = "panelServices";
|
||||
panelServices.Size = new Size(983, 75);
|
||||
panelServices.TabIndex = 3;
|
||||
@@ -235,15 +235,17 @@ namespace GHelper
|
||||
panelBindings.Location = new Point(15, 65);
|
||||
panelBindings.Name = "panelBindings";
|
||||
panelBindings.Padding = new Padding(0, 0, 10, 5);
|
||||
panelBindings.Size = new Size(983, 325);
|
||||
panelBindings.Size = new Size(983, 305);
|
||||
panelBindings.TabIndex = 5;
|
||||
//
|
||||
// tableBindings
|
||||
//
|
||||
tableBindings.AutoSize = true;
|
||||
tableBindings.AutoSizeMode = AutoSizeMode.GrowAndShrink;
|
||||
tableBindings.ColumnCount = 3;
|
||||
tableBindings.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 15.4649944F));
|
||||
tableBindings.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 40.97453F));
|
||||
tableBindings.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 43.6323357F));
|
||||
tableBindings.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 15.45389F));
|
||||
tableBindings.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 40.94511F));
|
||||
tableBindings.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 43.6010056F));
|
||||
tableBindings.Controls.Add(label1, 0, 5);
|
||||
tableBindings.Controls.Add(textBox1, 2, 1);
|
||||
tableBindings.Controls.Add(textM1, 2, 0);
|
||||
@@ -268,19 +270,19 @@ namespace GHelper
|
||||
tableBindings.Name = "tableBindings";
|
||||
tableBindings.Padding = new Padding(16, 12, 0, 12);
|
||||
tableBindings.RowCount = 6;
|
||||
tableBindings.RowStyles.Add(new RowStyle(SizeType.Absolute, 51F));
|
||||
tableBindings.RowStyles.Add(new RowStyle(SizeType.Absolute, 51F));
|
||||
tableBindings.RowStyles.Add(new RowStyle(SizeType.Absolute, 51F));
|
||||
tableBindings.RowStyles.Add(new RowStyle(SizeType.Absolute, 51F));
|
||||
tableBindings.RowStyles.Add(new RowStyle(SizeType.Absolute, 49F));
|
||||
tableBindings.RowStyles.Add(new RowStyle(SizeType.Absolute, 21F));
|
||||
tableBindings.Size = new Size(973, 320);
|
||||
tableBindings.RowStyles.Add(new RowStyle());
|
||||
tableBindings.RowStyles.Add(new RowStyle());
|
||||
tableBindings.RowStyles.Add(new RowStyle());
|
||||
tableBindings.RowStyles.Add(new RowStyle());
|
||||
tableBindings.RowStyles.Add(new RowStyle());
|
||||
tableBindings.RowStyles.Add(new RowStyle());
|
||||
tableBindings.Size = new Size(973, 300);
|
||||
tableBindings.TabIndex = 12;
|
||||
//
|
||||
// label1
|
||||
//
|
||||
label1.AutoSize = true;
|
||||
label1.Location = new Point(16, 265);
|
||||
label1.Location = new Point(16, 242);
|
||||
label1.Margin = new Padding(0);
|
||||
label1.Name = "label1";
|
||||
label1.Padding = new Padding(5, 10, 0, 0);
|
||||
@@ -291,7 +293,7 @@ namespace GHelper
|
||||
// textBox1
|
||||
//
|
||||
textBox1.Dock = DockStyle.Top;
|
||||
textBox1.Location = new Point(558, 66);
|
||||
textBox1.Location = new Point(558, 61);
|
||||
textBox1.Margin = new Padding(4, 3, 4, 3);
|
||||
textBox1.Name = "textBox1";
|
||||
textBox1.PlaceholderText = "action";
|
||||
@@ -339,7 +341,7 @@ namespace GHelper
|
||||
comboM4.Dock = DockStyle.Top;
|
||||
comboM4.FormattingEnabled = true;
|
||||
comboM4.Items.AddRange(new object[] { Strings.PerformanceMode, Strings.OpenGHelper, Strings.Custom });
|
||||
comboM4.Location = new Point(167, 168);
|
||||
comboM4.Location = new Point(167, 153);
|
||||
comboM4.Margin = new Padding(4, 3, 4, 3);
|
||||
comboM4.Name = "comboM4";
|
||||
comboM4.Size = new Size(383, 40);
|
||||
@@ -352,7 +354,7 @@ namespace GHelper
|
||||
comboM3.Dock = DockStyle.Top;
|
||||
comboM3.FormattingEnabled = true;
|
||||
comboM3.Items.AddRange(new object[] { Strings.Default, Strings.VolumeMute, Strings.PlayPause, Strings.PrintScreen, Strings.ToggleAura, Strings.Custom });
|
||||
comboM3.Location = new Point(167, 117);
|
||||
comboM3.Location = new Point(167, 107);
|
||||
comboM3.Margin = new Padding(4, 3, 4, 3);
|
||||
comboM3.Name = "comboM3";
|
||||
comboM3.Size = new Size(383, 40);
|
||||
@@ -361,7 +363,7 @@ namespace GHelper
|
||||
// textM4
|
||||
//
|
||||
textM4.Dock = DockStyle.Top;
|
||||
textM4.Location = new Point(558, 168);
|
||||
textM4.Location = new Point(558, 153);
|
||||
textM4.Margin = new Padding(4, 3, 4, 3);
|
||||
textM4.Name = "textM4";
|
||||
textM4.PlaceholderText = "action";
|
||||
@@ -371,7 +373,7 @@ namespace GHelper
|
||||
// textM3
|
||||
//
|
||||
textM3.Dock = DockStyle.Top;
|
||||
textM3.Location = new Point(558, 117);
|
||||
textM3.Location = new Point(558, 107);
|
||||
textM3.Margin = new Padding(4, 3, 4, 3);
|
||||
textM3.Name = "textM3";
|
||||
textM3.PlaceholderText = "action";
|
||||
@@ -381,7 +383,7 @@ namespace GHelper
|
||||
// labelM4
|
||||
//
|
||||
labelM4.AutoSize = true;
|
||||
labelM4.Location = new Point(16, 165);
|
||||
labelM4.Location = new Point(16, 150);
|
||||
labelM4.Margin = new Padding(0);
|
||||
labelM4.Name = "labelM4";
|
||||
labelM4.Padding = new Padding(5, 10, 0, 0);
|
||||
@@ -392,7 +394,7 @@ namespace GHelper
|
||||
// labelM3
|
||||
//
|
||||
labelM3.AutoSize = true;
|
||||
labelM3.Location = new Point(16, 114);
|
||||
labelM3.Location = new Point(16, 104);
|
||||
labelM3.Margin = new Padding(0);
|
||||
labelM3.Name = "labelM3";
|
||||
labelM3.Padding = new Padding(5, 10, 0, 0);
|
||||
@@ -403,7 +405,7 @@ namespace GHelper
|
||||
// labelM2
|
||||
//
|
||||
labelM2.AutoSize = true;
|
||||
labelM2.Location = new Point(16, 63);
|
||||
labelM2.Location = new Point(16, 58);
|
||||
labelM2.Margin = new Padding(0);
|
||||
labelM2.Name = "labelM2";
|
||||
labelM2.Padding = new Padding(5, 10, 0, 0);
|
||||
@@ -418,7 +420,7 @@ namespace GHelper
|
||||
comboM2.Dock = DockStyle.Top;
|
||||
comboM2.FormattingEnabled = true;
|
||||
comboM2.Items.AddRange(new object[] { Strings.Default, Strings.VolumeMute, Strings.PlayPause, Strings.PrintScreen, Strings.ToggleAura, Strings.Custom });
|
||||
comboM2.Location = new Point(167, 66);
|
||||
comboM2.Location = new Point(167, 61);
|
||||
comboM2.Margin = new Padding(4, 3, 4, 3);
|
||||
comboM2.Name = "comboM2";
|
||||
comboM2.Size = new Size(383, 40);
|
||||
@@ -427,7 +429,7 @@ namespace GHelper
|
||||
// labelFNF4
|
||||
//
|
||||
labelFNF4.AutoSize = true;
|
||||
labelFNF4.Location = new Point(16, 216);
|
||||
labelFNF4.Location = new Point(16, 196);
|
||||
labelFNF4.Margin = new Padding(0);
|
||||
labelFNF4.Name = "labelFNF4";
|
||||
labelFNF4.Padding = new Padding(5, 10, 0, 0);
|
||||
@@ -441,7 +443,7 @@ namespace GHelper
|
||||
comboFNF4.ButtonColor = Color.FromArgb(255, 255, 255);
|
||||
comboFNF4.Dock = DockStyle.Top;
|
||||
comboFNF4.FormattingEnabled = true;
|
||||
comboFNF4.Location = new Point(167, 219);
|
||||
comboFNF4.Location = new Point(167, 199);
|
||||
comboFNF4.Margin = new Padding(4, 3, 4, 3);
|
||||
comboFNF4.Name = "comboFNF4";
|
||||
comboFNF4.Size = new Size(383, 40);
|
||||
@@ -450,7 +452,7 @@ namespace GHelper
|
||||
// textFNF4
|
||||
//
|
||||
textFNF4.Dock = DockStyle.Top;
|
||||
textFNF4.Location = new Point(558, 219);
|
||||
textFNF4.Location = new Point(558, 199);
|
||||
textFNF4.Margin = new Padding(4, 3, 4, 3);
|
||||
textFNF4.Name = "textFNF4";
|
||||
textFNF4.PlaceholderText = "action";
|
||||
@@ -463,7 +465,7 @@ namespace GHelper
|
||||
comboFNC.ButtonColor = Color.FromArgb(255, 255, 255);
|
||||
comboFNC.Dock = DockStyle.Top;
|
||||
comboFNC.FormattingEnabled = true;
|
||||
comboFNC.Location = new Point(167, 268);
|
||||
comboFNC.Location = new Point(167, 245);
|
||||
comboFNC.Margin = new Padding(4, 3, 4, 3);
|
||||
comboFNC.Name = "comboFNC";
|
||||
comboFNC.Size = new Size(383, 40);
|
||||
@@ -472,7 +474,7 @@ namespace GHelper
|
||||
// textFNC
|
||||
//
|
||||
textFNC.Dock = DockStyle.Top;
|
||||
textFNC.Location = new Point(558, 268);
|
||||
textFNC.Location = new Point(558, 245);
|
||||
textFNC.Margin = new Padding(4, 3, 4, 3);
|
||||
textFNC.Name = "textFNC";
|
||||
textFNC.PlaceholderText = "action";
|
||||
@@ -526,7 +528,7 @@ namespace GHelper
|
||||
panelBacklightHeader.Controls.Add(pictureBacklight);
|
||||
panelBacklightHeader.Controls.Add(labelBacklightTitle);
|
||||
panelBacklightHeader.Dock = DockStyle.Top;
|
||||
panelBacklightHeader.Location = new Point(15, 390);
|
||||
panelBacklightHeader.Location = new Point(15, 370);
|
||||
panelBacklightHeader.Name = "panelBacklightHeader";
|
||||
panelBacklightHeader.Padding = new Padding(10, 5, 10, 5);
|
||||
panelBacklightHeader.Size = new Size(983, 50);
|
||||
@@ -572,7 +574,7 @@ namespace GHelper
|
||||
panelBacklight.Controls.Add(panelXMG);
|
||||
panelBacklight.Controls.Add(tableBacklight);
|
||||
panelBacklight.Dock = DockStyle.Top;
|
||||
panelBacklight.Location = new Point(15, 440);
|
||||
panelBacklight.Location = new Point(15, 420);
|
||||
panelBacklight.Name = "panelBacklight";
|
||||
panelBacklight.Padding = new Padding(0, 5, 0, 5);
|
||||
panelBacklight.Size = new Size(983, 402);
|
||||
@@ -961,7 +963,7 @@ namespace GHelper
|
||||
panelSettingsHeader.Controls.Add(pictureSettings);
|
||||
panelSettingsHeader.Controls.Add(labelSettings);
|
||||
panelSettingsHeader.Dock = DockStyle.Top;
|
||||
panelSettingsHeader.Location = new Point(15, 842);
|
||||
panelSettingsHeader.Location = new Point(15, 822);
|
||||
panelSettingsHeader.Name = "panelSettingsHeader";
|
||||
panelSettingsHeader.Padding = new Padding(10, 5, 10, 5);
|
||||
panelSettingsHeader.Size = new Size(983, 50);
|
||||
@@ -1013,7 +1015,7 @@ namespace GHelper
|
||||
panelSettings.Controls.Add(checkGpuApps);
|
||||
panelSettings.Controls.Add(checkFnLock);
|
||||
panelSettings.Dock = DockStyle.Top;
|
||||
panelSettings.Location = new Point(15, 892);
|
||||
panelSettings.Location = new Point(15, 872);
|
||||
panelSettings.Name = "panelSettings";
|
||||
panelSettings.Padding = new Padding(20, 5, 10, 5);
|
||||
panelSettings.Size = new Size(983, 344);
|
||||
@@ -1031,7 +1033,6 @@ namespace GHelper
|
||||
checkAutoToggleClamshellMode.TabIndex = 58;
|
||||
checkAutoToggleClamshellMode.Text = "Auto Toggle Clamshell Mode";
|
||||
checkAutoToggleClamshellMode.UseVisualStyleBackColor = true;
|
||||
checkAutoToggleClamshellMode.CheckedChanged += checkAutoToggleClamshellMode_CheckedChanged;
|
||||
//
|
||||
// checkAutoApplyWindowsPowerMode
|
||||
//
|
||||
@@ -1159,6 +1160,7 @@ namespace GHelper
|
||||
((System.ComponentModel.ISupportInitialize)pictureBindings).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)pictureHelp).EndInit();
|
||||
panelBindings.ResumeLayout(false);
|
||||
panelBindings.PerformLayout();
|
||||
tableBindings.ResumeLayout(false);
|
||||
tableBindings.PerformLayout();
|
||||
tableKeys.ResumeLayout(false);
|
||||
|
||||
33
app/Extra.cs
33
app/Extra.cs
@@ -11,6 +11,7 @@ namespace GHelper
|
||||
{
|
||||
|
||||
ScreenControl screenControl = new ScreenControl();
|
||||
ClamshellModeControl clamshellControl = new ClamshellModeControl();
|
||||
|
||||
Dictionary<string, string> customActions = new Dictionary<string, string>
|
||||
{
|
||||
@@ -123,6 +124,21 @@ namespace GHelper
|
||||
customActions.Add("screenpad_up", Properties.Strings.ScreenPadUp);
|
||||
}
|
||||
|
||||
if (InputDispatcher.NoMKeys())
|
||||
{
|
||||
labelM1.Text = "FN+F2";
|
||||
labelM2.Text = "FN+F3";
|
||||
labelM3.Text = "FN+F4";
|
||||
labelM4.Visible = comboM4.Visible = textM4.Visible = false;
|
||||
labelFNF4.Visible = comboFNF4.Visible = textFNF4.Visible = false;
|
||||
}
|
||||
|
||||
if (Program.acpi.DeviceGet(AsusACPI.GPUEco) < 0)
|
||||
{
|
||||
checkGpuApps.Visible = false;
|
||||
checkUSBC.Visible = false;
|
||||
}
|
||||
|
||||
InitTheme();
|
||||
|
||||
SetKeyCombo(comboM1, textM1, "m1");
|
||||
@@ -211,8 +227,9 @@ namespace GHelper
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//checkAutoToggleClamshellMode.Visible = clamshellControl.IsExternalDisplayConnected();
|
||||
checkAutoToggleClamshellMode.Checked = AppConfig.Is("toggle_clamshell_mode");
|
||||
checkAutoToggleClamshellMode.CheckedChanged += checkAutoToggleClamshellMode_CheckedChanged;
|
||||
|
||||
checkTopmost.Checked = AppConfig.Is("topmost");
|
||||
checkTopmost.CheckedChanged += CheckTopmost_CheckedChanged; ;
|
||||
@@ -471,11 +488,19 @@ namespace GHelper
|
||||
AppConfig.Set("auto_apply_power_plan", checkAutoApplyWindowsPowerMode.Checked ? 1 : 0);
|
||||
}
|
||||
|
||||
private void checkAutoToggleClamshellMode_CheckedChanged(object sender, EventArgs e)
|
||||
private void checkAutoToggleClamshellMode_CheckedChanged(object? sender, EventArgs e)
|
||||
{
|
||||
AppConfig.Set("toggle_clamshell_mode", checkAutoToggleClamshellMode.Checked ? 1 : 0);
|
||||
ClamshellModeControl ctrl = new ClamshellModeControl();
|
||||
ctrl.ToggleLidAction();
|
||||
|
||||
if (checkAutoToggleClamshellMode.Checked)
|
||||
{
|
||||
clamshellControl.ToggleLidAction();
|
||||
}
|
||||
else
|
||||
{
|
||||
ClamshellModeControl.DisableClamshellMode();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<ProduceReferenceAssembly>False</ProduceReferenceAssembly>
|
||||
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
|
||||
<AssemblyVersion>0.100</AssemblyVersion>
|
||||
<AssemblyVersion>0.101</AssemblyVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||
|
||||
@@ -177,7 +177,7 @@ namespace GHelper.Gpu
|
||||
{
|
||||
|
||||
bool GpuAuto = AppConfig.Is("gpu_auto");
|
||||
bool ForceGPU = AppConfig.ContainsModel("503");
|
||||
bool ForceGPU = AppConfig.ContainsModel("503") || AppConfig.Is("gpu_fix");
|
||||
|
||||
int GpuMode = AppConfig.Get("gpu_mode");
|
||||
|
||||
@@ -321,5 +321,16 @@ namespace GHelper.Gpu
|
||||
}
|
||||
}
|
||||
|
||||
// Manually forcing standard mode on shutdown/hibernate for some exotic cases
|
||||
// https://github.com/seerge/g-helper/pull/855
|
||||
public void StandardModeFix()
|
||||
{
|
||||
if (!AppConfig.Is("gpu_fix")) return; // No config entry
|
||||
if (Program.acpi.DeviceGet(AsusACPI.GPUMux) == 0) return; // Ultimate mode
|
||||
|
||||
Logger.WriteLine("Forcing Standard Mode on shutdown / hibernation");
|
||||
Program.acpi.SetGPUEco(0);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,24 +39,38 @@ namespace GHelper.Helpers
|
||||
return SystemInformation.PowerStatus.PowerLineStatus == PowerLineStatus.Online;
|
||||
}
|
||||
|
||||
public bool IsInClamshellMode()
|
||||
public bool IsClamshellReady()
|
||||
{
|
||||
return IsExternalDisplayConnected() && IsChargerConnected();
|
||||
}
|
||||
|
||||
public void ToggleLidAction()
|
||||
{
|
||||
if (IsInClamshellMode() && IsClamshellEnabled())
|
||||
if (!IsClamshellEnabled())
|
||||
{
|
||||
PowerNative.SetLidAction(0, true);
|
||||
Logger.WriteLine("Engaging Clamshell Mode");
|
||||
return;
|
||||
}
|
||||
|
||||
if (IsClamshellReady())
|
||||
{
|
||||
EnableClamshellMode();
|
||||
}
|
||||
else
|
||||
{
|
||||
PowerNative.SetLidAction(1, true);
|
||||
Logger.WriteLine("Disengaging Clamshell Mode");
|
||||
DisableClamshellMode();
|
||||
}
|
||||
}
|
||||
public static void DisableClamshellMode()
|
||||
{
|
||||
PowerNative.SetLidAction(1, true);
|
||||
Logger.WriteLine("Disengaging Clamshell Mode");
|
||||
}
|
||||
|
||||
public static void EnableClamshellMode()
|
||||
{
|
||||
PowerNative.SetLidAction(0, true);
|
||||
Logger.WriteLine("Engaging Clamshell Mode");
|
||||
}
|
||||
|
||||
public void UnregisterDisplayEvents()
|
||||
{
|
||||
|
||||
@@ -148,6 +148,13 @@ namespace GHelper.Input
|
||||
return AppConfig.ContainsModel("TUF") && !AppConfig.ContainsModel("FA506");
|
||||
}
|
||||
|
||||
public static bool NoMKeys()
|
||||
{
|
||||
return AppConfig.ContainsModel("Z13") ||
|
||||
AppConfig.ContainsModel("FA506") ||
|
||||
AppConfig.ContainsModel("FX506");
|
||||
}
|
||||
|
||||
public void KeyPressed(object sender, KeyPressedEventArgs e)
|
||||
{
|
||||
|
||||
@@ -155,7 +162,7 @@ namespace GHelper.Input
|
||||
{
|
||||
Logger.WriteLine(e.Key.ToString());
|
||||
|
||||
if (AppConfig.ContainsModel("Z13") || AppConfig.ContainsModel("FA506"))
|
||||
if (NoMKeys())
|
||||
{
|
||||
switch (e.Key)
|
||||
{
|
||||
|
||||
@@ -100,6 +100,10 @@ namespace GHelper
|
||||
// Subscribing for system power change events
|
||||
SystemEvents.PowerModeChanged += SystemEvents_PowerModeChanged;
|
||||
SystemEvents.UserPreferenceChanged += SystemEvents_UserPreferenceChanged;
|
||||
|
||||
SystemEvents.SessionSwitch += SystemEvents_SessionSwitch;
|
||||
SystemEvents.SessionEnding += SystemEvents_SessionEnding;
|
||||
|
||||
clamshellControl.RegisterDisplayEvents();
|
||||
clamshellControl.ToggleLidAction();
|
||||
|
||||
@@ -117,7 +121,19 @@ namespace GHelper
|
||||
|
||||
}
|
||||
|
||||
private static void SystemEvents_SessionEnding(object sender, SessionEndingEventArgs e)
|
||||
{
|
||||
gpuControl.StandardModeFix();
|
||||
}
|
||||
|
||||
private static void SystemEvents_SessionSwitch(object sender, SessionSwitchEventArgs e)
|
||||
{
|
||||
if (e.Reason == SessionSwitchReason.SessionLogon || e.Reason == SessionSwitchReason.SessionUnlock)
|
||||
{
|
||||
Logger.WriteLine("Session:" + e.Reason.ToString());
|
||||
screenControl.AutoScreen();
|
||||
}
|
||||
}
|
||||
|
||||
static void SystemEvents_UserPreferenceChanged(object sender, UserPreferenceChangedEventArgs e)
|
||||
{
|
||||
@@ -178,8 +194,12 @@ namespace GHelper
|
||||
|
||||
private static void SystemEvents_PowerModeChanged(object sender, PowerModeChangedEventArgs e)
|
||||
{
|
||||
Logger.WriteLine("Power Mode:" + e.Mode.ToString());
|
||||
|
||||
|
||||
if (e.Mode == PowerModes.Suspend) gpuControl.StandardModeFix();
|
||||
|
||||
if (SystemInformation.PowerStatus.PowerLineStatus == isPlugged) return;
|
||||
Logger.WriteLine("Power Mode Changed");
|
||||
SetAutoModes(true);
|
||||
}
|
||||
|
||||
|
||||
@@ -402,7 +402,7 @@
|
||||
<value>Nuevas actualizaciones</value>
|
||||
</data>
|
||||
<data name="NoNewUpdates" xml:space="preserve">
|
||||
<value>No hay nuevas actualizaciones</value>
|
||||
<value>No hay actualizaciones</value>
|
||||
</data>
|
||||
<data name="OpenGHelper" xml:space="preserve">
|
||||
<value>Abrir ventana G-Helper</value>
|
||||
|
||||
@@ -208,7 +208,7 @@
|
||||
<value>Limite Ricarica Batteria</value>
|
||||
</data>
|
||||
<data name="BatteryHealth" xml:space="preserve">
|
||||
<value>Battery Health</value>
|
||||
<value>Salute Batteria</value>
|
||||
</data>
|
||||
<data name="BiosAndDriverUpdates" xml:space="preserve">
|
||||
<value>Aggiornamenti Driver e BIOS</value>
|
||||
@@ -232,7 +232,7 @@
|
||||
<value>Colore</value>
|
||||
</data>
|
||||
<data name="CPUBoost" xml:space="preserve">
|
||||
<value>CPU Boost</value>
|
||||
<value>Boost CPU</value>
|
||||
</data>
|
||||
<data name="Custom" xml:space="preserve">
|
||||
<value>Personalizzato</value>
|
||||
|
||||
@@ -208,7 +208,7 @@
|
||||
<value>Limit ładowania baterii</value>
|
||||
</data>
|
||||
<data name="BatteryHealth" xml:space="preserve">
|
||||
<value>Battery Health</value>
|
||||
<value>Stan baterii</value>
|
||||
</data>
|
||||
<data name="BiosAndDriverUpdates" xml:space="preserve">
|
||||
<value>Aktualizacje BIOS i sterowników</value>
|
||||
@@ -294,7 +294,7 @@ Nadal chcesz kontynuować?</value>
|
||||
<value>Wentylatory i moc</value>
|
||||
</data>
|
||||
<data name="FanSpeed" xml:space="preserve">
|
||||
<value>Wentylator</value>
|
||||
<value>Went</value>
|
||||
</data>
|
||||
<data name="FansPower" xml:space="preserve">
|
||||
<value>Dostosuj</value>
|
||||
|
||||
@@ -208,7 +208,7 @@
|
||||
<value>Ліміт заряду батареї</value>
|
||||
</data>
|
||||
<data name="BatteryHealth" xml:space="preserve">
|
||||
<value>Battery Health</value>
|
||||
<value>Стан батареї</value>
|
||||
</data>
|
||||
<data name="BiosAndDriverUpdates" xml:space="preserve">
|
||||
<value>Оновлення BIOS та драйверів</value>
|
||||
|
||||
@@ -199,7 +199,7 @@
|
||||
<value>唤醒时</value>
|
||||
</data>
|
||||
<data name="BacklightTimeout" xml:space="preserve">
|
||||
<value>插电/电池时背光时间 (0表示长亮)</value>
|
||||
<value>插电/电池时熄灭时间(0表示长亮)</value>
|
||||
</data>
|
||||
<data name="Balanced" xml:space="preserve">
|
||||
<value>平衡模式</value>
|
||||
@@ -208,7 +208,7 @@
|
||||
<value>电池充电限制</value>
|
||||
</data>
|
||||
<data name="BatteryHealth" xml:space="preserve">
|
||||
<value>Battery Health</value>
|
||||
<value>电池健康</value>
|
||||
</data>
|
||||
<data name="BiosAndDriverUpdates" xml:space="preserve">
|
||||
<value>BIOS 和驱动程序更新</value>
|
||||
@@ -495,7 +495,7 @@
|
||||
<value>切换 Aura 模式</value>
|
||||
</data>
|
||||
<data name="ToggleClamshellMode" xml:space="preserve">
|
||||
<value>Auto Toggle Clamshell Mode</value>
|
||||
<value>自动启用外接显示器模式</value>
|
||||
</data>
|
||||
<data name="ToggleFnLock" xml:space="preserve">
|
||||
<value>切换 Fn 锁定</value>
|
||||
|
||||
@@ -208,7 +208,7 @@
|
||||
<value>電池充電上限</value>
|
||||
</data>
|
||||
<data name="BatteryHealth" xml:space="preserve">
|
||||
<value>Battery Health</value>
|
||||
<value>電池健康度</value>
|
||||
</data>
|
||||
<data name="BiosAndDriverUpdates" xml:space="preserve">
|
||||
<value>BIOS與驅動程式更新 Updates</value>
|
||||
|
||||
@@ -125,7 +125,11 @@ You can find them under ``%AppData%\GHelper`` folder. Please include them when p
|
||||
Open app, and uncheck and check again "run on startup". If it still doesn't help (by some reason), you can try to manually edit "GHelper" task in windows Task Scheduler, and add couple of seconds delay to start.
|
||||
|
||||
#### How do I uninstall G-helper?
|
||||
G-helper is a single exe, and it doesn't install anything in the system. To remove it - you can simply delete exe :) If you have applied any custom fan profiles or PPTs - before removing I would recommend selecting your favorite performance mode (for example balanced) and clicking "Factory defaults" under Fans + Power.
|
||||
G-helper is a single exe, and it doesn't install anything in the system. To remove it - you can simply delete exe :) If you have applied any custom fan profiles or PPTs - before removing I would recommend selecting your
|
||||
favorite performance mode (for example balanced) and clicking "Factory defaults" under Fans + Power.
|
||||
|
||||
#### Can I undervolt my CPU ?
|
||||
Currently you can undervolt AMD CPUs. If your model supports that - you will see undervolting slider under ``Fans+Power -> Advanced``. If you don't see slider there, it means your CPU doesn't support undervolting. Full list of models that suppor that [can be found here](https://github.com/seerge/g-helper/discussions/736)
|
||||
|
||||
#### I have G14 2023 and my GPU refuses to disable/enable
|
||||
It seem to be an issue in older BIOS versions. As [users report](https://github.com/seerge/g-helper/issues/680) - latest BIOS 310 (installable via myasus / g-helper -> updates) resolves all issues :) So please update.
|
||||
@@ -219,6 +223,12 @@ Full list of keycodes https://learn.microsoft.com/en-us/windows/win32/inputdev/v
|
||||
|
||||

|
||||
|
||||
### Force Standard mode on shutdown / hibernation
|
||||
In some rare cases G14 2023 seem to have issues with enabling / disabling dGPU - i.e. Eco mode. Till we wait for a fix from asus on BIOS level, one of the proposed solutions is to always shutdown laptop in Standard mode (then everything seem to work fine). To enable "forced" Standard mode on shutdown add following line to ``%AppData%\GHelper\config.json``
|
||||
```
|
||||
"gpu_fix" : 1,
|
||||
```
|
||||
|
||||
### Disable OSD
|
||||
You can disable app's OSD (for performance modes, keyboard backlight, etc) by adding following line to ``%AppData%\GHelper\config.json``
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user