This commit is contained in:
Serge
2024-11-06 12:59:58 +01:00
parent 5570513eeb
commit f72e3a69dd
6 changed files with 27 additions and 23 deletions

View File

@@ -648,7 +648,7 @@ namespace GHelper.Ally
if (init)
{
WakeUp();
InputDispatcher.SetBacklightAuto(true);
InputDispatcher.SetBacklightAuto();
}
AsusHid.WriteInput([AsusHid.INPUT_ID, 0xD1, 0x01, 0x01, (byte)_applyMode], "Controller");

View File

@@ -873,11 +873,22 @@ namespace GHelper.Input
return Math.Max(Math.Min(3, backlight), 0);
}
public static void SetBacklightAuto(bool init = false)
public static void AutoKeyboard()
{
if (AppConfig.HasTabletMode()) TabletMode();
if (lidClose || AppConfig.Is("skip_aura")) return;
Aura.Init();
Aura.ApplyPower();
Aura.ApplyAura();
SetBacklightAuto();
}
public static void SetBacklightAuto()
{
if (lidClose) return;
if (init) Aura.Init();
Aura.ApplyBrightness(GetBacklight(), "Auto", init);
Aura.ApplyBrightness(GetBacklight(), "Auto");
}
public static void SetBacklight(int delta, bool force = false)

View File

@@ -6,6 +6,7 @@ using GHelper.Helpers;
using GHelper.Input;
using GHelper.Mode;
using GHelper.Peripherals;
using GHelper.USB;
using Microsoft.Win32;
using Ryzen;
using System.Diagnostics;
@@ -258,9 +259,10 @@ namespace GHelper
}
else
{
settingsForm.AutoKeyboard();
InputDispatcher.AutoKeyboard();
}
XGM.InitLight();
VisualControl.InitBrightness();
return true;

View File

@@ -1541,24 +1541,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)
{

View File

@@ -361,6 +361,11 @@ namespace GHelper.USB
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()
{

View File

@@ -52,6 +52,10 @@ namespace GHelper.USB
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()
{