mirror of
https://github.com/jkocon/g-helper.git
synced 2026-02-23 13:00:52 +01:00
Cleanup
This commit is contained in:
@@ -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");
|
||||||
|
|||||||
@@ -873,11 +873,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 (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 (lidClose) return;
|
||||||
if (init) Aura.Init();
|
Aura.ApplyBrightness(GetBacklight(), "Auto");
|
||||||
Aura.ApplyBrightness(GetBacklight(), "Auto", init);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void SetBacklight(int delta, bool force = false)
|
public static void SetBacklight(int delta, bool force = false)
|
||||||
|
|||||||
@@ -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;
|
||||||
@@ -258,9 +259,10 @@ namespace GHelper
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
settingsForm.AutoKeyboard();
|
InputDispatcher.AutoKeyboard();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
XGM.InitLight();
|
||||||
VisualControl.InitBrightness();
|
VisualControl.InitBrightness();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -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)
|
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()
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user