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 uint UniversalControl = 0x00100021;
|
||||||
|
|
||||||
|
public const int Airplane = 0x88;
|
||||||
public const int KB_Light_Up = 0xc4;
|
public const int KB_Light_Up = 0xc4;
|
||||||
public const int KB_Light_Down = 0xc5;
|
public const int KB_Light_Down = 0xc5;
|
||||||
public const int Brightness_Down = 0x10;
|
public const int Brightness_Down = 0x10;
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
<ProduceReferenceAssembly>False</ProduceReferenceAssembly>
|
<ProduceReferenceAssembly>False</ProduceReferenceAssembly>
|
||||||
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
|
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
|
||||||
<AssemblyVersion>0.140</AssemblyVersion>
|
<AssemblyVersion>0.141</AssemblyVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||||
|
|||||||
@@ -584,6 +584,9 @@ namespace GHelper.Input
|
|||||||
case 55: // Arconym
|
case 55: // Arconym
|
||||||
KeyProcess("m6");
|
KeyProcess("m6");
|
||||||
return;
|
return;
|
||||||
|
case 136: // FN + F12
|
||||||
|
Program.acpi.DeviceSet(AsusACPI.UniversalControl, AsusACPI.Airplane, "Airplane");
|
||||||
|
return;
|
||||||
case 181: // FN + Numpad Enter
|
case 181: // FN + Numpad Enter
|
||||||
KeyProcess("fne");
|
KeyProcess("fne");
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -248,15 +248,12 @@ namespace GHelper.USB
|
|||||||
|
|
||||||
public static void Init()
|
public static void Init()
|
||||||
{
|
{
|
||||||
Task.Run(async () =>
|
AsusHid.Write(new List<byte[]> {
|
||||||
{
|
new byte[] { AsusHid.AURA_ID, 0xb9 },
|
||||||
AsusHid.Write(new List<byte[]> {
|
Encoding.ASCII.GetBytes("]ASUS Tech.Inc."),
|
||||||
new byte[] { AsusHid.AURA_ID, 0xb9 },
|
new byte[] { AsusHid.AURA_ID, 0x05, 0x20, 0x31, 0, 0x1a },
|
||||||
Encoding.ASCII.GetBytes("]ASUS Tech.Inc."),
|
//Encoding.ASCII.GetBytes("^ASUS Tech.Inc."),
|
||||||
new byte[] { AsusHid.AURA_ID, 0x05, 0x20, 0x31, 0, 0x1a },
|
//new byte[] { 0x5e, 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)
|
if (isACPI)
|
||||||
@@ -538,22 +535,23 @@ namespace GHelper.USB
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
else
|
if (init)
|
||||||
{
|
{
|
||||||
if (init) AsusHid.WriteAura(new byte[] { AsusHid.AURA_ID, 0xbc });
|
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);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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()
|
public static void ApplyAura()
|
||||||
@@ -566,6 +564,8 @@ namespace GHelper.USB
|
|||||||
|
|
||||||
timer.Enabled = false;
|
timer.Enabled = false;
|
||||||
|
|
||||||
|
Logger.WriteLine($"AuraMode: {Mode}");
|
||||||
|
|
||||||
if (Mode == AuraMode.HEATMAP)
|
if (Mode == AuraMode.HEATMAP)
|
||||||
{
|
{
|
||||||
CustomRGB.ApplyHeatmap(true);
|
CustomRGB.ApplyHeatmap(true);
|
||||||
@@ -578,7 +578,7 @@ namespace GHelper.USB
|
|||||||
{
|
{
|
||||||
CustomRGB.ApplyAmbient(true);
|
CustomRGB.ApplyAmbient(true);
|
||||||
timer.Enabled = true;
|
timer.Enabled = true;
|
||||||
timer.Interval = 100;
|
timer.Interval = 120;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -605,18 +605,23 @@ namespace GHelper.USB
|
|||||||
{
|
{
|
||||||
if ((AuraMode)AppConfig.Get("aura_mode") != AuraMode.GPUMODE) return;
|
if ((AuraMode)AppConfig.Get("aura_mode") != AuraMode.GPUMODE) return;
|
||||||
|
|
||||||
|
Color color;
|
||||||
|
|
||||||
switch (GPUModeControl.gpuMode)
|
switch (GPUModeControl.gpuMode)
|
||||||
{
|
{
|
||||||
case AsusACPI.GPUModeUltimate:
|
case AsusACPI.GPUModeUltimate:
|
||||||
ApplyColor(Color.Red, true);
|
color = Color.Red;
|
||||||
break;
|
break;
|
||||||
case AsusACPI.GPUModeEco:
|
case AsusACPI.GPUModeEco:
|
||||||
ApplyColor(Color.Green, true);
|
color = Color.Green;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ApplyColor(Color.Yellow, true);
|
color = Color.Yellow;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
AsusHid.Write(new List<byte[]> { AuraMessage(AuraMode.AuraStatic, color, color, 0xeb, isSingleColor), MESSAGE_APPLY, MESSAGE_SET });
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void ApplyHeatmap(bool init = false)
|
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 if (cpuTemp < hot) color = ColorUtils.GetWeightedAverage(Color.Yellow, Color.Red, ((float)cpuTemp - warm) / (hot - warm));
|
||||||
else color = Color.Red;
|
else color = Color.Red;
|
||||||
|
|
||||||
ApplyColor(color, init);
|
ApplyDirect(color, init);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -673,7 +678,7 @@ namespace GHelper.USB
|
|||||||
screen_low.Dispose();
|
screen_low.Dispose();
|
||||||
screeb_pxl.Dispose();
|
screeb_pxl.Dispose();
|
||||||
|
|
||||||
bool is_fresh = false;
|
bool is_fresh = init;
|
||||||
|
|
||||||
for (int i = 0; i < zones; i++)
|
for (int i = 0; i < zones; i++)
|
||||||
{
|
{
|
||||||
@@ -684,7 +689,7 @@ namespace GHelper.USB
|
|||||||
if (is_fresh)
|
if (is_fresh)
|
||||||
{
|
{
|
||||||
if (isStrix) ApplyDirect(AmbientData.result, init);
|
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