mirror of
https://github.com/jkocon/g-helper.git
synced 2026-02-23 13:00:52 +01:00
Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f94d76aab9 | ||
|
|
57b896d05a | ||
|
|
27b78ba1cf | ||
|
|
eea453b3c4 | ||
|
|
e5dd7f54af | ||
|
|
149ed7f81b | ||
|
|
88d4e5d3a8 |
@@ -37,6 +37,7 @@ public class AsusACPI
|
||||
|
||||
public const uint UniversalControl = 0x00100021;
|
||||
|
||||
public const int Airplane = 0x88;
|
||||
public const int KB_Light_Up = 0xc4;
|
||||
public const int KB_Light_Down = 0xc5;
|
||||
public const int Brightness_Down = 0x10;
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<ProduceReferenceAssembly>False</ProduceReferenceAssembly>
|
||||
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
|
||||
<AssemblyVersion>0.140</AssemblyVersion>
|
||||
<AssemblyVersion>0.141</AssemblyVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||
|
||||
@@ -584,6 +584,9 @@ namespace GHelper.Input
|
||||
case 55: // Arconym
|
||||
KeyProcess("m6");
|
||||
return;
|
||||
case 136: // FN + F12
|
||||
Program.acpi.DeviceSet(AsusACPI.UniversalControl, AsusACPI.Airplane, "Airplane");
|
||||
return;
|
||||
case 181: // FN + Numpad Enter
|
||||
KeyProcess("fne");
|
||||
return;
|
||||
|
||||
@@ -248,15 +248,12 @@ namespace GHelper.USB
|
||||
|
||||
public static void Init()
|
||||
{
|
||||
Task.Run(async () =>
|
||||
{
|
||||
AsusHid.Write(new List<byte[]> {
|
||||
new byte[] { AsusHid.AURA_ID, 0xb9 },
|
||||
Encoding.ASCII.GetBytes("]ASUS Tech.Inc."),
|
||||
new byte[] { AsusHid.AURA_ID, 0x05, 0x20, 0x31, 0, 0x1a },
|
||||
//Encoding.ASCII.GetBytes("^ASUS Tech.Inc."),
|
||||
//new byte[] { 0x5e, 0x05, 0x20, 0x31, 0, 0x1a }
|
||||
});
|
||||
AsusHid.Write(new List<byte[]> {
|
||||
new byte[] { AsusHid.AURA_ID, 0xb9 },
|
||||
Encoding.ASCII.GetBytes("]ASUS Tech.Inc."),
|
||||
new byte[] { AsusHid.AURA_ID, 0x05, 0x20, 0x31, 0, 0x1a },
|
||||
//Encoding.ASCII.GetBytes("^ASUS Tech.Inc."),
|
||||
//new byte[] { 0x5e, 0x05, 0x20, 0x31, 0, 0x1a }
|
||||
});
|
||||
}
|
||||
|
||||
@@ -523,7 +520,7 @@ namespace GHelper.USB
|
||||
}
|
||||
|
||||
|
||||
public static void ApplyColor(Color color, bool init = false)
|
||||
public static void ApplyDirect(Color color, bool init = false)
|
||||
{
|
||||
|
||||
if (isACPI)
|
||||
@@ -538,22 +535,23 @@ namespace GHelper.USB
|
||||
return;
|
||||
}
|
||||
|
||||
else
|
||||
if (init)
|
||||
{
|
||||
if (init) AsusHid.WriteAura(new byte[] { AsusHid.AURA_ID, 0xbc });
|
||||
|
||||
byte[] buffer = new byte[64];
|
||||
buffer[0] = AsusHid.AURA_ID;
|
||||
buffer[1] = 0xbc;
|
||||
buffer[2] = 1;
|
||||
buffer[3] = 1;
|
||||
buffer[9] = color.R;
|
||||
buffer[10] = color.G;
|
||||
buffer[11] = color.B;
|
||||
|
||||
AsusHid.WriteAura(buffer);
|
||||
Init();
|
||||
AsusHid.WriteAura(new byte[] { AsusHid.AURA_ID, 0xbc, 1 });
|
||||
}
|
||||
|
||||
byte[] buffer = new byte[64];
|
||||
buffer[0] = AsusHid.AURA_ID;
|
||||
buffer[1] = 0xbc;
|
||||
buffer[2] = 1;
|
||||
buffer[3] = 1;
|
||||
buffer[9] = color.R;
|
||||
buffer[10] = color.G;
|
||||
buffer[11] = color.B;
|
||||
|
||||
AsusHid.WriteAura(buffer);
|
||||
|
||||
}
|
||||
|
||||
public static void ApplyAura()
|
||||
@@ -566,6 +564,8 @@ namespace GHelper.USB
|
||||
|
||||
timer.Enabled = false;
|
||||
|
||||
Logger.WriteLine($"AuraMode: {Mode}");
|
||||
|
||||
if (Mode == AuraMode.HEATMAP)
|
||||
{
|
||||
CustomRGB.ApplyHeatmap(true);
|
||||
@@ -578,7 +578,7 @@ namespace GHelper.USB
|
||||
{
|
||||
CustomRGB.ApplyAmbient(true);
|
||||
timer.Enabled = true;
|
||||
timer.Interval = 100;
|
||||
timer.Interval = 120;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -605,18 +605,23 @@ namespace GHelper.USB
|
||||
{
|
||||
if ((AuraMode)AppConfig.Get("aura_mode") != AuraMode.GPUMODE) return;
|
||||
|
||||
Color color;
|
||||
|
||||
switch (GPUModeControl.gpuMode)
|
||||
{
|
||||
case AsusACPI.GPUModeUltimate:
|
||||
ApplyColor(Color.Red, true);
|
||||
color = Color.Red;
|
||||
break;
|
||||
case AsusACPI.GPUModeEco:
|
||||
ApplyColor(Color.Green, true);
|
||||
color = Color.Green;
|
||||
break;
|
||||
default:
|
||||
ApplyColor(Color.Yellow, true);
|
||||
color = Color.Yellow;
|
||||
break;
|
||||
}
|
||||
|
||||
AsusHid.Write(new List<byte[]> { AuraMessage(AuraMode.AuraStatic, color, color, 0xeb, isSingleColor), MESSAGE_APPLY, MESSAGE_SET });
|
||||
|
||||
}
|
||||
|
||||
public static void ApplyHeatmap(bool init = false)
|
||||
@@ -632,7 +637,7 @@ namespace GHelper.USB
|
||||
else if (cpuTemp < hot) color = ColorUtils.GetWeightedAverage(Color.Yellow, Color.Red, ((float)cpuTemp - warm) / (hot - warm));
|
||||
else color = Color.Red;
|
||||
|
||||
ApplyColor(color, init);
|
||||
ApplyDirect(color, init);
|
||||
}
|
||||
|
||||
|
||||
@@ -673,7 +678,7 @@ namespace GHelper.USB
|
||||
screen_low.Dispose();
|
||||
screeb_pxl.Dispose();
|
||||
|
||||
bool is_fresh = false;
|
||||
bool is_fresh = init;
|
||||
|
||||
for (int i = 0; i < zones; i++)
|
||||
{
|
||||
@@ -684,7 +689,7 @@ namespace GHelper.USB
|
||||
if (is_fresh)
|
||||
{
|
||||
if (isStrix) ApplyDirect(AmbientData.result, init);
|
||||
else ApplyColor(AmbientData.result[0], init);
|
||||
else ApplyDirect(AmbientData.result[0], init);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user