mirror of
https://github.com/jkocon/g-helper.git
synced 2026-02-23 13:00:52 +01:00
Merge branch 'seerge:main' into asus-mouse-support
This commit is contained in:
@@ -256,13 +256,13 @@ namespace GHelper
|
|||||||
public static void ApplyBrightness(int brightness, string log = "Backlight")
|
public static void ApplyBrightness(int brightness, string log = "Backlight")
|
||||||
{
|
{
|
||||||
|
|
||||||
if (AppConfig.ContainsModel("TUF"))
|
|
||||||
Program.acpi.TUFKeyboardBrightness(brightness);
|
|
||||||
|
|
||||||
|
|
||||||
Task.Run(async () =>
|
Task.Run(async () =>
|
||||||
{
|
{
|
||||||
|
|
||||||
|
if (AppConfig.ContainsModel("TUF"))
|
||||||
|
Program.acpi.TUFKeyboardBrightness(brightness);
|
||||||
|
|
||||||
byte[] msg = { AURA_HID_ID, 0xba, 0xc5, 0xc4, (byte)brightness };
|
byte[] msg = { AURA_HID_ID, 0xba, 0xc5, 0xc4, (byte)brightness };
|
||||||
byte[] msgBackup = { INPUT_HID_ID, 0xba, 0xc5, 0xc4, (byte)brightness };
|
byte[] msgBackup = { INPUT_HID_ID, 0xba, 0xc5, 0xc4, (byte)brightness };
|
||||||
|
|
||||||
@@ -309,6 +309,9 @@ namespace GHelper
|
|||||||
|
|
||||||
|
|
||||||
public static void ApplyAuraPower()
|
public static void ApplyAuraPower()
|
||||||
|
{
|
||||||
|
|
||||||
|
Task.Run(async () =>
|
||||||
{
|
{
|
||||||
|
|
||||||
List<AuraDev19b6> flags = new();
|
List<AuraDev19b6> flags = new();
|
||||||
@@ -361,6 +364,8 @@ namespace GHelper
|
|||||||
flags.Contains(AuraDev19b6.SleepKeyb),
|
flags.Contains(AuraDev19b6.SleepKeyb),
|
||||||
flags.Contains(AuraDev19b6.ShutdownKeyb));
|
flags.Contains(AuraDev19b6.ShutdownKeyb));
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -372,6 +377,10 @@ namespace GHelper
|
|||||||
SetColor(AppConfig.Get("aura_color"));
|
SetColor(AppConfig.Get("aura_color"));
|
||||||
SetColor2(AppConfig.Get("aura_color2"));
|
SetColor2(AppConfig.Get("aura_color2"));
|
||||||
|
|
||||||
|
Task.Run(async () =>
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
int _speed;
|
int _speed;
|
||||||
|
|
||||||
switch (Speed)
|
switch (Speed)
|
||||||
@@ -405,6 +414,7 @@ namespace GHelper
|
|||||||
|
|
||||||
if (AppConfig.ContainsModel("TUF"))
|
if (AppConfig.ContainsModel("TUF"))
|
||||||
Program.acpi.TUFKeyboardRGB(Mode, Color1, _speed);
|
Program.acpi.TUFKeyboardRGB(Mode, Color1, _speed);
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -238,7 +238,7 @@ namespace GHelper.Display
|
|||||||
//Fallback scenario
|
//Fallback scenario
|
||||||
if (iRet != 0)
|
if (iRet != 0)
|
||||||
{
|
{
|
||||||
Thread.Sleep(1000);
|
Thread.Sleep(500);
|
||||||
iRet = ChangeDisplaySettingsEx(laptopScreen, ref dm, IntPtr.Zero, DisplaySettingsFlags.CDS_UPDATEREGISTRY, IntPtr.Zero);
|
iRet = ChangeDisplaySettingsEx(laptopScreen, ref dm, IntPtr.Zero, DisplaySettingsFlags.CDS_UPDATEREGISTRY, IntPtr.Zero);
|
||||||
Logger.WriteLine("Screen = " + frequency.ToString() + "Hz : " + (iRet == 0 ? "OK" : iRet));
|
Logger.WriteLine("Screen = " + frequency.ToString() + "Hz : " + (iRet == 0 ? "OK" : iRet));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -227,7 +227,7 @@ namespace GHelper
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
checkAutoToggleClamshellMode.Visible = clamshellControl.IsExternalDisplayConnected();
|
//checkAutoToggleClamshellMode.Visible = clamshellControl.IsExternalDisplayConnected();
|
||||||
checkAutoToggleClamshellMode.Checked = AppConfig.Is("toggle_clamshell_mode");
|
checkAutoToggleClamshellMode.Checked = AppConfig.Is("toggle_clamshell_mode");
|
||||||
checkAutoToggleClamshellMode.CheckedChanged += checkAutoToggleClamshellMode_CheckedChanged;
|
checkAutoToggleClamshellMode.CheckedChanged += checkAutoToggleClamshellMode_CheckedChanged;
|
||||||
|
|
||||||
|
|||||||
@@ -177,7 +177,7 @@ namespace GHelper.Gpu
|
|||||||
{
|
{
|
||||||
|
|
||||||
bool GpuAuto = AppConfig.Is("gpu_auto");
|
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");
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -101,6 +101,10 @@ namespace GHelper
|
|||||||
// Subscribing for system power change events
|
// Subscribing for system power change events
|
||||||
SystemEvents.PowerModeChanged += SystemEvents_PowerModeChanged;
|
SystemEvents.PowerModeChanged += SystemEvents_PowerModeChanged;
|
||||||
SystemEvents.UserPreferenceChanged += SystemEvents_UserPreferenceChanged;
|
SystemEvents.UserPreferenceChanged += SystemEvents_UserPreferenceChanged;
|
||||||
|
|
||||||
|
SystemEvents.SessionSwitch += SystemEvents_SessionSwitch;
|
||||||
|
SystemEvents.SessionEnding += SystemEvents_SessionEnding;
|
||||||
|
|
||||||
clamshellControl.RegisterDisplayEvents();
|
clamshellControl.RegisterDisplayEvents();
|
||||||
clamshellControl.ToggleLidAction();
|
clamshellControl.ToggleLidAction();
|
||||||
|
|
||||||
@@ -121,7 +125,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)
|
static void SystemEvents_UserPreferenceChanged(object sender, UserPreferenceChangedEventArgs e)
|
||||||
{
|
{
|
||||||
@@ -182,8 +198,12 @@ namespace GHelper
|
|||||||
|
|
||||||
private static void SystemEvents_PowerModeChanged(object sender, PowerModeChangedEventArgs e)
|
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;
|
if (SystemInformation.PowerStatus.PowerLineStatus == isPlugged) return;
|
||||||
Logger.WriteLine("Power Mode Changed");
|
|
||||||
SetAutoModes(true);
|
SetAutoModes(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -199,7 +199,7 @@
|
|||||||
<value>唤醒时</value>
|
<value>唤醒时</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="BacklightTimeout" xml:space="preserve">
|
<data name="BacklightTimeout" xml:space="preserve">
|
||||||
<value>插电/电池时背光时间 (0表示长亮)</value>
|
<value>插电/电池时熄灭时间(0表示长亮)</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Balanced" xml:space="preserve">
|
<data name="Balanced" xml:space="preserve">
|
||||||
<value>平衡模式</value>
|
<value>平衡模式</value>
|
||||||
|
|||||||
@@ -223,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
|
### Disable OSD
|
||||||
You can disable app's OSD (for performance modes, keyboard backlight, etc) by adding following line to ``%AppData%\GHelper\config.json``
|
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