mirror of
https://github.com/jkocon/g-helper.git
synced 2026-02-23 13:00:52 +01:00
Duo keys
This commit is contained in:
@@ -88,6 +88,11 @@ namespace GHelper
|
||||
}
|
||||
|
||||
private static void Timer_Elapsed(object? sender, System.Timers.ElapsedEventArgs e)
|
||||
{
|
||||
SetHeatmap();
|
||||
}
|
||||
|
||||
static void SetHeatmap(bool init = false)
|
||||
{
|
||||
float cpuTemp = (float)HardwareControl.GetCPUTemp();
|
||||
int freeze = 20, cold = 40, warm = 65, hot = 90;
|
||||
@@ -100,7 +105,7 @@ namespace GHelper
|
||||
else if (cpuTemp < hot) color = ColorUtilities.GetWeightedAverage(Color.Yellow, Color.Red, ((float)cpuTemp - warm) / (hot - warm));
|
||||
else color = Color.Red;
|
||||
|
||||
ApplyColor(color);
|
||||
ApplyColor(color, init);
|
||||
}
|
||||
|
||||
public static Dictionary<int, string> GetSpeeds()
|
||||
@@ -423,8 +428,9 @@ namespace GHelper
|
||||
}
|
||||
}
|
||||
|
||||
public static void ApplyColor(Color color)
|
||||
public static void ApplyColor(Color color, bool init = false)
|
||||
{
|
||||
|
||||
if (isTuf)
|
||||
{
|
||||
Program.acpi.TUFKeyboardRGB(0, color, 0);
|
||||
@@ -441,7 +447,7 @@ namespace GHelper
|
||||
msg[1] = 0xbc;
|
||||
msg[2] = 1;
|
||||
msg[3] = 1;
|
||||
msg[4] = isStrix ? (byte)4 : (byte)0;
|
||||
msg[4] = 4;
|
||||
|
||||
for (int i = 0; i < 10; i++)
|
||||
{
|
||||
@@ -451,6 +457,7 @@ namespace GHelper
|
||||
}
|
||||
|
||||
//Logger.WriteLine(BitConverter.ToString(msg));
|
||||
if (init) auraDevice.Write(new byte[] { AURA_HID_ID ,0xbc});
|
||||
auraDevice.Write(msg);
|
||||
}
|
||||
|
||||
@@ -465,6 +472,7 @@ namespace GHelper
|
||||
|
||||
if (Mode == HEATMAP)
|
||||
{
|
||||
SetHeatmap(true);
|
||||
timer.Enabled = true;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
using GHelper.Helpers;
|
||||
using GHelper.Mode;
|
||||
using Microsoft.Win32;
|
||||
using NAudio.CoreAudioApi;
|
||||
using System.Diagnostics;
|
||||
using System.Management;
|
||||
|
||||
@@ -150,9 +149,10 @@ namespace GHelper.Input
|
||||
|
||||
public static bool NoMKeys()
|
||||
{
|
||||
return AppConfig.ContainsModel("Z13") ||
|
||||
AppConfig.ContainsModel("FA506") ||
|
||||
return AppConfig.ContainsModel("Z13") ||
|
||||
AppConfig.ContainsModel("FA506") ||
|
||||
AppConfig.ContainsModel("FX506") ||
|
||||
AppConfig.ContainsModel("Duo") ||
|
||||
AppConfig.ContainsModel("FX505");
|
||||
}
|
||||
|
||||
@@ -179,7 +179,7 @@ namespace GHelper.Input
|
||||
}
|
||||
}
|
||||
|
||||
if (AppConfig.ContainsModel("Z13"))
|
||||
if (AppConfig.ContainsModel("Z13") || AppConfig.ContainsModel("Duo"))
|
||||
{
|
||||
switch (e.Key)
|
||||
{
|
||||
@@ -534,7 +534,7 @@ namespace GHelper.Input
|
||||
|
||||
AppConfig.Set("screenpad", brightness);
|
||||
|
||||
Program.acpi.DeviceSet(AsusACPI.ScreenPadBrightness, (brightness*255/100), "Screenpad");
|
||||
Program.acpi.DeviceSet(AsusACPI.ScreenPadBrightness, (brightness * 255 / 100), "Screenpad");
|
||||
if (brightness == 0) Program.acpi.DeviceSet(AsusACPI.ScreenPadToggle, brightness, "ScreenpadToggle");
|
||||
|
||||
Program.toast.RunToast($"Screen Pad {brightness}", delta > 0 ? ToastIcon.BrightnessUp : ToastIcon.BrightnessDown);
|
||||
|
||||
Reference in New Issue
Block a user