mirror of
https://github.com/jkocon/g-helper.git
synced 2026-02-23 13:00:52 +01:00
Compare commits
63 Commits
Fan-Calibr
...
v0.124
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
524b84fc38 | ||
|
|
3bd59a4c4d | ||
|
|
96f07606f5 | ||
|
|
ea96af51b8 | ||
|
|
0669bcb2d1 | ||
|
|
67a42c4a21 | ||
|
|
de98588235 | ||
|
|
dffb239ea7 | ||
|
|
6a6c1f1455 | ||
|
|
bd3b2647b4 | ||
|
|
cebc42126a | ||
|
|
2985b2f31c | ||
|
|
335f5b38a5 | ||
|
|
4dd9daa95c | ||
|
|
10db075ece | ||
|
|
a800eae020 | ||
|
|
eb21fb2020 | ||
|
|
600e6a9404 | ||
|
|
4b0fbcbf10 | ||
|
|
215aec34b9 | ||
|
|
9cba686a3c | ||
|
|
43a7eb8b32 | ||
|
|
08eb867ae7 | ||
|
|
5c59c34a6c | ||
|
|
ae2dae8a97 | ||
|
|
c06969ba8f | ||
|
|
496d55f88b | ||
|
|
2b16372ec4 | ||
|
|
041aa40a6d | ||
|
|
55c1dd7e16 | ||
|
|
2ec2f669fb | ||
|
|
17ea6157a6 | ||
|
|
d5bdf180a8 | ||
|
|
a7d5ac5de9 | ||
|
|
b103623099 | ||
|
|
751f4d0331 | ||
|
|
1f536d8d84 | ||
|
|
c900121644 | ||
|
|
9ce038fe19 | ||
|
|
1f66038ab9 | ||
|
|
04d2eb53a2 | ||
|
|
f55a3c0824 | ||
|
|
5c5b4f297c | ||
|
|
6f1c2ce7c1 | ||
|
|
e26feb7025 | ||
|
|
fef0042870 | ||
|
|
5a1a303ce7 | ||
|
|
5849dc0ce9 | ||
|
|
31ca13692b | ||
|
|
49cfbc6235 | ||
|
|
b577e5ed90 | ||
|
|
3c9dca0c62 | ||
|
|
818b87fe87 | ||
|
|
e177207799 | ||
|
|
df4cf40a5b | ||
|
|
23082d59ba | ||
|
|
708170b1ef | ||
|
|
3a0131a577 | ||
|
|
d1f4da5473 | ||
|
|
91967638af | ||
|
|
d9a972f6a9 | ||
|
|
ce4c9bb48c | ||
|
|
26c74fa1df |
@@ -356,6 +356,11 @@ public static class AppConfig
|
|||||||
ContainsModel("FX507Z");
|
ContainsModel("FX507Z");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static bool IsFanScale()
|
||||||
|
{
|
||||||
|
return ContainsModel("GU604");
|
||||||
|
}
|
||||||
|
|
||||||
public static bool IsFanRequired()
|
public static bool IsFanRequired()
|
||||||
{
|
{
|
||||||
return ContainsModel("GA402X") || ContainsModel("G513") || ContainsModel("G713R");
|
return ContainsModel("GA402X") || ContainsModel("G513") || ContainsModel("G713R");
|
||||||
|
|||||||
@@ -65,6 +65,7 @@ public class AsusACPI
|
|||||||
public const uint GPUXG = 0x00090019;
|
public const uint GPUXG = 0x00090019;
|
||||||
|
|
||||||
public const uint GPUMux = 0x00090016;
|
public const uint GPUMux = 0x00090016;
|
||||||
|
public const uint GPUMuxVivo = 0x00090026;
|
||||||
|
|
||||||
public const uint BatteryLimit = 0x00120057;
|
public const uint BatteryLimit = 0x00120057;
|
||||||
public const uint ScreenOverdrive = 0x00050019;
|
public const uint ScreenOverdrive = 0x00050019;
|
||||||
@@ -400,7 +401,9 @@ public class AsusACPI
|
|||||||
if (curve.All(singleByte => singleByte == 0)) return -1;
|
if (curve.All(singleByte => singleByte == 0)) return -1;
|
||||||
|
|
||||||
int result;
|
int result;
|
||||||
int fanScale = AppConfig.Get("fan_scale", 100);
|
|
||||||
|
int defaultScale = (AppConfig.IsFanScale() && (device == AsusFan.CPU || device == AsusFan.GPU)) ? 130 : 100;
|
||||||
|
int fanScale = AppConfig.Get("fan_scale", defaultScale);
|
||||||
|
|
||||||
if (fanScale != 100 && device == AsusFan.CPU) Logger.WriteLine("Custom fan scale: " + fanScale);
|
if (fanScale != 100 && device == AsusFan.CPU) Logger.WriteLine("Custom fan scale: " + fanScale);
|
||||||
|
|
||||||
|
|||||||
@@ -333,13 +333,15 @@ namespace GHelper
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static void ApplyBrightness(int brightness, string log = "Backlight")
|
public static void ApplyBrightness(int brightness, string log = "Backlight", bool delay = false)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
Task.Run(async () =>
|
Task.Run(async () =>
|
||||||
{
|
{
|
||||||
|
|
||||||
|
if (delay) await Task.Delay(TimeSpan.FromSeconds(1));
|
||||||
|
|
||||||
if (isTuf) Program.acpi.TUFKeyboardBrightness(brightness);
|
if (isTuf) Program.acpi.TUFKeyboardBrightness(brightness);
|
||||||
|
|
||||||
byte[] msg = { AURA_HID_ID, 0xba, 0xc5, 0xc4, (byte)brightness };
|
byte[] msg = { AURA_HID_ID, 0xba, 0xc5, 0xc4, (byte)brightness };
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ namespace GHelper.Display
|
|||||||
|
|
||||||
public void ToogleMiniled()
|
public void ToogleMiniled()
|
||||||
{
|
{
|
||||||
int miniled = (AppConfig.Get("miniled") == 1) ? 0 : 1;
|
int miniled = (Program.acpi.DeviceGet(AsusACPI.ScreenMiniled) == 1) ? 0 : 1;
|
||||||
AppConfig.Set("miniled", miniled);
|
AppConfig.Set("miniled", miniled);
|
||||||
SetScreen(-1, -1, miniled);
|
SetScreen(-1, -1, miniled);
|
||||||
}
|
}
|
||||||
@@ -77,8 +77,12 @@ namespace GHelper.Display
|
|||||||
int overdrive = Program.acpi.DeviceGet(AsusACPI.ScreenOverdrive);
|
int overdrive = Program.acpi.DeviceGet(AsusACPI.ScreenOverdrive);
|
||||||
int miniled = Program.acpi.DeviceGet(AsusACPI.ScreenMiniled);
|
int miniled = Program.acpi.DeviceGet(AsusACPI.ScreenMiniled);
|
||||||
|
|
||||||
|
bool hdr = false;
|
||||||
|
|
||||||
if (miniled >= 0)
|
if (miniled >= 0)
|
||||||
|
{
|
||||||
AppConfig.Set("miniled", miniled);
|
AppConfig.Set("miniled", miniled);
|
||||||
|
}
|
||||||
|
|
||||||
bool screenEnabled = (frequency >= 0);
|
bool screenEnabled = (frequency >= 0);
|
||||||
|
|
||||||
@@ -94,7 +98,8 @@ namespace GHelper.Display
|
|||||||
maxFrequency: maxFrequency,
|
maxFrequency: maxFrequency,
|
||||||
overdrive: overdrive,
|
overdrive: overdrive,
|
||||||
overdriveSetting: overdriveSetting,
|
overdriveSetting: overdriveSetting,
|
||||||
miniled: miniled
|
miniled: miniled,
|
||||||
|
hdr: hdr
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
using Microsoft.VisualBasic.Logging;
|
using System.Collections;
|
||||||
using System.Collections;
|
using System.Diagnostics;
|
||||||
using System.Diagnostics.Metrics;
|
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
using System.Windows.Forms;
|
|
||||||
using static GHelper.Display.ScreenInterrogatory;
|
using static GHelper.Display.ScreenInterrogatory;
|
||||||
|
|
||||||
namespace GHelper.Display
|
namespace GHelper.Display
|
||||||
|
|||||||
185
app/Fan/FanSensorControl.cs
Normal file
185
app/Fan/FanSensorControl.cs
Normal file
@@ -0,0 +1,185 @@
|
|||||||
|
using GHelper.Mode;
|
||||||
|
|
||||||
|
namespace GHelper.Fan
|
||||||
|
{
|
||||||
|
public class FanSensorControl
|
||||||
|
{
|
||||||
|
public const int DEFAULT_FAN_MIN = 18;
|
||||||
|
public const int DEFAULT_FAN_MAX = 58;
|
||||||
|
|
||||||
|
public const int XGM_FAN_MAX = 72;
|
||||||
|
|
||||||
|
public const int INADEQUATE_MAX = 92;
|
||||||
|
|
||||||
|
const int FAN_COUNT = 3;
|
||||||
|
|
||||||
|
Fans fansForm;
|
||||||
|
ModeControl modeControl = Program.modeControl;
|
||||||
|
|
||||||
|
static int[] measuredMax;
|
||||||
|
static int sameCount = 0;
|
||||||
|
|
||||||
|
static System.Timers.Timer timer = default!;
|
||||||
|
|
||||||
|
static int[] _fanMax = InitFanMax();
|
||||||
|
static bool _fanRpm = AppConfig.IsNotFalse("fan_rpm");
|
||||||
|
|
||||||
|
public FanSensorControl(Fans fansForm)
|
||||||
|
{
|
||||||
|
this.fansForm = fansForm;
|
||||||
|
timer = new System.Timers.Timer(1000);
|
||||||
|
timer.Elapsed += Timer_Elapsed;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int[] InitFanMax()
|
||||||
|
{
|
||||||
|
int[] defaultMax = GetDefaultMax();
|
||||||
|
|
||||||
|
return new int[3] {
|
||||||
|
AppConfig.Get("fan_max_" + (int)AsusFan.CPU, defaultMax[(int)AsusFan.CPU]),
|
||||||
|
AppConfig.Get("fan_max_" + (int)AsusFan.GPU, defaultMax[(int)AsusFan.GPU]),
|
||||||
|
AppConfig.Get("fan_max_" + (int)AsusFan.Mid, defaultMax[(int)AsusFan.Mid])
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static int[] GetDefaultMax()
|
||||||
|
{
|
||||||
|
if (AppConfig.ContainsModel("GA401I")) return new int[3] { 78, 76, DEFAULT_FAN_MAX };
|
||||||
|
if (AppConfig.ContainsModel("GA401")) return new int[3] { 71, 73, DEFAULT_FAN_MAX };
|
||||||
|
if (AppConfig.ContainsModel("GA402")) return new int[3] { 55, 56, DEFAULT_FAN_MAX };
|
||||||
|
|
||||||
|
if (AppConfig.ContainsModel("G513R")) return new int[3] { 58, 60, DEFAULT_FAN_MAX };
|
||||||
|
if (AppConfig.ContainsModel("G513Q")) return new int[3] { 69, 69, DEFAULT_FAN_MAX };
|
||||||
|
if (AppConfig.ContainsModel("GA503")) return new int[3] { 64, 64, DEFAULT_FAN_MAX };
|
||||||
|
|
||||||
|
if (AppConfig.ContainsModel("GU603")) return new int[3] { 62, 64, DEFAULT_FAN_MAX };
|
||||||
|
|
||||||
|
if (AppConfig.ContainsModel("FA507R")) return new int[3] { 63, 57, DEFAULT_FAN_MAX };
|
||||||
|
if (AppConfig.ContainsModel("FA507X")) return new int[3] { 63, 68, DEFAULT_FAN_MAX };
|
||||||
|
|
||||||
|
if (AppConfig.ContainsModel("GX650")) return new int[3] { 62, 62, DEFAULT_FAN_MAX };
|
||||||
|
|
||||||
|
if (AppConfig.ContainsModel("G732")) return new int[3] { 61, 60, DEFAULT_FAN_MAX };
|
||||||
|
if (AppConfig.ContainsModel("G713")) return new int[3] { 56, 60, DEFAULT_FAN_MAX };
|
||||||
|
|
||||||
|
if (AppConfig.ContainsModel("Z301")) return new int[3] { 72, 64, DEFAULT_FAN_MAX };
|
||||||
|
|
||||||
|
if (AppConfig.ContainsModel("GV601")) return new int[3] { 78, 59, 85 };
|
||||||
|
|
||||||
|
return new int[3] { DEFAULT_FAN_MAX, DEFAULT_FAN_MAX, DEFAULT_FAN_MAX };
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int GetFanMax(AsusFan device)
|
||||||
|
{
|
||||||
|
if (device == AsusFan.XGM) return XGM_FAN_MAX;
|
||||||
|
|
||||||
|
if (_fanMax[(int)device] < 0 || _fanMax[(int)device] > INADEQUATE_MAX)
|
||||||
|
SetFanMax(device, DEFAULT_FAN_MAX);
|
||||||
|
|
||||||
|
return _fanMax[(int)device];
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void SetFanMax(AsusFan device, int value)
|
||||||
|
{
|
||||||
|
_fanMax[(int)device] = value;
|
||||||
|
AppConfig.Set("fan_max_" + (int)device, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static bool fanRpm
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return _fanRpm;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
AppConfig.Set("fan_rpm", value ? 1 : 0);
|
||||||
|
_fanRpm = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static string FormatFan(AsusFan device, int value)
|
||||||
|
{
|
||||||
|
if (value < 0) return null;
|
||||||
|
|
||||||
|
if (value > GetFanMax(device) && value <= INADEQUATE_MAX) SetFanMax(device, value);
|
||||||
|
|
||||||
|
if (fanRpm)
|
||||||
|
return Properties.Strings.FanSpeed + ": " + (value * 100).ToString() + "RPM";
|
||||||
|
else
|
||||||
|
return Properties.Strings.FanSpeed + ": " + Math.Min(Math.Round((float)value / GetFanMax(device) * 100), 100).ToString() + "%"; // relatively to max RPM
|
||||||
|
}
|
||||||
|
|
||||||
|
public void StartCalibration()
|
||||||
|
{
|
||||||
|
|
||||||
|
measuredMax = new int[] { 0, 0, 0 };
|
||||||
|
timer.Enabled = true;
|
||||||
|
|
||||||
|
for (int i = 0; i < FAN_COUNT; i++)
|
||||||
|
AppConfig.Remove("fan_max_" + i);
|
||||||
|
|
||||||
|
Program.acpi.DeviceSet(AsusACPI.PerformanceMode, AsusACPI.PerformanceTurbo, "ModeCalibration");
|
||||||
|
|
||||||
|
for (int i = 0; i < FAN_COUNT; i++)
|
||||||
|
Program.acpi.SetFanCurve((AsusFan)i, new byte[] { 20, 30, 40, 50, 60, 70, 80, 90, 100, 100, 100, 100, 100, 100, 100, 100 });
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Timer_Elapsed(object? sender, System.Timers.ElapsedEventArgs e)
|
||||||
|
{
|
||||||
|
int fan;
|
||||||
|
bool same = true;
|
||||||
|
|
||||||
|
for (int i = 0; i < FAN_COUNT; i++)
|
||||||
|
{
|
||||||
|
fan = Program.acpi.GetFan((AsusFan)i);
|
||||||
|
if (fan > measuredMax[i])
|
||||||
|
{
|
||||||
|
measuredMax[i] = fan;
|
||||||
|
same = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (same) sameCount++;
|
||||||
|
else sameCount = 0;
|
||||||
|
|
||||||
|
string label = "Measuring Max Speed - CPU: " + measuredMax[(int)AsusFan.CPU] * 100 + ", GPU: " + measuredMax[(int)AsusFan.GPU] * 100;
|
||||||
|
if (measuredMax[(int)AsusFan.Mid] > 10) label = label + ", Mid: " + measuredMax[(int)AsusFan.Mid] * 100;
|
||||||
|
label = label + " (" + sameCount + "s)";
|
||||||
|
|
||||||
|
fansForm.LabelFansResult(label);
|
||||||
|
|
||||||
|
if (sameCount >= 15)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < FAN_COUNT; i++)
|
||||||
|
{
|
||||||
|
if (measuredMax[i] > 30 && measuredMax[i] < INADEQUATE_MAX) SetFanMax((AsusFan)i, measuredMax[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
sameCount = 0;
|
||||||
|
FinishCalibration();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void FinishCalibration()
|
||||||
|
{
|
||||||
|
|
||||||
|
timer.Enabled = false;
|
||||||
|
modeControl.SetPerformanceMode();
|
||||||
|
|
||||||
|
string label = "Measured - CPU: " + AppConfig.Get("fan_max_" + (int)AsusFan.CPU) * 100;
|
||||||
|
|
||||||
|
if (AppConfig.Get("fan_max_" + (int)AsusFan.GPU) > 0)
|
||||||
|
label = label + ", GPU: " + AppConfig.Get("fan_max_" + (int)AsusFan.GPU) * 100;
|
||||||
|
|
||||||
|
if (AppConfig.Get("fan_max_" + (int)AsusFan.Mid) > 0)
|
||||||
|
label = label + ", Mid: " + AppConfig.Get("fan_max_" + (int)AsusFan.Mid) * 100;
|
||||||
|
|
||||||
|
fansForm.LabelFansResult(label);
|
||||||
|
fansForm.InitAxis();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
4
app/Fans.Designer.cs
generated
4
app/Fans.Designer.cs
generated
@@ -430,7 +430,7 @@ namespace GHelper
|
|||||||
buttonCalibrate.BorderColor = Color.Transparent;
|
buttonCalibrate.BorderColor = Color.Transparent;
|
||||||
buttonCalibrate.BorderRadius = 2;
|
buttonCalibrate.BorderRadius = 2;
|
||||||
buttonCalibrate.FlatStyle = FlatStyle.Flat;
|
buttonCalibrate.FlatStyle = FlatStyle.Flat;
|
||||||
buttonCalibrate.Location = new Point(239, 40);
|
buttonCalibrate.Location = new Point(275, 40);
|
||||||
buttonCalibrate.Margin = new Padding(4, 2, 4, 2);
|
buttonCalibrate.Margin = new Padding(4, 2, 4, 2);
|
||||||
buttonCalibrate.Name = "buttonCalibrate";
|
buttonCalibrate.Name = "buttonCalibrate";
|
||||||
buttonCalibrate.Secondary = true;
|
buttonCalibrate.Secondary = true;
|
||||||
@@ -476,7 +476,7 @@ namespace GHelper
|
|||||||
buttonReset.Margin = new Padding(4, 2, 4, 2);
|
buttonReset.Margin = new Padding(4, 2, 4, 2);
|
||||||
buttonReset.Name = "buttonReset";
|
buttonReset.Name = "buttonReset";
|
||||||
buttonReset.Secondary = true;
|
buttonReset.Secondary = true;
|
||||||
buttonReset.Size = new Size(216, 50);
|
buttonReset.Size = new Size(252, 50);
|
||||||
buttonReset.TabIndex = 18;
|
buttonReset.TabIndex = 18;
|
||||||
buttonReset.Text = Properties.Strings.FactoryDefaults;
|
buttonReset.Text = Properties.Strings.FactoryDefaults;
|
||||||
buttonReset.UseVisualStyleBackColor = false;
|
buttonReset.UseVisualStyleBackColor = false;
|
||||||
|
|||||||
119
app/Fans.cs
119
app/Fans.cs
@@ -1,4 +1,5 @@
|
|||||||
using GHelper.Gpu.NVidia;
|
using GHelper.Fan;
|
||||||
|
using GHelper.Gpu.NVidia;
|
||||||
using GHelper.Mode;
|
using GHelper.Mode;
|
||||||
using GHelper.UI;
|
using GHelper.UI;
|
||||||
using Ryzen;
|
using Ryzen;
|
||||||
@@ -26,13 +27,15 @@ namespace GHelper
|
|||||||
NvidiaGpuControl? nvControl = null;
|
NvidiaGpuControl? nvControl = null;
|
||||||
ModeControl modeControl = Program.modeControl;
|
ModeControl modeControl = Program.modeControl;
|
||||||
|
|
||||||
public static System.Timers.Timer timer = default!;
|
FanSensorControl fanSensorControl;
|
||||||
|
|
||||||
public Fans()
|
public Fans()
|
||||||
{
|
{
|
||||||
|
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
|
||||||
|
fanSensorControl = new FanSensorControl(this);
|
||||||
|
|
||||||
//float dpi = ControlHelper.GetDpiScale(this).Value;
|
//float dpi = ControlHelper.GetDpiScale(this).Value;
|
||||||
//comboModes.Size = new Size(comboModes.Width, (int)dpi * 18);
|
//comboModes.Size = new Size(comboModes.Width, (int)dpi * 18);
|
||||||
comboModes.ClientSize = new Size(comboModes.Width, comboModes.Height - 4);
|
comboModes.ClientSize = new Size(comboModes.Width, comboModes.Height - 4);
|
||||||
@@ -200,96 +203,22 @@ namespace GHelper
|
|||||||
|
|
||||||
checkApplyUV.Click += CheckApplyUV_Click;
|
checkApplyUV.Click += CheckApplyUV_Click;
|
||||||
|
|
||||||
timer = new System.Timers.Timer(1000);
|
|
||||||
timer.Elapsed += Timer_Elapsed;
|
|
||||||
buttonCalibrate.Click += ButtonCalibrate_Click;
|
buttonCalibrate.Click += ButtonCalibrate_Click;
|
||||||
|
|
||||||
ToggleNavigation(0);
|
ToggleNavigation(0);
|
||||||
|
|
||||||
|
if (Program.acpi.DeviceGet(AsusACPI.DevsCPUFanCurve) < 0) buttonCalibrate.Visible = false;
|
||||||
|
|
||||||
FormClosed += Fans_FormClosed;
|
FormClosed += Fans_FormClosed;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const int FAN_COUNT = 3;
|
|
||||||
static int[] fanMax;
|
|
||||||
static int sameCount = 0;
|
|
||||||
|
|
||||||
private void Timer_Elapsed(object? sender, System.Timers.ElapsedEventArgs e)
|
|
||||||
{
|
|
||||||
int fan;
|
|
||||||
bool same = true;
|
|
||||||
|
|
||||||
for (int i = 0; i < FAN_COUNT; i++)
|
|
||||||
{
|
|
||||||
fan = Program.acpi.GetFan((AsusFan)i);
|
|
||||||
if (fan > fanMax[i])
|
|
||||||
{
|
|
||||||
fanMax[i] = fan;
|
|
||||||
same = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (same) sameCount++;
|
|
||||||
else sameCount = 0;
|
|
||||||
|
|
||||||
LabelFansResult("Max Speed - CPU: " + fanMax[(int)AsusFan.CPU] * 100 + ", GPU: " + fanMax[(int)AsusFan.GPU] * 100 + " (" + sameCount + "s)");
|
|
||||||
|
|
||||||
if (sameCount >= 15)
|
|
||||||
{
|
|
||||||
for (int i = 0; i < FAN_COUNT; i++)
|
|
||||||
{
|
|
||||||
if (fanMax[i] > 30 && fanMax[i] < 80) AppConfig.Set("fan_max_" + i, fanMax[i]);
|
|
||||||
}
|
|
||||||
|
|
||||||
sameCount = 0;
|
|
||||||
CalibrateNext();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
private void CalibrateNext()
|
|
||||||
{
|
|
||||||
|
|
||||||
timer.Enabled = false;
|
|
||||||
modeControl.SetPerformanceMode();
|
|
||||||
|
|
||||||
string label = "Measured - CPU: " + AppConfig.Get("fan_max_" + (int)AsusFan.CPU) * 100;
|
|
||||||
|
|
||||||
if (AppConfig.Get("fan_max_" + (int)AsusFan.GPU) > 0)
|
|
||||||
label = label + ", GPU: " + AppConfig.Get("fan_max_" + (int)AsusFan.GPU) * 100;
|
|
||||||
|
|
||||||
if (AppConfig.Get("fan_max_" + (int)AsusFan.Mid) > 0)
|
|
||||||
label = label + ", Mid: " + AppConfig.Get("fan_max_" + (int)AsusFan.Mid) * 100;
|
|
||||||
|
|
||||||
LabelFansResult(label);
|
|
||||||
|
|
||||||
Invoke(delegate
|
|
||||||
{
|
|
||||||
buttonCalibrate.Enabled = true;
|
|
||||||
SetAxis(chartCPU, AsusFan.CPU);
|
|
||||||
SetAxis(chartGPU, AsusFan.GPU);
|
|
||||||
if (chartMid.Visible) SetAxis(chartMid, AsusFan.Mid);
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
private void ButtonCalibrate_Click(object? sender, EventArgs e)
|
private void ButtonCalibrate_Click(object? sender, EventArgs e)
|
||||||
{
|
{
|
||||||
fanMax = new int[] { 0, 0, 0 };
|
|
||||||
|
|
||||||
buttonCalibrate.Enabled = false;
|
buttonCalibrate.Enabled = false;
|
||||||
timer.Enabled = true;
|
fanSensorControl.StartCalibration();
|
||||||
|
|
||||||
for (int i = 0; i < FAN_COUNT; i++)
|
|
||||||
{
|
|
||||||
AppConfig.Remove("fan_max_" + i);
|
|
||||||
}
|
|
||||||
|
|
||||||
Program.acpi.DeviceSet(AsusACPI.PerformanceMode, AsusACPI.PerformanceTurbo, "ModeCalibration");
|
|
||||||
|
|
||||||
for (int i = 0; i < FAN_COUNT; i++)
|
|
||||||
Program.acpi.SetFanCurve((AsusFan)i, new byte[] { 20, 30, 40, 50, 60, 70, 80, 90, 100, 100, 100, 100, 100, 100, 100, 100 });
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ChartCPU_MouseClick(object? sender, MouseEventArgs e)
|
private void ChartCPU_MouseClick(object? sender, MouseEventArgs e)
|
||||||
@@ -660,10 +589,8 @@ namespace GHelper
|
|||||||
{
|
{
|
||||||
if (percentage == 0) return "OFF";
|
if (percentage == 0) return "OFF";
|
||||||
|
|
||||||
int Min = HardwareControl.DEFAULT_FAN_MIN;
|
int Min = FanSensorControl.DEFAULT_FAN_MIN;
|
||||||
int Max = AppConfig.Get("fan_max_" + (int)device, HardwareControl.DEFAULT_FAN_MAX);
|
int Max = FanSensorControl.GetFanMax(device);
|
||||||
|
|
||||||
if (device == AsusFan.XGM) Max = 72;
|
|
||||||
|
|
||||||
if (fanRpm)
|
if (fanRpm)
|
||||||
return (200 * Math.Round((float)(Min * 100 + (Max - Min) * percentage) / 200)).ToString() + unit;
|
return (200 * Math.Round((float)(Min * 100 + (Max - Min) * percentage) / 200)).ToString() + unit;
|
||||||
@@ -765,7 +692,14 @@ namespace GHelper
|
|||||||
comboBoost.SelectedIndex = Math.Min(boost, comboBoost.Items.Count - 1);
|
comboBoost.SelectedIndex = Math.Min(boost, comboBoost.Items.Count - 1);
|
||||||
|
|
||||||
string powerMode = PowerNative.GetPowerMode();
|
string powerMode = PowerNative.GetPowerMode();
|
||||||
comboPowerMode.SelectedValue = powerMode;
|
bool batterySaver = PowerNative.GetBatterySaverStatus();
|
||||||
|
|
||||||
|
comboPowerMode.Enabled = !batterySaver;
|
||||||
|
|
||||||
|
if (batterySaver)
|
||||||
|
comboPowerMode.SelectedIndex = 0;
|
||||||
|
else
|
||||||
|
comboPowerMode.SelectedValue = powerMode;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -809,9 +743,25 @@ namespace GHelper
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void InitAxis()
|
||||||
|
{
|
||||||
|
if (this == null || this.Text == "") return;
|
||||||
|
|
||||||
|
Invoke(delegate
|
||||||
|
{
|
||||||
|
buttonCalibrate.Enabled = true;
|
||||||
|
SetAxis(chartCPU, AsusFan.CPU);
|
||||||
|
SetAxis(chartGPU, AsusFan.GPU);
|
||||||
|
if (chartMid.Visible) SetAxis(chartMid, AsusFan.Mid);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
public void LabelFansResult(string text)
|
public void LabelFansResult(string text)
|
||||||
{
|
{
|
||||||
|
if (text.Length > 0) Logger.WriteLine(text);
|
||||||
|
|
||||||
|
if (this == null || this.Text == "") return;
|
||||||
|
|
||||||
Invoke(delegate
|
Invoke(delegate
|
||||||
{
|
{
|
||||||
labelFansResult.Text = text;
|
labelFansResult.Text = text;
|
||||||
@@ -821,7 +771,6 @@ namespace GHelper
|
|||||||
|
|
||||||
private void Fans_FormClosing(object? sender, FormClosingEventArgs e)
|
private void Fans_FormClosing(object? sender, FormClosingEventArgs e)
|
||||||
{
|
{
|
||||||
|
|
||||||
/*
|
/*
|
||||||
if (e.CloseReason == CloseReason.UserClosing)
|
if (e.CloseReason == CloseReason.UserClosing)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
<ProduceReferenceAssembly>False</ProduceReferenceAssembly>
|
<ProduceReferenceAssembly>False</ProduceReferenceAssembly>
|
||||||
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
|
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
|
||||||
<AssemblyVersion>0.120</AssemblyVersion>
|
<AssemblyVersion>0.124</AssemblyVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||||
|
|||||||
@@ -24,9 +24,13 @@ namespace GHelper.Gpu
|
|||||||
int eco = Program.acpi.DeviceGet(AsusACPI.GPUEco);
|
int eco = Program.acpi.DeviceGet(AsusACPI.GPUEco);
|
||||||
int mux = Program.acpi.DeviceGet(AsusACPI.GPUMux);
|
int mux = Program.acpi.DeviceGet(AsusACPI.GPUMux);
|
||||||
|
|
||||||
|
if (mux < 0) mux = Program.acpi.DeviceGet(AsusACPI.GPUMuxVivo);
|
||||||
|
|
||||||
Logger.WriteLine("Eco flag : " + eco);
|
Logger.WriteLine("Eco flag : " + eco);
|
||||||
Logger.WriteLine("Mux flag : " + mux);
|
Logger.WriteLine("Mux flag : " + mux);
|
||||||
|
|
||||||
|
settings.VisualiseGPUButtons(eco >= 0, mux >= 0);
|
||||||
|
|
||||||
if (mux == 0)
|
if (mux == 0)
|
||||||
{
|
{
|
||||||
gpuMode = AsusACPI.GPUModeUltimate;
|
gpuMode = AsusACPI.GPUModeUltimate;
|
||||||
@@ -38,9 +42,6 @@ namespace GHelper.Gpu
|
|||||||
else
|
else
|
||||||
gpuMode = AsusACPI.GPUModeStandard;
|
gpuMode = AsusACPI.GPUModeStandard;
|
||||||
|
|
||||||
// Ultimate mode not supported
|
|
||||||
if (mux != 1) settings.HideUltimateMode();
|
|
||||||
|
|
||||||
// GPU mode not supported
|
// GPU mode not supported
|
||||||
if (eco < 0 && mux < 0)
|
if (eco < 0 && mux < 0)
|
||||||
{
|
{
|
||||||
@@ -73,12 +74,15 @@ namespace GHelper.Gpu
|
|||||||
var restart = false;
|
var restart = false;
|
||||||
var changed = false;
|
var changed = false;
|
||||||
|
|
||||||
|
int status;
|
||||||
|
|
||||||
if (CurrentGPU == AsusACPI.GPUModeUltimate)
|
if (CurrentGPU == AsusACPI.GPUModeUltimate)
|
||||||
{
|
{
|
||||||
DialogResult dialogResult = MessageBox.Show(Properties.Strings.AlertUltimateOff, Properties.Strings.AlertUltimateTitle, MessageBoxButtons.YesNo);
|
DialogResult dialogResult = MessageBox.Show(Properties.Strings.AlertUltimateOff, Properties.Strings.AlertUltimateTitle, MessageBoxButtons.YesNo);
|
||||||
if (dialogResult == DialogResult.Yes)
|
if (dialogResult == DialogResult.Yes)
|
||||||
{
|
{
|
||||||
Program.acpi.DeviceSet(AsusACPI.GPUMux, 1, "GPUMux");
|
status = Program.acpi.DeviceSet(AsusACPI.GPUMux, 1, "GPUMux");
|
||||||
|
if (status != 1) Program.acpi.DeviceSet(AsusACPI.GPUMuxVivo, 1, "GPUMuxVivo");
|
||||||
restart = true;
|
restart = true;
|
||||||
changed = true;
|
changed = true;
|
||||||
}
|
}
|
||||||
@@ -93,7 +97,8 @@ namespace GHelper.Gpu
|
|||||||
Program.acpi.SetGPUEco(0);
|
Program.acpi.SetGPUEco(0);
|
||||||
Thread.Sleep(100);
|
Thread.Sleep(100);
|
||||||
}
|
}
|
||||||
Program.acpi.DeviceSet(AsusACPI.GPUMux, 0, "GPUMux");
|
status = Program.acpi.DeviceSet(AsusACPI.GPUMux, 0, "GPUMux");
|
||||||
|
if (status != 1) Program.acpi.DeviceSet(AsusACPI.GPUMuxVivo, 0, "GPUMuxVivo");
|
||||||
restart = true;
|
restart = true;
|
||||||
changed = true;
|
changed = true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using GHelper;
|
using GHelper;
|
||||||
|
using GHelper.Fan;
|
||||||
using GHelper.Gpu;
|
using GHelper.Gpu;
|
||||||
using GHelper.Gpu.NVidia;
|
using GHelper.Gpu.NVidia;
|
||||||
using GHelper.Gpu.AMD;
|
using GHelper.Gpu.AMD;
|
||||||
@@ -10,11 +11,6 @@ using System.Management;
|
|||||||
public static class HardwareControl
|
public static class HardwareControl
|
||||||
{
|
{
|
||||||
|
|
||||||
public const int DEFAULT_FAN_MIN = 18;
|
|
||||||
public const int DEFAULT_FAN_MAX = 58;
|
|
||||||
|
|
||||||
const int INADEQUATE_MAX = 72;
|
|
||||||
|
|
||||||
public static IGpuControl? GpuControl;
|
public static IGpuControl? GpuControl;
|
||||||
|
|
||||||
public static float? cpuTemp = -1;
|
public static float? cpuTemp = -1;
|
||||||
@@ -37,62 +33,6 @@ public static class HardwareControl
|
|||||||
|
|
||||||
static long lastUpdate;
|
static long lastUpdate;
|
||||||
|
|
||||||
static int[] _fanMax = new int[3] { DEFAULT_FAN_MAX, DEFAULT_FAN_MAX, DEFAULT_FAN_MAX };
|
|
||||||
static bool _fanRpm = false;
|
|
||||||
|
|
||||||
public static int GetFanMax(AsusFan device)
|
|
||||||
{
|
|
||||||
return _fanMax[(int)device];
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void SetFanMax(AsusFan device, int value)
|
|
||||||
{
|
|
||||||
AppConfig.Set("fan_max_" + (int)device, value);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static bool fanRpm
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return _fanRpm;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
AppConfig.Set("fan_rpm", value ? 1 : 0);
|
|
||||||
_fanRpm = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static HardwareControl()
|
|
||||||
{
|
|
||||||
for (int i = 0; i < 3; i++)
|
|
||||||
{
|
|
||||||
_fanMax[i] = AppConfig.Get("fan_max_" + i);
|
|
||||||
|
|
||||||
if (_fanMax[i] > INADEQUATE_MAX) _fanMax[i] = -1; // skipping inadvequate settings
|
|
||||||
|
|
||||||
if (_fanMax[i] < 0 && AppConfig.ContainsModel("401")) _fanMax[i] = 72;
|
|
||||||
if (_fanMax[i] < 0 && AppConfig.ContainsModel("503")) _fanMax[i] = 68;
|
|
||||||
if (_fanMax[i] < 0) _fanMax[i] = DEFAULT_FAN_MAX;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
_fanRpm = AppConfig.IsNotFalse("fan_rpm");
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public static string FormatFan(AsusFan device, int value)
|
|
||||||
{
|
|
||||||
if (value < 0) return null;
|
|
||||||
|
|
||||||
if (value > GetFanMax(device) && value <= INADEQUATE_MAX) SetFanMax(device, value);
|
|
||||||
|
|
||||||
if (fanRpm)
|
|
||||||
return GHelper.Properties.Strings.FanSpeed + ": " + (value * 100).ToString() + "RPM";
|
|
||||||
else
|
|
||||||
return GHelper.Properties.Strings.FanSpeed + ": " + Math.Min(Math.Round((float)value / GetFanMax(device) * 100), 100).ToString() + "%"; // relatively to 6000 rpm
|
|
||||||
}
|
|
||||||
|
|
||||||
private static int GetGpuUse()
|
private static int GetGpuUse()
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
@@ -245,9 +185,9 @@ public static class HardwareControl
|
|||||||
gpuTemp = -1;
|
gpuTemp = -1;
|
||||||
gpuUse = -1;
|
gpuUse = -1;
|
||||||
|
|
||||||
cpuFan = FormatFan(AsusFan.CPU, Program.acpi.GetFan(AsusFan.CPU));
|
cpuFan = FanSensorControl.FormatFan(AsusFan.CPU, Program.acpi.GetFan(AsusFan.CPU));
|
||||||
gpuFan = FormatFan(AsusFan.GPU, Program.acpi.GetFan(AsusFan.GPU));
|
gpuFan = FanSensorControl.FormatFan(AsusFan.GPU, Program.acpi.GetFan(AsusFan.GPU));
|
||||||
midFan = FormatFan(AsusFan.Mid, Program.acpi.GetFan(AsusFan.Mid));
|
midFan = FanSensorControl.FormatFan(AsusFan.Mid, Program.acpi.GetFan(AsusFan.Mid));
|
||||||
|
|
||||||
cpuTemp = GetCPUTemp();
|
cpuTemp = GetCPUTemp();
|
||||||
|
|
||||||
@@ -327,6 +267,7 @@ public static class HardwareControl
|
|||||||
if (_gpuControl.IsValid)
|
if (_gpuControl.IsValid)
|
||||||
{
|
{
|
||||||
GpuControl = _gpuControl;
|
GpuControl = _gpuControl;
|
||||||
|
if (GpuControl.FullName.Contains("6850M")) AppConfig.Set("xgm_special", 1);
|
||||||
Logger.WriteLine(GpuControl.FullName);
|
Logger.WriteLine(GpuControl.FullName);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -168,7 +168,7 @@ namespace GHelper.Input
|
|||||||
static void SetBrightness(int delta)
|
static void SetBrightness(int delta)
|
||||||
{
|
{
|
||||||
int brightness = -1;
|
int brightness = -1;
|
||||||
|
|
||||||
if (isTUF) brightness = ScreenBrightness.Get();
|
if (isTUF) brightness = ScreenBrightness.Get();
|
||||||
if (AppConfig.SwappedBrightness()) delta = -delta;
|
if (AppConfig.SwappedBrightness()) delta = -delta;
|
||||||
|
|
||||||
@@ -182,7 +182,7 @@ namespace GHelper.Input
|
|||||||
|
|
||||||
Thread.Sleep(100);
|
Thread.Sleep(100);
|
||||||
if (brightness == ScreenBrightness.Get())
|
if (brightness == ScreenBrightness.Get())
|
||||||
Program.toast.RunToast(ScreenBrightness.Adjust(delta) + "%", (delta < 0 ) ? ToastIcon.BrightnessDown : ToastIcon.BrightnessUp);
|
Program.toast.RunToast(ScreenBrightness.Adjust(delta) + "%", (delta < 0) ? ToastIcon.BrightnessDown : ToastIcon.BrightnessUp);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -388,10 +388,17 @@ namespace GHelper.Input
|
|||||||
modeControl.CyclePerformanceMode(Control.ModifierKeys == Keys.Shift);
|
modeControl.CyclePerformanceMode(Control.ModifierKeys == Keys.Shift);
|
||||||
break;
|
break;
|
||||||
case "ghelper":
|
case "ghelper":
|
||||||
Program.settingsForm.BeginInvoke(delegate
|
try
|
||||||
{
|
{
|
||||||
Program.SettingsToggle();
|
Program.settingsForm.BeginInvoke(delegate
|
||||||
});
|
{
|
||||||
|
Program.SettingsToggle();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Debug.WriteLine(ex);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case "fnlock":
|
case "fnlock":
|
||||||
ToggleFnLock();
|
ToggleFnLock();
|
||||||
@@ -433,6 +440,11 @@ namespace GHelper.Input
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void ToggleTouchpad()
|
||||||
|
{
|
||||||
|
KeyboardHook.KeyCtrlWinPress(Keys.F24);
|
||||||
|
}
|
||||||
|
|
||||||
public static void ToggleArrowLock()
|
public static void ToggleArrowLock()
|
||||||
{
|
{
|
||||||
int arLock = AppConfig.Is("arrow_lock") ? 0 : 1;
|
int arLock = AppConfig.Is("arrow_lock") ? 0 : 1;
|
||||||
@@ -476,7 +488,7 @@ namespace GHelper.Input
|
|||||||
// We'll special-case the translation of those.
|
// We'll special-case the translation of those.
|
||||||
if (AppConfig.IsAlly())
|
if (AppConfig.IsAlly())
|
||||||
{
|
{
|
||||||
switch(EventID)
|
switch (EventID)
|
||||||
{
|
{
|
||||||
|
|
||||||
// This is both the M1 and M2 keys.
|
// This is both the M1 and M2 keys.
|
||||||
@@ -566,7 +578,7 @@ namespace GHelper.Input
|
|||||||
Program.acpi.DeviceSet(AsusACPI.UniversalControl, AsusACPI.Brightness_Up, "Brightness");
|
Program.acpi.DeviceSet(AsusACPI.UniversalControl, AsusACPI.Brightness_Up, "Brightness");
|
||||||
break;
|
break;
|
||||||
case 107: // FN+F10
|
case 107: // FN+F10
|
||||||
AsusUSB.TouchpadToggle();
|
ToggleTouchpad();
|
||||||
Thread.Sleep(200);
|
Thread.Sleep(200);
|
||||||
Program.toast.RunToast(GetTouchpadState() ? "On" : "Off", ToastIcon.Touchpad);
|
Program.toast.RunToast(GetTouchpadState() ? "On" : "Off", ToastIcon.Touchpad);
|
||||||
break;
|
break;
|
||||||
@@ -599,9 +611,7 @@ namespace GHelper.Input
|
|||||||
public static void SetBacklightAuto(bool init = false)
|
public static void SetBacklightAuto(bool init = false)
|
||||||
{
|
{
|
||||||
if (init) AsusUSB.Init();
|
if (init) AsusUSB.Init();
|
||||||
|
AsusUSB.ApplyBrightness(GetBacklight(), "Auto", init);
|
||||||
//if (!OptimizationService.IsRunning())
|
|
||||||
AsusUSB.ApplyBrightness(GetBacklight(), "Auto");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void SetBacklight(int delta, bool force = false)
|
public static void SetBacklight(int delta, bool force = false)
|
||||||
@@ -645,7 +655,8 @@ namespace GHelper.Input
|
|||||||
else if (brightness >= 100) brightness = 0;
|
else if (brightness >= 100) brightness = 0;
|
||||||
else brightness = -10;
|
else brightness = -10;
|
||||||
|
|
||||||
} else
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
brightness = Math.Max(Math.Min(100, brightness + delta), -10);
|
brightness = Math.Max(Math.Min(100, brightness + delta), -10);
|
||||||
}
|
}
|
||||||
@@ -654,9 +665,9 @@ namespace GHelper.Input
|
|||||||
|
|
||||||
if (brightness >= 0) Program.acpi.DeviceSet(AsusACPI.ScreenPadToggle, 1, "ScreenpadOn");
|
if (brightness >= 0) Program.acpi.DeviceSet(AsusACPI.ScreenPadToggle, 1, "ScreenpadOn");
|
||||||
|
|
||||||
Program.acpi.DeviceSet(AsusACPI.ScreenPadBrightness, Math.Max(brightness * 255 / 100, 0 ), "Screenpad");
|
Program.acpi.DeviceSet(AsusACPI.ScreenPadBrightness, Math.Max(brightness * 255 / 100, 0), "Screenpad");
|
||||||
|
|
||||||
if (brightness < 0) Program.acpi.DeviceSet(AsusACPI.ScreenPadToggle, 0, "ScreenpadOff");
|
if (brightness < 0) Program.acpi.DeviceSet(AsusACPI.ScreenPadToggle, 0, "ScreenpadOff");
|
||||||
|
|
||||||
string toast;
|
string toast;
|
||||||
|
|
||||||
@@ -677,11 +688,14 @@ namespace GHelper.Input
|
|||||||
|
|
||||||
//string executable = command.Split(' ')[0];
|
//string executable = command.Split(' ')[0];
|
||||||
//string arguments = command.Substring(executable.Length).Trim();
|
//string arguments = command.Substring(executable.Length).Trim();
|
||||||
|
ProcessStartInfo startInfo = new ProcessStartInfo("cmd", "/C " + command);
|
||||||
|
|
||||||
|
startInfo.RedirectStandardOutput = true;
|
||||||
|
startInfo.RedirectStandardError = true;
|
||||||
|
startInfo.UseShellExecute = false;
|
||||||
|
startInfo.CreateNoWindow = true;
|
||||||
|
|
||||||
ProcessStartInfo startInfo = new ProcessStartInfo();
|
|
||||||
startInfo.UseShellExecute = true;
|
|
||||||
startInfo.WorkingDirectory = Environment.CurrentDirectory;
|
startInfo.WorkingDirectory = Environment.CurrentDirectory;
|
||||||
startInfo.FileName = command;
|
|
||||||
//startInfo.Arguments = arguments;
|
//startInfo.Arguments = arguments;
|
||||||
Process proc = Process.Start(startInfo);
|
Process proc = Process.Start(startInfo);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,7 +17,9 @@ public sealed class KeyboardHook : IDisposable
|
|||||||
|
|
||||||
public const int KEYEVENTF_EXTENDEDKEY = 1;
|
public const int KEYEVENTF_EXTENDEDKEY = 1;
|
||||||
public const int KEYEVENTF_KEYUP = 2;
|
public const int KEYEVENTF_KEYUP = 2;
|
||||||
|
|
||||||
private const byte VK_LWIN = 0x5B;
|
private const byte VK_LWIN = 0x5B;
|
||||||
|
private const byte VK_LCONTROL = 0xA2;
|
||||||
|
|
||||||
public static void KeyPress(Keys key)
|
public static void KeyPress(Keys key)
|
||||||
{
|
{
|
||||||
@@ -32,6 +34,16 @@ public sealed class KeyboardHook : IDisposable
|
|||||||
keybd_event(VK_LWIN, 0, KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP, IntPtr.Zero);
|
keybd_event(VK_LWIN, 0, KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP, IntPtr.Zero);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void KeyCtrlWinPress(Keys key)
|
||||||
|
{
|
||||||
|
keybd_event(VK_LCONTROL, 0, KEYEVENTF_EXTENDEDKEY, IntPtr.Zero);
|
||||||
|
keybd_event(VK_LWIN, 0, KEYEVENTF_EXTENDEDKEY, IntPtr.Zero);
|
||||||
|
keybd_event((byte)key, 0, KEYEVENTF_EXTENDEDKEY, IntPtr.Zero);
|
||||||
|
|
||||||
|
keybd_event((byte)key, 0, KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP, IntPtr.Zero);
|
||||||
|
keybd_event(VK_LWIN, 0, KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP, IntPtr.Zero);
|
||||||
|
keybd_event(VK_LCONTROL, 0, KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP, IntPtr.Zero);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents the window that is used internally to get the messages.
|
/// Represents the window that is used internally to get the messages.
|
||||||
|
|||||||
@@ -153,6 +153,13 @@ namespace GHelper.Mode
|
|||||||
Guid guidScheme = new Guid(scheme);
|
Guid guidScheme = new Guid(scheme);
|
||||||
|
|
||||||
uint status = PowerGetEffectiveOverlayScheme(out Guid activeScheme);
|
uint status = PowerGetEffectiveOverlayScheme(out Guid activeScheme);
|
||||||
|
|
||||||
|
if (GetBatterySaverStatus())
|
||||||
|
{
|
||||||
|
Logger.WriteLine("Battery Saver detected");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (status != 0 || activeScheme != guidScheme)
|
if (status != 0 || activeScheme != guidScheme)
|
||||||
{
|
{
|
||||||
status = PowerSetActiveOverlayScheme(guidScheme);
|
status = PowerSetActiveOverlayScheme(guidScheme);
|
||||||
@@ -288,6 +295,48 @@ namespace GHelper.Mode
|
|||||||
Logger.WriteLine("Setting Hibernate after " + seconds + ": " + (hrAC == 0 ? "OK" : hrAC));
|
Logger.WriteLine("Setting Hibernate after " + seconds + ": " + (hrAC == 0 ? "OK" : hrAC));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[DllImport("Kernel32")]
|
||||||
|
private static extern bool GetSystemPowerStatus(SystemPowerStatus sps);
|
||||||
|
public enum ACLineStatus : byte
|
||||||
|
{
|
||||||
|
Offline = 0, Online = 1, Unknown = 255
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum BatteryFlag : byte
|
||||||
|
{
|
||||||
|
High = 1,
|
||||||
|
Low = 2,
|
||||||
|
Critical = 4,
|
||||||
|
Charging = 8,
|
||||||
|
NoSystemBattery = 128,
|
||||||
|
Unknown = 255
|
||||||
|
}
|
||||||
|
|
||||||
|
// Fields must mirror their unmanaged counterparts, in order
|
||||||
|
[StructLayout(LayoutKind.Sequential)]
|
||||||
|
public class SystemPowerStatus
|
||||||
|
{
|
||||||
|
public ACLineStatus ACLineStatus;
|
||||||
|
public BatteryFlag BatteryFlag;
|
||||||
|
public Byte BatteryLifePercent;
|
||||||
|
public Byte SystemStatusFlag;
|
||||||
|
public Int32 BatteryLifeTime;
|
||||||
|
public Int32 BatteryFullLifeTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static bool GetBatterySaverStatus()
|
||||||
|
{
|
||||||
|
SystemPowerStatus sps = new SystemPowerStatus();
|
||||||
|
try
|
||||||
|
{
|
||||||
|
GetSystemPowerStatus(sps);
|
||||||
|
return (sps.SystemStatusFlag > 0);
|
||||||
|
} catch (Exception ex)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -258,6 +258,9 @@
|
|||||||
<data name="Boot" xml:space="preserve">
|
<data name="Boot" xml:space="preserve">
|
||||||
<value>Hochfahren</value>
|
<value>Hochfahren</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="BootSound" xml:space="preserve">
|
||||||
|
<value>Boot Sound</value>
|
||||||
|
</data>
|
||||||
<data name="Brightness" xml:space="preserve">
|
<data name="Brightness" xml:space="preserve">
|
||||||
<value>Helligkeit</value>
|
<value>Helligkeit</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -267,6 +270,9 @@
|
|||||||
<data name="BrightnessUp" xml:space="preserve">
|
<data name="BrightnessUp" xml:space="preserve">
|
||||||
<value>Helligkeit erhöhen</value>
|
<value>Helligkeit erhöhen</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="Calibrate" xml:space="preserve">
|
||||||
|
<value>Calibrate</value>
|
||||||
|
</data>
|
||||||
<data name="Charging" xml:space="preserve">
|
<data name="Charging" xml:space="preserve">
|
||||||
<value>Lädt</value>
|
<value>Lädt</value>
|
||||||
</data>
|
</data>
|
||||||
|
|||||||
@@ -258,6 +258,9 @@
|
|||||||
<data name="Boot" xml:space="preserve">
|
<data name="Boot" xml:space="preserve">
|
||||||
<value>Al arrancar</value>
|
<value>Al arrancar</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="BootSound" xml:space="preserve">
|
||||||
|
<value>Boot Sound</value>
|
||||||
|
</data>
|
||||||
<data name="Brightness" xml:space="preserve">
|
<data name="Brightness" xml:space="preserve">
|
||||||
<value>Brillo</value>
|
<value>Brillo</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -267,6 +270,9 @@
|
|||||||
<data name="BrightnessUp" xml:space="preserve">
|
<data name="BrightnessUp" xml:space="preserve">
|
||||||
<value>Subir brillo</value>
|
<value>Subir brillo</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="Calibrate" xml:space="preserve">
|
||||||
|
<value>Calibrate</value>
|
||||||
|
</data>
|
||||||
<data name="Charging" xml:space="preserve">
|
<data name="Charging" xml:space="preserve">
|
||||||
<value>Cargando</value>
|
<value>Cargando</value>
|
||||||
</data>
|
</data>
|
||||||
|
|||||||
@@ -258,6 +258,9 @@
|
|||||||
<data name="Boot" xml:space="preserve">
|
<data name="Boot" xml:space="preserve">
|
||||||
<value>Au démarrage</value>
|
<value>Au démarrage</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="BootSound" xml:space="preserve">
|
||||||
|
<value>Boot Sound</value>
|
||||||
|
</data>
|
||||||
<data name="Brightness" xml:space="preserve">
|
<data name="Brightness" xml:space="preserve">
|
||||||
<value>Luminosité</value>
|
<value>Luminosité</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -267,6 +270,9 @@
|
|||||||
<data name="BrightnessUp" xml:space="preserve">
|
<data name="BrightnessUp" xml:space="preserve">
|
||||||
<value>Augmenter la luminosité</value>
|
<value>Augmenter la luminosité</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="Calibrate" xml:space="preserve">
|
||||||
|
<value>Calibrate</value>
|
||||||
|
</data>
|
||||||
<data name="Charging" xml:space="preserve">
|
<data name="Charging" xml:space="preserve">
|
||||||
<value>Chargement en cours</value>
|
<value>Chargement en cours</value>
|
||||||
</data>
|
</data>
|
||||||
|
|||||||
@@ -258,6 +258,9 @@
|
|||||||
<data name="Boot" xml:space="preserve">
|
<data name="Boot" xml:space="preserve">
|
||||||
<value>Rendszerbetöltés</value>
|
<value>Rendszerbetöltés</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="BootSound" xml:space="preserve">
|
||||||
|
<value>Boot Sound</value>
|
||||||
|
</data>
|
||||||
<data name="Brightness" xml:space="preserve">
|
<data name="Brightness" xml:space="preserve">
|
||||||
<value>Fényerő</value>
|
<value>Fényerő</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -267,6 +270,9 @@
|
|||||||
<data name="BrightnessUp" xml:space="preserve">
|
<data name="BrightnessUp" xml:space="preserve">
|
||||||
<value>Fényerő növelése</value>
|
<value>Fényerő növelése</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="Calibrate" xml:space="preserve">
|
||||||
|
<value>Calibrate</value>
|
||||||
|
</data>
|
||||||
<data name="Charging" xml:space="preserve">
|
<data name="Charging" xml:space="preserve">
|
||||||
<value>Charging</value>
|
<value>Charging</value>
|
||||||
</data>
|
</data>
|
||||||
|
|||||||
@@ -258,6 +258,9 @@
|
|||||||
<data name="Boot" xml:space="preserve">
|
<data name="Boot" xml:space="preserve">
|
||||||
<value>Avvio</value>
|
<value>Avvio</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="BootSound" xml:space="preserve">
|
||||||
|
<value>Boot Sound</value>
|
||||||
|
</data>
|
||||||
<data name="Brightness" xml:space="preserve">
|
<data name="Brightness" xml:space="preserve">
|
||||||
<value>Luminosità</value>
|
<value>Luminosità</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -267,6 +270,9 @@
|
|||||||
<data name="BrightnessUp" xml:space="preserve">
|
<data name="BrightnessUp" xml:space="preserve">
|
||||||
<value>Aumenta Luminosità</value>
|
<value>Aumenta Luminosità</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="Calibrate" xml:space="preserve">
|
||||||
|
<value>Calibrate</value>
|
||||||
|
</data>
|
||||||
<data name="Charging" xml:space="preserve">
|
<data name="Charging" xml:space="preserve">
|
||||||
<value>In carica</value>
|
<value>In carica</value>
|
||||||
</data>
|
</data>
|
||||||
|
|||||||
@@ -258,6 +258,9 @@
|
|||||||
<data name="Boot" xml:space="preserve">
|
<data name="Boot" xml:space="preserve">
|
||||||
<value>부팅</value>
|
<value>부팅</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="BootSound" xml:space="preserve">
|
||||||
|
<value>Boot Sound</value>
|
||||||
|
</data>
|
||||||
<data name="Brightness" xml:space="preserve">
|
<data name="Brightness" xml:space="preserve">
|
||||||
<value>밝기</value>
|
<value>밝기</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -267,6 +270,9 @@
|
|||||||
<data name="BrightnessUp" xml:space="preserve">
|
<data name="BrightnessUp" xml:space="preserve">
|
||||||
<value>밝기 증가</value>
|
<value>밝기 증가</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="Calibrate" xml:space="preserve">
|
||||||
|
<value>Calibrate</value>
|
||||||
|
</data>
|
||||||
<data name="Charging" xml:space="preserve">
|
<data name="Charging" xml:space="preserve">
|
||||||
<value>충전 중</value>
|
<value>충전 중</value>
|
||||||
</data>
|
</data>
|
||||||
|
|||||||
@@ -258,6 +258,9 @@
|
|||||||
<data name="Boot" xml:space="preserve">
|
<data name="Boot" xml:space="preserve">
|
||||||
<value>Paleidimas</value>
|
<value>Paleidimas</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="BootSound" xml:space="preserve">
|
||||||
|
<value>Paleidimo garsas</value>
|
||||||
|
</data>
|
||||||
<data name="Brightness" xml:space="preserve">
|
<data name="Brightness" xml:space="preserve">
|
||||||
<value>Ryškumas</value>
|
<value>Ryškumas</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -267,6 +270,9 @@
|
|||||||
<data name="BrightnessUp" xml:space="preserve">
|
<data name="BrightnessUp" xml:space="preserve">
|
||||||
<value>Ryškumo didinimas</value>
|
<value>Ryškumo didinimas</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="Calibrate" xml:space="preserve">
|
||||||
|
<value>Kalibruoti</value>
|
||||||
|
</data>
|
||||||
<data name="Charging" xml:space="preserve">
|
<data name="Charging" xml:space="preserve">
|
||||||
<value>Įkrovimas</value>
|
<value>Įkrovimas</value>
|
||||||
</data>
|
</data>
|
||||||
|
|||||||
@@ -258,6 +258,9 @@
|
|||||||
<data name="Boot" xml:space="preserve">
|
<data name="Boot" xml:space="preserve">
|
||||||
<value>Uruchamianie</value>
|
<value>Uruchamianie</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="BootSound" xml:space="preserve">
|
||||||
|
<value>Dźwięk podczas rozruchu</value>
|
||||||
|
</data>
|
||||||
<data name="Brightness" xml:space="preserve">
|
<data name="Brightness" xml:space="preserve">
|
||||||
<value>Jasność</value>
|
<value>Jasność</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -267,6 +270,9 @@
|
|||||||
<data name="BrightnessUp" xml:space="preserve">
|
<data name="BrightnessUp" xml:space="preserve">
|
||||||
<value>Zwiększ jasność</value>
|
<value>Zwiększ jasność</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="Calibrate" xml:space="preserve">
|
||||||
|
<value>Kalibruj</value>
|
||||||
|
</data>
|
||||||
<data name="Charging" xml:space="preserve">
|
<data name="Charging" xml:space="preserve">
|
||||||
<value>Ładowanie</value>
|
<value>Ładowanie</value>
|
||||||
</data>
|
</data>
|
||||||
|
|||||||
@@ -258,6 +258,9 @@
|
|||||||
<data name="Boot" xml:space="preserve">
|
<data name="Boot" xml:space="preserve">
|
||||||
<value>Ao ligar</value>
|
<value>Ao ligar</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="BootSound" xml:space="preserve">
|
||||||
|
<value>Boot Sound</value>
|
||||||
|
</data>
|
||||||
<data name="Brightness" xml:space="preserve">
|
<data name="Brightness" xml:space="preserve">
|
||||||
<value>Nível do brilho</value>
|
<value>Nível do brilho</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -267,6 +270,9 @@
|
|||||||
<data name="BrightnessUp" xml:space="preserve">
|
<data name="BrightnessUp" xml:space="preserve">
|
||||||
<value>Brightness Up</value>
|
<value>Brightness Up</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="Calibrate" xml:space="preserve">
|
||||||
|
<value>Calibrate</value>
|
||||||
|
</data>
|
||||||
<data name="Charging" xml:space="preserve">
|
<data name="Charging" xml:space="preserve">
|
||||||
<value>Charging</value>
|
<value>Charging</value>
|
||||||
</data>
|
</data>
|
||||||
|
|||||||
@@ -258,6 +258,9 @@
|
|||||||
<data name="Boot" xml:space="preserve">
|
<data name="Boot" xml:space="preserve">
|
||||||
<value>Ao ligar</value>
|
<value>Ao ligar</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="BootSound" xml:space="preserve">
|
||||||
|
<value>Boot Sound</value>
|
||||||
|
</data>
|
||||||
<data name="Brightness" xml:space="preserve">
|
<data name="Brightness" xml:space="preserve">
|
||||||
<value>Nível do brilho</value>
|
<value>Nível do brilho</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -267,6 +270,9 @@
|
|||||||
<data name="BrightnessUp" xml:space="preserve">
|
<data name="BrightnessUp" xml:space="preserve">
|
||||||
<value>Aumentar o brilho</value>
|
<value>Aumentar o brilho</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="Calibrate" xml:space="preserve">
|
||||||
|
<value>Calibrate</value>
|
||||||
|
</data>
|
||||||
<data name="Charging" xml:space="preserve">
|
<data name="Charging" xml:space="preserve">
|
||||||
<value>Carregando</value>
|
<value>Carregando</value>
|
||||||
</data>
|
</data>
|
||||||
|
|||||||
@@ -258,6 +258,9 @@
|
|||||||
<data name="Boot" xml:space="preserve">
|
<data name="Boot" xml:space="preserve">
|
||||||
<value>Pornire</value>
|
<value>Pornire</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="BootSound" xml:space="preserve">
|
||||||
|
<value>Boot Sound</value>
|
||||||
|
</data>
|
||||||
<data name="Brightness" xml:space="preserve">
|
<data name="Brightness" xml:space="preserve">
|
||||||
<value>Luminozitate</value>
|
<value>Luminozitate</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -267,6 +270,9 @@
|
|||||||
<data name="BrightnessUp" xml:space="preserve">
|
<data name="BrightnessUp" xml:space="preserve">
|
||||||
<value>Mărirea luminozității</value>
|
<value>Mărirea luminozității</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="Calibrate" xml:space="preserve">
|
||||||
|
<value>Calibrate</value>
|
||||||
|
</data>
|
||||||
<data name="Charging" xml:space="preserve">
|
<data name="Charging" xml:space="preserve">
|
||||||
<value>Se încarcă</value>
|
<value>Se încarcă</value>
|
||||||
</data>
|
</data>
|
||||||
|
|||||||
@@ -258,6 +258,9 @@
|
|||||||
<data name="Boot" xml:space="preserve">
|
<data name="Boot" xml:space="preserve">
|
||||||
<value>Önyükleme</value>
|
<value>Önyükleme</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="BootSound" xml:space="preserve">
|
||||||
|
<value>Boot Sound</value>
|
||||||
|
</data>
|
||||||
<data name="Brightness" xml:space="preserve">
|
<data name="Brightness" xml:space="preserve">
|
||||||
<value>Parlaklığı</value>
|
<value>Parlaklığı</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -267,6 +270,9 @@
|
|||||||
<data name="BrightnessUp" xml:space="preserve">
|
<data name="BrightnessUp" xml:space="preserve">
|
||||||
<value>Brightness Up</value>
|
<value>Brightness Up</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="Calibrate" xml:space="preserve">
|
||||||
|
<value>Calibrate</value>
|
||||||
|
</data>
|
||||||
<data name="Charging" xml:space="preserve">
|
<data name="Charging" xml:space="preserve">
|
||||||
<value>Charging</value>
|
<value>Charging</value>
|
||||||
</data>
|
</data>
|
||||||
|
|||||||
@@ -258,6 +258,9 @@
|
|||||||
<data name="Boot" xml:space="preserve">
|
<data name="Boot" xml:space="preserve">
|
||||||
<value>Старт</value>
|
<value>Старт</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="BootSound" xml:space="preserve">
|
||||||
|
<value>Boot Sound</value>
|
||||||
|
</data>
|
||||||
<data name="Brightness" xml:space="preserve">
|
<data name="Brightness" xml:space="preserve">
|
||||||
<value>Яскравість</value>
|
<value>Яскравість</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -267,6 +270,9 @@
|
|||||||
<data name="BrightnessUp" xml:space="preserve">
|
<data name="BrightnessUp" xml:space="preserve">
|
||||||
<value>Підвищити яскравість</value>
|
<value>Підвищити яскравість</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="Calibrate" xml:space="preserve">
|
||||||
|
<value>Calibrate</value>
|
||||||
|
</data>
|
||||||
<data name="Charging" xml:space="preserve">
|
<data name="Charging" xml:space="preserve">
|
||||||
<value>Зарядка</value>
|
<value>Зарядка</value>
|
||||||
</data>
|
</data>
|
||||||
|
|||||||
@@ -258,6 +258,9 @@
|
|||||||
<data name="Boot" xml:space="preserve">
|
<data name="Boot" xml:space="preserve">
|
||||||
<value>Khởi động</value>
|
<value>Khởi động</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="BootSound" xml:space="preserve">
|
||||||
|
<value>Boot Sound</value>
|
||||||
|
</data>
|
||||||
<data name="Brightness" xml:space="preserve">
|
<data name="Brightness" xml:space="preserve">
|
||||||
<value>Độ sáng</value>
|
<value>Độ sáng</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -267,6 +270,9 @@
|
|||||||
<data name="BrightnessUp" xml:space="preserve">
|
<data name="BrightnessUp" xml:space="preserve">
|
||||||
<value>Tăng độ sáng</value>
|
<value>Tăng độ sáng</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="Calibrate" xml:space="preserve">
|
||||||
|
<value>Calibrate</value>
|
||||||
|
</data>
|
||||||
<data name="Charging" xml:space="preserve">
|
<data name="Charging" xml:space="preserve">
|
||||||
<value>Đang sạc</value>
|
<value>Đang sạc</value>
|
||||||
</data>
|
</data>
|
||||||
|
|||||||
@@ -258,6 +258,9 @@
|
|||||||
<data name="Boot" xml:space="preserve">
|
<data name="Boot" xml:space="preserve">
|
||||||
<value>开机时</value>
|
<value>开机时</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="BootSound" xml:space="preserve">
|
||||||
|
<value>开机音效</value>
|
||||||
|
</data>
|
||||||
<data name="Brightness" xml:space="preserve">
|
<data name="Brightness" xml:space="preserve">
|
||||||
<value>亮度</value>
|
<value>亮度</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -267,6 +270,9 @@
|
|||||||
<data name="BrightnessUp" xml:space="preserve">
|
<data name="BrightnessUp" xml:space="preserve">
|
||||||
<value>提高亮度</value>
|
<value>提高亮度</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="Calibrate" xml:space="preserve">
|
||||||
|
<value>Calibrate</value>
|
||||||
|
</data>
|
||||||
<data name="Charging" xml:space="preserve">
|
<data name="Charging" xml:space="preserve">
|
||||||
<value>充电中</value>
|
<value>充电中</value>
|
||||||
</data>
|
</data>
|
||||||
|
|||||||
@@ -258,6 +258,9 @@
|
|||||||
<data name="Boot" xml:space="preserve">
|
<data name="Boot" xml:space="preserve">
|
||||||
<value>開機時</value>
|
<value>開機時</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="BootSound" xml:space="preserve">
|
||||||
|
<value>開機音效</value>
|
||||||
|
</data>
|
||||||
<data name="Brightness" xml:space="preserve">
|
<data name="Brightness" xml:space="preserve">
|
||||||
<value>亮度</value>
|
<value>亮度</value>
|
||||||
</data>
|
</data>
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
using GHelper.AutoUpdate;
|
using GHelper.AutoUpdate;
|
||||||
using GHelper.Battery;
|
using GHelper.Battery;
|
||||||
using GHelper.Display;
|
using GHelper.Display;
|
||||||
|
using GHelper.Fan;
|
||||||
using GHelper.Gpu;
|
using GHelper.Gpu;
|
||||||
using GHelper.Helpers;
|
using GHelper.Helpers;
|
||||||
using GHelper.Input;
|
using GHelper.Input;
|
||||||
@@ -563,7 +564,7 @@ namespace GHelper
|
|||||||
|
|
||||||
private void LabelCPUFan_Click(object? sender, EventArgs e)
|
private void LabelCPUFan_Click(object? sender, EventArgs e)
|
||||||
{
|
{
|
||||||
HardwareControl.fanRpm = !HardwareControl.fanRpm;
|
FanSensorControl.fanRpm = !FanSensorControl.fanRpm;
|
||||||
RefreshSensors(true);
|
RefreshSensors(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -757,7 +758,7 @@ namespace GHelper
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
public void VisualiseScreen(bool screenEnabled, bool screenAuto, int frequency, int maxFrequency, int overdrive, bool overdriveSetting, int miniled)
|
public void VisualiseScreen(bool screenEnabled, bool screenAuto, int frequency, int maxFrequency, int overdrive, bool overdriveSetting, int miniled, bool hdr)
|
||||||
{
|
{
|
||||||
|
|
||||||
ButtonEnabled(button60Hz, screenEnabled);
|
ButtonEnabled(button60Hz, screenEnabled);
|
||||||
@@ -799,6 +800,7 @@ namespace GHelper
|
|||||||
if (miniled >= 0)
|
if (miniled >= 0)
|
||||||
{
|
{
|
||||||
buttonMiniled.Activated = (miniled == 1);
|
buttonMiniled.Activated = (miniled == 1);
|
||||||
|
buttonMiniled.Enabled = !hdr;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -1024,13 +1026,26 @@ namespace GHelper
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void HideUltimateMode()
|
public void VisualiseGPUButtons(bool eco = true, bool ultimate = true)
|
||||||
{
|
{
|
||||||
tableGPU.Controls.Remove(buttonUltimate);
|
if (!eco)
|
||||||
tablePerf.ColumnCount = 0;
|
{
|
||||||
tableGPU.ColumnCount = 0;
|
menuEco.Visible = buttonEco.Visible = false;
|
||||||
tableScreen.ColumnCount = 0;
|
menuOptimized.Visible = buttonOptimized.Visible = false;
|
||||||
menuUltimate.Visible = false;
|
buttonStopGPU.Visible = true;
|
||||||
|
tableGPU.ColumnCount = 3;
|
||||||
|
tableScreen.ColumnCount = 3;
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
buttonStopGPU.Visible = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!ultimate)
|
||||||
|
{
|
||||||
|
menuUltimate.Visible = buttonUltimate.Visible = false;
|
||||||
|
tableGPU.ColumnCount = 3;
|
||||||
|
tableScreen.ColumnCount = 3;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void HideGPUModes(bool gpuExists)
|
public void HideGPUModes(bool gpuExists)
|
||||||
@@ -1041,15 +1056,17 @@ namespace GHelper
|
|||||||
buttonStandard.Visible = false;
|
buttonStandard.Visible = false;
|
||||||
buttonUltimate.Visible = false;
|
buttonUltimate.Visible = false;
|
||||||
buttonOptimized.Visible = false;
|
buttonOptimized.Visible = false;
|
||||||
|
|
||||||
buttonStopGPU.Visible = true;
|
buttonStopGPU.Visible = true;
|
||||||
|
|
||||||
|
tableGPU.ColumnCount = 0;
|
||||||
|
|
||||||
SetContextMenu();
|
SetContextMenu();
|
||||||
|
|
||||||
panelGPU.Visible = gpuExists;
|
panelGPU.Visible = gpuExists;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void LockGPUModes(string text = null)
|
public void LockGPUModes(string text = null)
|
||||||
{
|
{
|
||||||
Invoke(delegate
|
Invoke(delegate
|
||||||
|
|||||||
@@ -279,6 +279,12 @@ Disable app's OSD (for performance modes, keyboard backlight, etc.)
|
|||||||
"disable_osd": 1,
|
"disable_osd": 1,
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Disable "Tablet mode" on X13/X16
|
||||||
|
To disable automatic touchpad toggling when laptop enteres / leaves tablet mode
|
||||||
|
```
|
||||||
|
"disable_tablet": 1,
|
||||||
|
```
|
||||||
|
|
||||||
### Extra Keybindings
|
### Extra Keybindings
|
||||||
- ``Ctrl + Shift + F5`` - Toggle Performance Modes
|
- ``Ctrl + Shift + F5`` - Toggle Performance Modes
|
||||||
- ``Ctrl + Shift + F12`` - Open G-Helper window
|
- ``Ctrl + Shift + F12`` - Open G-Helper window
|
||||||
|
|||||||
Reference in New Issue
Block a user