Compare commits
28 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
252cc9d868 | ||
|
|
0b03b62a2d | ||
|
|
ff7a5463d6 | ||
|
|
5134aaca9d | ||
|
|
2a5c2e02ac | ||
|
|
80e3971dad | ||
|
|
ac60986646 | ||
|
|
1e0169a71d | ||
|
|
e0346a8af8 | ||
|
|
4ee97fdbc4 | ||
|
|
34075b67d4 | ||
|
|
4ed9675d99 | ||
|
|
af3538e105 | ||
|
|
d818405e04 | ||
|
|
9794229f3f | ||
|
|
9f56959c67 | ||
|
|
09e6676b7c | ||
|
|
6adb2e2fcf | ||
|
|
08cc4409a9 | ||
|
|
1ac0f2be08 | ||
|
|
05e66d3b95 | ||
|
|
0f8f1e9ce5 | ||
|
|
d37b46c588 | ||
|
|
020a7d074f | ||
|
|
7eb7cc9f78 | ||
|
|
38d60e88ea | ||
|
|
0cc16765b6 | ||
|
|
96f705806b |
25
.github/workflows/build.yml
vendored
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
name: Build
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ main ]
|
||||||
|
pull_request:
|
||||||
|
branches: [ main ]
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: windows-2022
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- name: Setup dotnet
|
||||||
|
uses: actions/setup-dotnet@v3
|
||||||
|
with:
|
||||||
|
dotnet-version: |
|
||||||
|
7.0.x
|
||||||
|
- name: Build
|
||||||
|
run: |
|
||||||
|
dotnet build app/GHelper.sln
|
||||||
28
.github/workflows/codeql.yml
vendored
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
name: CodeQL
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ main ]
|
||||||
|
pull_request:
|
||||||
|
branches: [ main ]
|
||||||
|
schedule:
|
||||||
|
- cron: '34 18 * * 3'
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
actions: read
|
||||||
|
contents: read
|
||||||
|
security-events: write
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
codeql:
|
||||||
|
runs-on: windows-2022
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- name: Initialize CodeQL
|
||||||
|
uses: github/codeql-action/init@v2
|
||||||
|
with:
|
||||||
|
languages: c#
|
||||||
|
- name: Autobuild
|
||||||
|
uses: github/codeql-action/autobuild@v2
|
||||||
|
- name: Analyze
|
||||||
|
uses: github/codeql-action/analyze@v2
|
||||||
28
.github/workflows/release.yml
vendored
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
name: Release
|
||||||
|
|
||||||
|
on:
|
||||||
|
release:
|
||||||
|
types: [ published ]
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
release:
|
||||||
|
runs-on: windows-2022
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- name: Setup dotnet
|
||||||
|
uses: actions/setup-dotnet@v3
|
||||||
|
with:
|
||||||
|
dotnet-version: |
|
||||||
|
7.0.x
|
||||||
|
- name: Publish
|
||||||
|
run: |
|
||||||
|
dotnet publish app/GHelper.sln --configuration Release --runtime win-x64 -p:PublishSingleFile=true --no-self-contained
|
||||||
|
powershell Compress-Archive app/bin/x64/Release/net7.0-windows8.0/win-x64/publish/GHelper.exe GHelper.zip
|
||||||
|
- name: Upload
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ github.token }}
|
||||||
|
run: |
|
||||||
|
gh release upload ${{ github.ref_name }} app/bin/x64/Release/net7.0-windows8.0/win-x64/publish/GHelper.exe GHelper.zip
|
||||||
@@ -26,14 +26,15 @@ namespace GHelper.AnimeMatrix
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
mat = new AnimeMatrixDevice();
|
mat = new AnimeMatrixDevice();
|
||||||
|
Task.Run(mat.WakeUp);
|
||||||
matrixTimer = new System.Timers.Timer(100);
|
matrixTimer = new System.Timers.Timer(100);
|
||||||
matrixTimer.Elapsed += MatrixTimer_Elapsed;
|
matrixTimer.Elapsed += MatrixTimer_Elapsed;
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
mat.Dispose();
|
|
||||||
mat = null;
|
mat = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SetMatrix()
|
public void SetMatrix()
|
||||||
@@ -41,10 +42,10 @@ namespace GHelper.AnimeMatrix
|
|||||||
|
|
||||||
if (!IsValid) return;
|
if (!IsValid) return;
|
||||||
|
|
||||||
int brightness = Program.config.getConfig("matrix_brightness");
|
int brightness = AppConfig.getConfig("matrix_brightness");
|
||||||
int running = Program.config.getConfig("matrix_running");
|
int running = AppConfig.getConfig("matrix_running");
|
||||||
|
|
||||||
bool auto = Program.config.getConfig("matrix_auto") == 1;
|
bool auto = AppConfig.getConfig("matrix_auto") == 1;
|
||||||
|
|
||||||
if (brightness < 0) brightness = 0;
|
if (brightness < 0) brightness = 0;
|
||||||
if (running < 0) running = 0;
|
if (running < 0) running = 0;
|
||||||
@@ -74,7 +75,7 @@ namespace GHelper.AnimeMatrix
|
|||||||
switch (running)
|
switch (running)
|
||||||
{
|
{
|
||||||
case 2:
|
case 2:
|
||||||
SetMatrixPicture(Program.config.getConfigString("matrix_picture"));
|
SetMatrixPicture(AppConfig.getConfigString("matrix_picture"));
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
StartMatrixTimer(1000);
|
StartMatrixTimer(1000);
|
||||||
@@ -110,7 +111,7 @@ namespace GHelper.AnimeMatrix
|
|||||||
{
|
{
|
||||||
if (!IsValid) return;
|
if (!IsValid) return;
|
||||||
|
|
||||||
switch (Program.config.getConfig("matrix_running"))
|
switch (AppConfig.getConfig("matrix_running"))
|
||||||
{
|
{
|
||||||
case 2:
|
case 2:
|
||||||
mat.PresentNextFrame();
|
mat.PresentNextFrame();
|
||||||
@@ -122,6 +123,11 @@ namespace GHelper.AnimeMatrix
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void Dispose()
|
||||||
|
{
|
||||||
|
StopMatrixAudio();
|
||||||
|
}
|
||||||
|
|
||||||
void StopMatrixAudio()
|
void StopMatrixAudio()
|
||||||
{
|
{
|
||||||
if (AudioDevice is not null)
|
if (AudioDevice is not null)
|
||||||
|
|||||||
@@ -2,20 +2,18 @@
|
|||||||
using System.Management;
|
using System.Management;
|
||||||
using System.Text.Json;
|
using System.Text.Json;
|
||||||
|
|
||||||
public class AppConfig
|
public static class AppConfig
|
||||||
{
|
{
|
||||||
|
|
||||||
public string appPath;
|
private static string configFile;
|
||||||
string configFile;
|
private static string? _model;
|
||||||
|
|
||||||
string _model;
|
private static Dictionary<string, object> config = new Dictionary<string, object>();
|
||||||
|
|
||||||
public Dictionary<string, object> config = new Dictionary<string, object>();
|
static AppConfig()
|
||||||
|
|
||||||
public AppConfig()
|
|
||||||
{
|
{
|
||||||
|
|
||||||
appPath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\GHelper";
|
string appPath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\GHelper";
|
||||||
configFile = appPath + "\\config.json";
|
configFile = appPath + "\\config.json";
|
||||||
|
|
||||||
if (!System.IO.Directory.Exists(appPath))
|
if (!System.IO.Directory.Exists(appPath))
|
||||||
@@ -41,7 +39,7 @@ public class AppConfig
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public string GetModel()
|
public static string GetModel()
|
||||||
{
|
{
|
||||||
if (_model is null)
|
if (_model is null)
|
||||||
{
|
{
|
||||||
@@ -58,14 +56,14 @@ public class AppConfig
|
|||||||
|
|
||||||
return _model;
|
return _model;
|
||||||
}
|
}
|
||||||
public bool ContainsModel(string contains)
|
public static bool ContainsModel(string contains)
|
||||||
{
|
{
|
||||||
|
|
||||||
GetModel();
|
GetModel();
|
||||||
return (_model is not null && _model.Contains(contains));
|
return (_model is not null && _model.Contains(contains));
|
||||||
|
|
||||||
}
|
}
|
||||||
private void initConfig()
|
private static void initConfig()
|
||||||
{
|
{
|
||||||
config = new Dictionary<string, object>();
|
config = new Dictionary<string, object>();
|
||||||
config["performance_mode"] = 0;
|
config["performance_mode"] = 0;
|
||||||
@@ -73,22 +71,26 @@ public class AppConfig
|
|||||||
File.WriteAllText(configFile, jsonString);
|
File.WriteAllText(configFile, jsonString);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getConfig(string name, bool performance = false)
|
public static int getConfig(string name)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (config.ContainsKey(name))
|
if (config.ContainsKey(name))
|
||||||
return int.Parse(config[name].ToString());
|
return int.Parse(config[name].ToString());
|
||||||
else return -1;
|
else return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
public string getConfigString(string name)
|
public static bool isConfig(string name)
|
||||||
|
{
|
||||||
|
return getConfig(name) == 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static string getConfigString(string name)
|
||||||
{
|
{
|
||||||
if (config.ContainsKey(name))
|
if (config.ContainsKey(name))
|
||||||
return config[name].ToString();
|
return config[name].ToString();
|
||||||
else return null;
|
else return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setConfig(string name, int value)
|
public static void setConfig(string name, int value)
|
||||||
{
|
{
|
||||||
config[name] = value;
|
config[name] = value;
|
||||||
string jsonString = JsonSerializer.Serialize(config, new JsonSerializerOptions { WriteIndented = true });
|
string jsonString = JsonSerializer.Serialize(config, new JsonSerializerOptions { WriteIndented = true });
|
||||||
@@ -101,7 +103,7 @@ public class AppConfig
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setConfig(string name, string value)
|
public static void setConfig(string name, string value)
|
||||||
{
|
{
|
||||||
config[name] = value;
|
config[name] = value;
|
||||||
string jsonString = JsonSerializer.Serialize(config, new JsonSerializerOptions { WriteIndented = true });
|
string jsonString = JsonSerializer.Serialize(config, new JsonSerializerOptions { WriteIndented = true });
|
||||||
@@ -115,22 +117,32 @@ public class AppConfig
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public string getParamName(int device, string paramName = "fan_profile")
|
public static string getParamName(AsusFan device, string paramName = "fan_profile")
|
||||||
{
|
{
|
||||||
int mode = getConfig("performance_mode");
|
int mode = getConfig("performance_mode");
|
||||||
string name;
|
string name;
|
||||||
|
|
||||||
if (device == 1)
|
switch (device)
|
||||||
name = "gpu";
|
{
|
||||||
else if (device == 2)
|
case AsusFan.GPU:
|
||||||
name = "mid";
|
name = "gpu";
|
||||||
else
|
break;
|
||||||
name = "cpu";
|
case AsusFan.Mid:
|
||||||
|
name = "mid";
|
||||||
|
break;
|
||||||
|
case AsusFan.XGM:
|
||||||
|
name = "xgm";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
name = "cpu";
|
||||||
|
break;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
return paramName + "_" + name + "_" + mode;
|
return paramName + "_" + name + "_" + mode;
|
||||||
}
|
}
|
||||||
|
|
||||||
public byte[] getFanConfig(int device)
|
public static byte[] getFanConfig(AsusFan device)
|
||||||
{
|
{
|
||||||
string curveString = getConfigString(getParamName(device));
|
string curveString = getConfigString(getParamName(device));
|
||||||
byte[] curve = { };
|
byte[] curve = { };
|
||||||
@@ -141,7 +153,7 @@ public class AppConfig
|
|||||||
return curve;
|
return curve;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setFanConfig(int device, byte[] curve)
|
public static void setFanConfig(AsusFan device, byte[] curve)
|
||||||
{
|
{
|
||||||
string bitCurve = BitConverter.ToString(curve);
|
string bitCurve = BitConverter.ToString(curve);
|
||||||
setConfig(getParamName(device), bitCurve);
|
setConfig(getParamName(device), bitCurve);
|
||||||
@@ -156,7 +168,7 @@ public class AppConfig
|
|||||||
return array;
|
return array;
|
||||||
}
|
}
|
||||||
|
|
||||||
public byte[] getDefaultCurve(int device)
|
public static byte[] getDefaultCurve(AsusFan device)
|
||||||
{
|
{
|
||||||
int mode = getConfig("performance_mode");
|
int mode = getConfig("performance_mode");
|
||||||
byte[] curve;
|
byte[] curve;
|
||||||
@@ -164,19 +176,19 @@ public class AppConfig
|
|||||||
switch (mode)
|
switch (mode)
|
||||||
{
|
{
|
||||||
case 1:
|
case 1:
|
||||||
if (device == 1)
|
if (device == AsusFan.GPU)
|
||||||
curve = StringToBytes("14-3F-44-48-4C-50-54-62-16-1F-26-2D-39-47-55-5F");
|
curve = StringToBytes("14-3F-44-48-4C-50-54-62-16-1F-26-2D-39-47-55-5F");
|
||||||
else
|
else
|
||||||
curve = StringToBytes("14-3F-44-48-4C-50-54-62-11-1A-22-29-34-43-51-5A");
|
curve = StringToBytes("14-3F-44-48-4C-50-54-62-11-1A-22-29-34-43-51-5A");
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
if (device == 1)
|
if (device == AsusFan.GPU)
|
||||||
curve = StringToBytes("3C-41-42-46-47-4B-4C-62-08-11-11-1D-1D-26-26-2D");
|
curve = StringToBytes("3C-41-42-46-47-4B-4C-62-08-11-11-1D-1D-26-26-2D");
|
||||||
else
|
else
|
||||||
curve = StringToBytes("3C-41-42-46-47-4B-4C-62-03-0C-0C-16-16-22-22-29");
|
curve = StringToBytes("3C-41-42-46-47-4B-4C-62-03-0C-0C-16-16-22-22-29");
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if (device == 1)
|
if (device == AsusFan.GPU)
|
||||||
curve = StringToBytes("3A-3D-40-44-48-4D-51-62-0C-16-1D-1F-26-2D-34-4A");
|
curve = StringToBytes("3A-3D-40-44-48-4D-51-62-0C-16-1D-1F-26-2D-34-4A");
|
||||||
else
|
else
|
||||||
curve = StringToBytes("3A-3D-40-44-48-4D-51-62-08-11-16-1A-22-29-30-45");
|
curve = StringToBytes("3A-3D-40-44-48-4D-51-62-08-11-16-1A-22-29-30-45");
|
||||||
@@ -186,19 +198,19 @@ public class AppConfig
|
|||||||
return curve;
|
return curve;
|
||||||
}
|
}
|
||||||
|
|
||||||
public string getConfigPerfString(string name)
|
public static string getConfigPerfString(string name)
|
||||||
{
|
{
|
||||||
int mode = getConfig("performance_mode");
|
int mode = getConfig("performance_mode");
|
||||||
return getConfigString(name + "_" + mode);
|
return getConfigString(name + "_" + mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getConfigPerf(string name)
|
public static int getConfigPerf(string name)
|
||||||
{
|
{
|
||||||
int mode = getConfig("performance_mode");
|
int mode = getConfig("performance_mode");
|
||||||
return getConfig(name + "_" + mode);
|
return getConfig(name + "_" + mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setConfigPerf(string name, int value)
|
public static void setConfigPerf(string name, int value)
|
||||||
{
|
{
|
||||||
int mode = getConfig("performance_mode");
|
int mode = getConfig("performance_mode");
|
||||||
setConfig(name + "_" + mode, value);
|
setConfig(name + "_" + mode, value);
|
||||||
|
|||||||
@@ -1,10 +1,30 @@
|
|||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Globalization;
|
|
||||||
using System.IO.Pipes;
|
|
||||||
using System.Management;
|
using System.Management;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
public class ASUSWmi
|
public enum AsusFan
|
||||||
|
{
|
||||||
|
CPU = 0,
|
||||||
|
GPU = 1,
|
||||||
|
Mid = 2,
|
||||||
|
XGM = 3
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum AsusMode
|
||||||
|
{
|
||||||
|
Balanced = 0,
|
||||||
|
Turbo = 1,
|
||||||
|
Silent = 2
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum AsusGPU
|
||||||
|
{
|
||||||
|
Eco = 0,
|
||||||
|
Standard = 1,
|
||||||
|
Ultimate = 2
|
||||||
|
}
|
||||||
|
|
||||||
|
public class AsusACPI
|
||||||
{
|
{
|
||||||
|
|
||||||
const string FILE_NAME = @"\\.\\ATKACPI";
|
const string FILE_NAME = @"\\.\\ATKACPI";
|
||||||
@@ -150,7 +170,7 @@ public class ASUSWmi
|
|||||||
data[0] = BitConverter.GetBytes(eventHandle.ToInt32())[0];
|
data[0] = BitConverter.GetBytes(eventHandle.ToInt32())[0];
|
||||||
data[1] = BitConverter.GetBytes(eventHandle.ToInt32())[1];
|
data[1] = BitConverter.GetBytes(eventHandle.ToInt32())[1];
|
||||||
|
|
||||||
result = Control (0x222400, data, outBuffer);
|
result = Control(0x222400, data, outBuffer);
|
||||||
Debug.WriteLine(result + ":" + BitConverter.ToString(data) + "|" + BitConverter.ToString(outBuffer));
|
Debug.WriteLine(result + ":" + BitConverter.ToString(data) + "|" + BitConverter.ToString(outBuffer));
|
||||||
|
|
||||||
while (true)
|
while (true)
|
||||||
@@ -163,7 +183,7 @@ public class ASUSWmi
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public ASUSWmi()
|
public AsusACPI()
|
||||||
{
|
{
|
||||||
handle = CreateFile(
|
handle = CreateFile(
|
||||||
FILE_NAME,
|
FILE_NAME,
|
||||||
@@ -179,7 +199,7 @@ public class ASUSWmi
|
|||||||
{
|
{
|
||||||
throw new Exception("Can't connect to ACPI");
|
throw new Exception("Can't connect to ACPI");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool Control(uint dwIoControlCode, byte[] lpInBuffer, byte[] lpOutBuffer)
|
public bool Control(uint dwIoControlCode, byte[] lpInBuffer, byte[] lpOutBuffer)
|
||||||
@@ -282,7 +302,7 @@ public class ASUSWmi
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public int SetFanCurve(int device, byte[] curve)
|
public int SetFanCurve(AsusFan device, byte[] curve)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (curve.Length != 16) return -1;
|
if (curve.Length != 16) return -1;
|
||||||
@@ -295,10 +315,10 @@ public class ASUSWmi
|
|||||||
|
|
||||||
switch (device)
|
switch (device)
|
||||||
{
|
{
|
||||||
case 1:
|
case AsusFan.GPU:
|
||||||
result = DeviceSet(DevsGPUFanCurve, curve, "FanGPU");
|
result = DeviceSet(DevsGPUFanCurve, curve, "FanGPU");
|
||||||
break;
|
break;
|
||||||
case 2:
|
case AsusFan.Mid:
|
||||||
result = DeviceSet(DevsMidFanCurve, curve, "FanMid");
|
result = DeviceSet(DevsMidFanCurve, curve, "FanMid");
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@@ -309,7 +329,7 @@ public class ASUSWmi
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
public byte[] GetFanCurve(int device, int mode = 0)
|
public byte[] GetFanCurve(AsusFan device, int mode = 0)
|
||||||
{
|
{
|
||||||
uint fan_mode;
|
uint fan_mode;
|
||||||
|
|
||||||
@@ -323,9 +343,9 @@ public class ASUSWmi
|
|||||||
|
|
||||||
switch (device)
|
switch (device)
|
||||||
{
|
{
|
||||||
case 1:
|
case AsusFan.GPU:
|
||||||
return DeviceGetBuffer(DevsGPUFanCurve, fan_mode);
|
return DeviceGetBuffer(DevsGPUFanCurve, fan_mode);
|
||||||
case 2:
|
case AsusFan.Mid:
|
||||||
return DeviceGetBuffer(DevsMidFanCurve, fan_mode);
|
return DeviceGetBuffer(DevsMidFanCurve, fan_mode);
|
||||||
default:
|
default:
|
||||||
return DeviceGetBuffer(DevsCPUFanCurve, fan_mode);
|
return DeviceGetBuffer(DevsCPUFanCurve, fan_mode);
|
||||||
@@ -333,9 +353,14 @@ public class ASUSWmi
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static bool IsInvalidCurve(byte[] curve)
|
||||||
|
{
|
||||||
|
return curve.Length != 16 || IsEmptyCurve(curve);
|
||||||
|
}
|
||||||
|
|
||||||
public static bool IsEmptyCurve(byte[] curve) {
|
public static bool IsEmptyCurve(byte[] curve)
|
||||||
return curve.Length != 16 || curve.All(singleByte => singleByte == 0);
|
{
|
||||||
|
return curve.All(singleByte => singleByte == 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static byte[] FixFanCurve(byte[] curve)
|
public static byte[] FixFanCurve(byte[] curve)
|
||||||
@@ -343,7 +368,7 @@ public class ASUSWmi
|
|||||||
if (curve.Length != 16) throw new Exception("Incorrect curve");
|
if (curve.Length != 16) throw new Exception("Incorrect curve");
|
||||||
|
|
||||||
var points = new Dictionary<byte, byte>();
|
var points = new Dictionary<byte, byte>();
|
||||||
for (int i = 0; i < 8; i++) points[curve[i]] = curve[i+8];
|
for (int i = 0; i < 8; i++) points[curve[i]] = curve[i + 8];
|
||||||
|
|
||||||
var pointsFixed = new Dictionary<byte, byte>();
|
var pointsFixed = new Dictionary<byte, byte>();
|
||||||
bool fix = false;
|
bool fix = false;
|
||||||
@@ -357,7 +382,7 @@ public class ASUSWmi
|
|||||||
pointsFixed.Add(20, 0);
|
pointsFixed.Add(20, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (count != 3 || !fix)
|
if (count != 3 || !fix)
|
||||||
pointsFixed.Add(pair.Key, pair.Value);
|
pointsFixed.Add(pair.Key, pair.Value);
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
@@ -365,8 +390,8 @@ public class ASUSWmi
|
|||||||
count = 0;
|
count = 0;
|
||||||
foreach (var pair in pointsFixed.OrderBy(x => x.Key))
|
foreach (var pair in pointsFixed.OrderBy(x => x.Key))
|
||||||
{
|
{
|
||||||
curve[count] =pair.Key;
|
curve[count] = pair.Key;
|
||||||
curve[count+8] = pair.Value;
|
curve[count + 8] = pair.Value;
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -374,6 +399,12 @@ public class ASUSWmi
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool IsXGConnected()
|
||||||
|
{
|
||||||
|
//return true;
|
||||||
|
return DeviceGet(GPUXGConnected) == 1;
|
||||||
|
}
|
||||||
|
|
||||||
public void TUFKeyboardBrightness(int brightness)
|
public void TUFKeyboardBrightness(int brightness)
|
||||||
{
|
{
|
||||||
int param = 0x80 | (brightness & 0x7F);
|
int param = 0x80 | (brightness & 0x7F);
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
using HidLibrary;
|
using HidLibrary;
|
||||||
using Microsoft.Win32;
|
using Microsoft.Win32;
|
||||||
using System.Diagnostics;
|
using System.Text;
|
||||||
|
|
||||||
namespace GHelper
|
namespace GHelper
|
||||||
{
|
{
|
||||||
@@ -49,9 +49,18 @@ namespace GHelper
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class Aura
|
|
||||||
|
public static class AsusUSB
|
||||||
{
|
{
|
||||||
|
|
||||||
|
public const byte HID_ID = 0x5a;
|
||||||
|
|
||||||
|
public static readonly byte[] LED_INIT1 = new byte[] { 0x5d, 0xb9 };
|
||||||
|
public static readonly byte[] LED_INIT2 = Encoding.ASCII.GetBytes("]ASUS Tech.Inc.");
|
||||||
|
public static readonly byte[] LED_INIT3 = new byte[] { 0x5d, 0x05, 0x20, 0x31, 0, 0x08 };
|
||||||
|
public static readonly byte[] LED_INIT4 = Encoding.ASCII.GetBytes("^ASUS Tech.Inc.");
|
||||||
|
public static readonly byte[] LED_INIT5 = new byte[] { 0x5e, 0x05, 0x20, 0x31, 0, 0x08 };
|
||||||
|
|
||||||
static byte[] MESSAGE_SET = { 0x5d, 0xb5, 0, 0, 0 };
|
static byte[] MESSAGE_SET = { 0x5d, 0xb5, 0, 0, 0 };
|
||||||
static byte[] MESSAGE_APPLY = { 0x5d, 0xb4 };
|
static byte[] MESSAGE_APPLY = { 0x5d, 0xb4 };
|
||||||
|
|
||||||
@@ -73,6 +82,7 @@ namespace GHelper
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static Dictionary<int, string> _modes = new Dictionary<int, string>
|
static Dictionary<int, string> _modes = new Dictionary<int, string>
|
||||||
{
|
{
|
||||||
{ 0, Properties.Strings.AuraStatic },
|
{ 0, Properties.Strings.AuraStatic },
|
||||||
@@ -101,18 +111,18 @@ namespace GHelper
|
|||||||
|
|
||||||
public static Dictionary<int, string> GetModes()
|
public static Dictionary<int, string> GetModes()
|
||||||
{
|
{
|
||||||
if (Program.config.ContainsModel("TUF"))
|
if (AppConfig.ContainsModel("TUF"))
|
||||||
{
|
{
|
||||||
_modes.Remove(3);
|
_modes.Remove(3);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Program.config.ContainsModel("401"))
|
if (AppConfig.ContainsModel("401"))
|
||||||
{
|
{
|
||||||
_modes.Remove(2);
|
_modes.Remove(2);
|
||||||
_modes.Remove(3);
|
_modes.Remove(3);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Program.config.ContainsModel("Strix") || Program.config.ContainsModel("Scar"))
|
if (AppConfig.ContainsModel("Strix") || AppConfig.ContainsModel("Scar"))
|
||||||
{
|
{
|
||||||
return _modesStrix;
|
return _modesStrix;
|
||||||
}
|
}
|
||||||
@@ -135,7 +145,7 @@ namespace GHelper
|
|||||||
|
|
||||||
public static bool HasSecondColor()
|
public static bool HasSecondColor()
|
||||||
{
|
{
|
||||||
return (mode == 1 && !Program.config.ContainsModel("TUF"));
|
return (mode == 1 && !AppConfig.ContainsModel("TUF"));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int Speed
|
public static int Speed
|
||||||
@@ -172,6 +182,57 @@ namespace GHelper
|
|||||||
yield return device;
|
yield return device;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static HidDevice? GetInputDevice()
|
||||||
|
{
|
||||||
|
HidDevice[] HidDeviceList = HidDevices.Enumerate(0x0b05, deviceIds).ToArray();
|
||||||
|
HidDevice input = null;
|
||||||
|
|
||||||
|
foreach (HidDevice device in HidDeviceList)
|
||||||
|
if (device.ReadFeatureData(out byte[] data, HID_ID))
|
||||||
|
{
|
||||||
|
input = device;
|
||||||
|
Logger.WriteLine("Input Events" + device.Capabilities.FeatureReportByteLength + "|" + device.Capabilities.InputReportByteLength + device.Description + device.DevicePath);
|
||||||
|
}
|
||||||
|
|
||||||
|
return input;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static bool TouchpadToggle()
|
||||||
|
{
|
||||||
|
HidDevice? input = GetInputDevice();
|
||||||
|
if (input != null) return input.WriteFeatureData(new byte[] { HID_ID, 0xf4, 0x6b });
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void RunListener(Action<int> KeyHandler)
|
||||||
|
{
|
||||||
|
HidDevice? input = GetInputDevice();
|
||||||
|
if (input == null) return;
|
||||||
|
|
||||||
|
//Logger.WriteLine("Input Events " + input.DevicePath);
|
||||||
|
|
||||||
|
var task = Task.Run(() =>
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
while (true)
|
||||||
|
{
|
||||||
|
var data = input.Read().Data;
|
||||||
|
if (data.Length > 1 && data[0] == HID_ID && data[1] > 0)
|
||||||
|
{
|
||||||
|
Logger.WriteLine("Key:" + data[1]);
|
||||||
|
KeyHandler(data[1]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Logger.WriteLine(ex.ToString());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public static byte[] AuraMessage(int mode, Color color, Color color2, int speed)
|
public static byte[] AuraMessage(int mode, Color color, Color color2, int speed)
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -191,24 +252,43 @@ namespace GHelper
|
|||||||
return msg;
|
return msg;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void Init()
|
||||||
|
{
|
||||||
|
Task.Run(() =>
|
||||||
|
{
|
||||||
|
var devices = GetHidDevices(deviceIds);
|
||||||
|
foreach (HidDevice device in devices)
|
||||||
|
{
|
||||||
|
device.OpenDevice();
|
||||||
|
device.WriteFeatureData(LED_INIT1);
|
||||||
|
device.WriteFeatureData(LED_INIT2);
|
||||||
|
device.WriteFeatureData(LED_INIT3);
|
||||||
|
device.WriteFeatureData(LED_INIT4);
|
||||||
|
device.WriteFeatureData(LED_INIT5);
|
||||||
|
device.CloseDevice();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public static void ApplyBrightness(int brightness)
|
public static void ApplyBrightness(int brightness)
|
||||||
{
|
{
|
||||||
byte[] msg = { 0x5d, 0xba, 0xc5, 0xc4, (byte)brightness };
|
Task.Run(() =>
|
||||||
|
|
||||||
var devices = GetHidDevices(deviceIds);
|
|
||||||
//Logger.WriteLine("USB-KB = " + BitConverter.ToString(msg));
|
|
||||||
|
|
||||||
foreach (HidDevice device in devices)
|
|
||||||
{
|
{
|
||||||
device.OpenDevice();
|
byte[] msg = { 0x5d, 0xba, 0xc5, 0xc4, (byte)brightness };
|
||||||
device.Write(msg);
|
|
||||||
Logger.WriteLine("USB-KB " + device.Attributes.ProductHexId + ":" + BitConverter.ToString(msg));
|
|
||||||
device.CloseDevice();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Program.config.ContainsModel("TUF"))
|
var devices = GetHidDevices(deviceIds);
|
||||||
Program.wmi.TUFKeyboardBrightness(brightness);
|
foreach (HidDevice device in devices)
|
||||||
|
{
|
||||||
|
device.OpenDevice();
|
||||||
|
device.WriteFeatureData(msg);
|
||||||
|
Logger.WriteLine("USB-KB " + device.Capabilities.FeatureReportByteLength + ":" + BitConverter.ToString(msg));
|
||||||
|
device.CloseDevice();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (AppConfig.ContainsModel("TUF"))
|
||||||
|
Program.acpi.TUFKeyboardBrightness(brightness);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -224,13 +304,13 @@ namespace GHelper
|
|||||||
foreach (HidDevice device in devices)
|
foreach (HidDevice device in devices)
|
||||||
{
|
{
|
||||||
device.OpenDevice();
|
device.OpenDevice();
|
||||||
device.Write(msg);
|
device.WriteFeatureData(msg);
|
||||||
Logger.WriteLine("USB-KB " + device.Attributes.ProductHexId + ":" + BitConverter.ToString(msg));
|
Logger.WriteLine("USB-KB " + device.Attributes.ProductHexId + ":" + BitConverter.ToString(msg));
|
||||||
device.CloseDevice();
|
device.CloseDevice();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Program.config.ContainsModel("TUF"))
|
if (AppConfig.ContainsModel("TUF"))
|
||||||
Program.wmi.TUFKeyboardPower(
|
Program.acpi.TUFKeyboardPower(
|
||||||
flags.Contains(AuraDev19b6.AwakeKeyb),
|
flags.Contains(AuraDev19b6.AwakeKeyb),
|
||||||
flags.Contains(AuraDev19b6.BootKeyb),
|
flags.Contains(AuraDev19b6.BootKeyb),
|
||||||
flags.Contains(AuraDev19b6.SleepKeyb),
|
flags.Contains(AuraDev19b6.SleepKeyb),
|
||||||
@@ -238,20 +318,47 @@ namespace GHelper
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void ApplyXGMLight(bool status)
|
public static int SetXGM(byte[] msg)
|
||||||
{
|
{
|
||||||
byte value = status ? (byte)0x50 : (byte)0;
|
|
||||||
var msg = new byte[] { 0x5e, 0xc5, value };
|
|
||||||
|
|
||||||
foreach (HidDevice device in GetHidDevices(new int[] { 0x1970 }))
|
//Logger.WriteLine("XGM Payload :" + BitConverter.ToString(msg));
|
||||||
|
|
||||||
|
var payload = new byte[300];
|
||||||
|
Array.Copy(msg, payload, msg.Length);
|
||||||
|
|
||||||
|
foreach (HidDevice device in GetHidDevices(new int[] { 0x1970 }, 0))
|
||||||
{
|
{
|
||||||
device.OpenDevice();
|
device.OpenDevice();
|
||||||
var message = new byte[300];
|
Logger.WriteLine("XGM " + device.Attributes.ProductHexId + "|" + device.Capabilities.FeatureReportByteLength + ":" + BitConverter.ToString(msg));
|
||||||
Array.Copy(msg, message, msg.Length);
|
device.WriteFeatureData(payload);
|
||||||
Debug.WriteLine(BitConverter.ToString(message));
|
|
||||||
device.WriteFeatureData(message);
|
|
||||||
device.CloseDevice();
|
device.CloseDevice();
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void ApplyXGMLight(bool status)
|
||||||
|
{
|
||||||
|
SetXGM(new byte[] { 0x5e, 0xc5, status ? (byte)0x50 : (byte)0 });
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static int ResetXGM()
|
||||||
|
{
|
||||||
|
return SetXGM(new byte[] { 0x5e, 0xd1, 0x02 });
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int SetXGMFan(byte[] curve)
|
||||||
|
{
|
||||||
|
|
||||||
|
if (AsusACPI.IsInvalidCurve(curve)) return -1;
|
||||||
|
|
||||||
|
byte[] msg = new byte[19];
|
||||||
|
Array.Copy(new byte[] { 0x5e, 0xd1, 0x01 }, msg, 3);
|
||||||
|
Array.Copy(curve, 0, msg, 3, curve.Length);
|
||||||
|
|
||||||
|
return SetXGM(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -276,24 +383,25 @@ namespace GHelper
|
|||||||
byte[] msg = AuraMessage(Mode, Color1, Color2, _speed);
|
byte[] msg = AuraMessage(Mode, Color1, Color2, _speed);
|
||||||
|
|
||||||
var devices = GetHidDevices(deviceIds);
|
var devices = GetHidDevices(deviceIds);
|
||||||
|
|
||||||
if (devices.Count() == 0)
|
if (devices.Count() == 0)
|
||||||
{
|
{
|
||||||
Logger.WriteLine("USB-KB : not found");
|
Logger.WriteLine("USB-KB : not found");
|
||||||
GetHidDevices(deviceIds, 0);
|
devices = GetHidDevices(deviceIds, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (HidDevice device in devices)
|
foreach (HidDevice device in devices)
|
||||||
{
|
{
|
||||||
device.OpenDevice();
|
device.OpenDevice();
|
||||||
device.Write(msg);
|
device.WriteFeatureData(msg);
|
||||||
device.Write(MESSAGE_SET);
|
device.WriteFeatureData(MESSAGE_SET);
|
||||||
device.Write(MESSAGE_APPLY);
|
device.WriteFeatureData(MESSAGE_APPLY);
|
||||||
device.CloseDevice();
|
device.CloseDevice();
|
||||||
Logger.WriteLine("USB-KB " + device.Capabilities.FeatureReportByteLength + "|" + device.Capabilities.InputReportByteLength + device.Description + device.DevicePath + ":" + BitConverter.ToString(msg));
|
Logger.WriteLine("USB-KB " + device.Capabilities.FeatureReportByteLength + "|" + device.Capabilities.InputReportByteLength + device.Description + device.DevicePath + ":" + BitConverter.ToString(msg));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Program.config.ContainsModel("TUF"))
|
if (AppConfig.ContainsModel("TUF"))
|
||||||
Program.wmi.TUFKeyboardRGB(Mode, Color1, _speed);
|
Program.acpi.TUFKeyboardRGB(Mode, Color1, _speed);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -30,11 +30,6 @@ namespace CustomControls
|
|||||||
|
|
||||||
public bool darkTheme = false;
|
public bool darkTheme = false;
|
||||||
|
|
||||||
public RForm()
|
|
||||||
{
|
|
||||||
DoubleBuffered = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void InitColors(bool darkTheme)
|
public static void InitColors(bool darkTheme)
|
||||||
{
|
{
|
||||||
if (darkTheme)
|
if (darkTheme)
|
||||||
|
|||||||
241
app/Extra.Designer.cs
generated
@@ -32,16 +32,23 @@ namespace GHelper
|
|||||||
private void InitializeComponent()
|
private void InitializeComponent()
|
||||||
{
|
{
|
||||||
groupBindings = new GroupBox();
|
groupBindings = new GroupBox();
|
||||||
pictureHelp = new PictureBox();
|
tableKeys = new TableLayoutPanel();
|
||||||
textFNF4 = new TextBox();
|
textM2 = new TextBox();
|
||||||
comboFNF4 = new RComboBox();
|
textM1 = new TextBox();
|
||||||
|
comboM1 = new RComboBox();
|
||||||
|
labelM1 = new Label();
|
||||||
labelFNF4 = new Label();
|
labelFNF4 = new Label();
|
||||||
|
comboFNF4 = new RComboBox();
|
||||||
|
comboM4 = new RComboBox();
|
||||||
|
comboM3 = new RComboBox();
|
||||||
|
textFNF4 = new TextBox();
|
||||||
textM4 = new TextBox();
|
textM4 = new TextBox();
|
||||||
textM3 = new TextBox();
|
textM3 = new TextBox();
|
||||||
comboM4 = new RComboBox();
|
|
||||||
labelM4 = new Label();
|
labelM4 = new Label();
|
||||||
comboM3 = new RComboBox();
|
|
||||||
labelM3 = new Label();
|
labelM3 = new Label();
|
||||||
|
labelM2 = new Label();
|
||||||
|
comboM2 = new RComboBox();
|
||||||
|
pictureHelp = new PictureBox();
|
||||||
groupLight = new GroupBox();
|
groupLight = new GroupBox();
|
||||||
panelBacklightExtra = new Panel();
|
panelBacklightExtra = new Panel();
|
||||||
numericBacklightTime = new NumericUpDown();
|
numericBacklightTime = new NumericUpDown();
|
||||||
@@ -80,6 +87,7 @@ namespace GHelper
|
|||||||
checkNoOverdrive = new CheckBox();
|
checkNoOverdrive = new CheckBox();
|
||||||
checkTopmost = new CheckBox();
|
checkTopmost = new CheckBox();
|
||||||
groupBindings.SuspendLayout();
|
groupBindings.SuspendLayout();
|
||||||
|
tableKeys.SuspendLayout();
|
||||||
((System.ComponentModel.ISupportInitialize)pictureHelp).BeginInit();
|
((System.ComponentModel.ISupportInitialize)pictureHelp).BeginInit();
|
||||||
groupLight.SuspendLayout();
|
groupLight.SuspendLayout();
|
||||||
panelBacklightExtra.SuspendLayout();
|
panelBacklightExtra.SuspendLayout();
|
||||||
@@ -92,118 +100,199 @@ namespace GHelper
|
|||||||
//
|
//
|
||||||
// groupBindings
|
// groupBindings
|
||||||
//
|
//
|
||||||
|
groupBindings.Controls.Add(tableKeys);
|
||||||
groupBindings.Controls.Add(pictureHelp);
|
groupBindings.Controls.Add(pictureHelp);
|
||||||
groupBindings.Controls.Add(textFNF4);
|
|
||||||
groupBindings.Controls.Add(comboFNF4);
|
|
||||||
groupBindings.Controls.Add(labelFNF4);
|
|
||||||
groupBindings.Controls.Add(textM4);
|
|
||||||
groupBindings.Controls.Add(textM3);
|
|
||||||
groupBindings.Controls.Add(comboM4);
|
|
||||||
groupBindings.Controls.Add(labelM4);
|
|
||||||
groupBindings.Controls.Add(comboM3);
|
|
||||||
groupBindings.Controls.Add(labelM3);
|
|
||||||
groupBindings.Dock = DockStyle.Top;
|
groupBindings.Dock = DockStyle.Top;
|
||||||
groupBindings.Location = new Point(10, 10);
|
groupBindings.Location = new Point(10, 10);
|
||||||
groupBindings.Name = "groupBindings";
|
groupBindings.Name = "groupBindings";
|
||||||
groupBindings.Size = new Size(954, 242);
|
groupBindings.Size = new Size(954, 324);
|
||||||
groupBindings.TabIndex = 0;
|
groupBindings.TabIndex = 0;
|
||||||
groupBindings.TabStop = false;
|
groupBindings.TabStop = false;
|
||||||
groupBindings.Text = "Key Bindings";
|
groupBindings.Text = "Key Bindings";
|
||||||
//
|
//
|
||||||
// pictureHelp
|
// tableKeys
|
||||||
//
|
//
|
||||||
pictureHelp.BackgroundImage = Resources.icons8_help_64;
|
tableKeys.ColumnCount = 3;
|
||||||
pictureHelp.BackgroundImageLayout = ImageLayout.Zoom;
|
tableKeys.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 20F));
|
||||||
pictureHelp.Cursor = Cursors.Hand;
|
tableKeys.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 40F));
|
||||||
pictureHelp.Location = new Point(884, 58);
|
tableKeys.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 40F));
|
||||||
pictureHelp.Name = "pictureHelp";
|
tableKeys.Controls.Add(textM2, 2, 1);
|
||||||
pictureHelp.Size = new Size(32, 32);
|
tableKeys.Controls.Add(textM1, 2, 0);
|
||||||
pictureHelp.TabIndex = 9;
|
tableKeys.Controls.Add(comboM1, 1, 0);
|
||||||
pictureHelp.TabStop = false;
|
tableKeys.Controls.Add(labelM1, 0, 0);
|
||||||
|
tableKeys.Controls.Add(labelFNF4, 0, 4);
|
||||||
|
tableKeys.Controls.Add(comboFNF4, 1, 4);
|
||||||
|
tableKeys.Controls.Add(comboM4, 1, 3);
|
||||||
|
tableKeys.Controls.Add(comboM3, 1, 2);
|
||||||
|
tableKeys.Controls.Add(textFNF4, 2, 4);
|
||||||
|
tableKeys.Controls.Add(textM4, 2, 3);
|
||||||
|
tableKeys.Controls.Add(textM3, 2, 2);
|
||||||
|
tableKeys.Controls.Add(labelM4, 0, 3);
|
||||||
|
tableKeys.Controls.Add(labelM3, 0, 2);
|
||||||
|
tableKeys.Controls.Add(labelM2, 0, 1);
|
||||||
|
tableKeys.Controls.Add(comboM2, 1, 1);
|
||||||
|
tableKeys.Location = new Point(13, 38);
|
||||||
|
tableKeys.Name = "tableKeys";
|
||||||
|
tableKeys.Padding = new Padding(10);
|
||||||
|
tableKeys.RowCount = 5;
|
||||||
|
tableKeys.RowStyles.Add(new RowStyle(SizeType.Absolute, 50F));
|
||||||
|
tableKeys.RowStyles.Add(new RowStyle(SizeType.Absolute, 50F));
|
||||||
|
tableKeys.RowStyles.Add(new RowStyle(SizeType.Absolute, 50F));
|
||||||
|
tableKeys.RowStyles.Add(new RowStyle(SizeType.Absolute, 50F));
|
||||||
|
tableKeys.RowStyles.Add(new RowStyle(SizeType.Absolute, 50F));
|
||||||
|
tableKeys.Size = new Size(897, 266);
|
||||||
|
tableKeys.TabIndex = 10;
|
||||||
//
|
//
|
||||||
// textFNF4
|
// textM2
|
||||||
//
|
//
|
||||||
textFNF4.Location = new Point(415, 176);
|
textM2.Location = new Point(538, 63);
|
||||||
textFNF4.Name = "textFNF4";
|
textM2.Name = "textM2";
|
||||||
textFNF4.PlaceholderText = "action";
|
textM2.PlaceholderText = "action";
|
||||||
textFNF4.Size = new Size(448, 39);
|
textM2.Size = new Size(346, 39);
|
||||||
textFNF4.TabIndex = 8;
|
textM2.TabIndex = 14;
|
||||||
|
//
|
||||||
|
// textM1
|
||||||
|
//
|
||||||
|
textM1.Location = new Point(538, 13);
|
||||||
|
textM1.Name = "textM1";
|
||||||
|
textM1.PlaceholderText = "action";
|
||||||
|
textM1.Size = new Size(346, 39);
|
||||||
|
textM1.TabIndex = 13;
|
||||||
|
//
|
||||||
|
// comboM1
|
||||||
|
//
|
||||||
|
comboM1.BorderColor = Color.White;
|
||||||
|
comboM1.ButtonColor = Color.FromArgb(255, 255, 255);
|
||||||
|
comboM1.FormattingEnabled = true;
|
||||||
|
comboM1.Items.AddRange(new object[] { Strings.Default, Strings.VolumeMute, Strings.PlayPause, Strings.PrintScreen, Strings.ToggleAura, Strings.Custom });
|
||||||
|
comboM1.Location = new Point(188, 13);
|
||||||
|
comboM1.Name = "comboM1";
|
||||||
|
comboM1.Size = new Size(312, 40);
|
||||||
|
comboM1.TabIndex = 11;
|
||||||
|
//
|
||||||
|
// labelM1
|
||||||
|
//
|
||||||
|
labelM1.AutoSize = true;
|
||||||
|
labelM1.Location = new Point(13, 10);
|
||||||
|
labelM1.Name = "labelM1";
|
||||||
|
labelM1.Size = new Size(54, 32);
|
||||||
|
labelM1.TabIndex = 9;
|
||||||
|
labelM1.Text = "M1:";
|
||||||
|
//
|
||||||
|
// labelFNF4
|
||||||
|
//
|
||||||
|
labelFNF4.AutoSize = true;
|
||||||
|
labelFNF4.Location = new Point(13, 210);
|
||||||
|
labelFNF4.Name = "labelFNF4";
|
||||||
|
labelFNF4.Size = new Size(90, 32);
|
||||||
|
labelFNF4.TabIndex = 6;
|
||||||
|
labelFNF4.Text = "FN+F4:";
|
||||||
//
|
//
|
||||||
// comboFNF4
|
// comboFNF4
|
||||||
//
|
//
|
||||||
comboFNF4.BorderColor = Color.White;
|
comboFNF4.BorderColor = Color.White;
|
||||||
comboFNF4.ButtonColor = Color.FromArgb(255, 255, 255);
|
comboFNF4.ButtonColor = Color.FromArgb(255, 255, 255);
|
||||||
comboFNF4.FormattingEnabled = true;
|
comboFNF4.FormattingEnabled = true;
|
||||||
comboFNF4.Location = new Point(93, 175);
|
comboFNF4.Location = new Point(188, 213);
|
||||||
comboFNF4.Name = "comboFNF4";
|
comboFNF4.Name = "comboFNF4";
|
||||||
comboFNF4.Size = new Size(312, 40);
|
comboFNF4.Size = new Size(312, 40);
|
||||||
comboFNF4.TabIndex = 7;
|
comboFNF4.TabIndex = 7;
|
||||||
//
|
//
|
||||||
// labelFNF4
|
|
||||||
//
|
|
||||||
labelFNF4.AutoSize = true;
|
|
||||||
labelFNF4.Location = new Point(2, 178);
|
|
||||||
labelFNF4.Name = "labelFNF4";
|
|
||||||
labelFNF4.Size = new Size(90, 32);
|
|
||||||
labelFNF4.TabIndex = 6;
|
|
||||||
labelFNF4.Text = "FN+F4:";
|
|
||||||
//
|
|
||||||
// textM4
|
|
||||||
//
|
|
||||||
textM4.Location = new Point(415, 113);
|
|
||||||
textM4.Name = "textM4";
|
|
||||||
textM4.PlaceholderText = "action";
|
|
||||||
textM4.Size = new Size(448, 39);
|
|
||||||
textM4.TabIndex = 5;
|
|
||||||
//
|
|
||||||
// textM3
|
|
||||||
//
|
|
||||||
textM3.Location = new Point(415, 54);
|
|
||||||
textM3.Name = "textM3";
|
|
||||||
textM3.PlaceholderText = "notepad /p \"file.txt\"";
|
|
||||||
textM3.Size = new Size(448, 39);
|
|
||||||
textM3.TabIndex = 4;
|
|
||||||
//
|
|
||||||
// comboM4
|
// comboM4
|
||||||
//
|
//
|
||||||
comboM4.BorderColor = Color.White;
|
comboM4.BorderColor = Color.White;
|
||||||
comboM4.ButtonColor = Color.FromArgb(255, 255, 255);
|
comboM4.ButtonColor = Color.FromArgb(255, 255, 255);
|
||||||
comboM4.FormattingEnabled = true;
|
comboM4.FormattingEnabled = true;
|
||||||
comboM4.Items.AddRange(new object[] { Strings.PerformanceMode, Strings.OpenGHelper, Strings.Custom });
|
comboM4.Items.AddRange(new object[] { Strings.PerformanceMode, Strings.OpenGHelper, Strings.Custom });
|
||||||
comboM4.Location = new Point(93, 112);
|
comboM4.Location = new Point(188, 163);
|
||||||
comboM4.Name = "comboM4";
|
comboM4.Name = "comboM4";
|
||||||
comboM4.Size = new Size(312, 40);
|
comboM4.Size = new Size(312, 40);
|
||||||
comboM4.TabIndex = 3;
|
comboM4.TabIndex = 3;
|
||||||
//
|
//
|
||||||
// labelM4
|
|
||||||
//
|
|
||||||
labelM4.AutoSize = true;
|
|
||||||
labelM4.Location = new Point(25, 116);
|
|
||||||
labelM4.Name = "labelM4";
|
|
||||||
labelM4.Size = new Size(54, 32);
|
|
||||||
labelM4.TabIndex = 2;
|
|
||||||
labelM4.Text = "M4:";
|
|
||||||
//
|
|
||||||
// comboM3
|
// comboM3
|
||||||
//
|
//
|
||||||
comboM3.BorderColor = Color.White;
|
comboM3.BorderColor = Color.White;
|
||||||
comboM3.ButtonColor = Color.FromArgb(255, 255, 255);
|
comboM3.ButtonColor = Color.FromArgb(255, 255, 255);
|
||||||
comboM3.FormattingEnabled = true;
|
comboM3.FormattingEnabled = true;
|
||||||
comboM3.Items.AddRange(new object[] { Strings.Default, Strings.VolumeMute, Strings.PlayPause, Strings.PrintScreen, Strings.ToggleAura, Strings.Custom });
|
comboM3.Items.AddRange(new object[] { Strings.Default, Strings.VolumeMute, Strings.PlayPause, Strings.PrintScreen, Strings.ToggleAura, Strings.Custom });
|
||||||
comboM3.Location = new Point(93, 54);
|
comboM3.Location = new Point(188, 113);
|
||||||
comboM3.Name = "comboM3";
|
comboM3.Name = "comboM3";
|
||||||
comboM3.Size = new Size(312, 40);
|
comboM3.Size = new Size(312, 40);
|
||||||
comboM3.TabIndex = 1;
|
comboM3.TabIndex = 1;
|
||||||
//
|
//
|
||||||
|
// textFNF4
|
||||||
|
//
|
||||||
|
textFNF4.Location = new Point(538, 213);
|
||||||
|
textFNF4.Name = "textFNF4";
|
||||||
|
textFNF4.PlaceholderText = "action";
|
||||||
|
textFNF4.Size = new Size(346, 39);
|
||||||
|
textFNF4.TabIndex = 8;
|
||||||
|
//
|
||||||
|
// textM4
|
||||||
|
//
|
||||||
|
textM4.Location = new Point(538, 163);
|
||||||
|
textM4.Name = "textM4";
|
||||||
|
textM4.PlaceholderText = "action";
|
||||||
|
textM4.Size = new Size(346, 39);
|
||||||
|
textM4.TabIndex = 5;
|
||||||
|
//
|
||||||
|
// textM3
|
||||||
|
//
|
||||||
|
textM3.Location = new Point(538, 113);
|
||||||
|
textM3.Name = "textM3";
|
||||||
|
textM3.PlaceholderText = "action";
|
||||||
|
textM3.Size = new Size(346, 39);
|
||||||
|
textM3.TabIndex = 4;
|
||||||
|
//
|
||||||
|
// labelM4
|
||||||
|
//
|
||||||
|
labelM4.AutoSize = true;
|
||||||
|
labelM4.Location = new Point(13, 160);
|
||||||
|
labelM4.Name = "labelM4";
|
||||||
|
labelM4.Size = new Size(54, 32);
|
||||||
|
labelM4.TabIndex = 2;
|
||||||
|
labelM4.Text = "M4:";
|
||||||
|
//
|
||||||
// labelM3
|
// labelM3
|
||||||
//
|
//
|
||||||
labelM3.AutoSize = true;
|
labelM3.AutoSize = true;
|
||||||
labelM3.Location = new Point(25, 58);
|
labelM3.Location = new Point(13, 110);
|
||||||
labelM3.Name = "labelM3";
|
labelM3.Name = "labelM3";
|
||||||
labelM3.Size = new Size(54, 32);
|
labelM3.Size = new Size(54, 32);
|
||||||
labelM3.TabIndex = 0;
|
labelM3.TabIndex = 0;
|
||||||
labelM3.Text = "M3:";
|
labelM3.Text = "M3:";
|
||||||
//
|
//
|
||||||
|
// labelM2
|
||||||
|
//
|
||||||
|
labelM2.AutoSize = true;
|
||||||
|
labelM2.Location = new Point(13, 60);
|
||||||
|
labelM2.Name = "labelM2";
|
||||||
|
labelM2.Size = new Size(54, 32);
|
||||||
|
labelM2.TabIndex = 10;
|
||||||
|
labelM2.Text = "M2:";
|
||||||
|
//
|
||||||
|
// comboM2
|
||||||
|
//
|
||||||
|
comboM2.BorderColor = Color.White;
|
||||||
|
comboM2.ButtonColor = Color.FromArgb(255, 255, 255);
|
||||||
|
comboM2.FormattingEnabled = true;
|
||||||
|
comboM2.Items.AddRange(new object[] { Strings.Default, Strings.VolumeMute, Strings.PlayPause, Strings.PrintScreen, Strings.ToggleAura, Strings.Custom });
|
||||||
|
comboM2.Location = new Point(188, 63);
|
||||||
|
comboM2.Name = "comboM2";
|
||||||
|
comboM2.Size = new Size(312, 40);
|
||||||
|
comboM2.TabIndex = 12;
|
||||||
|
//
|
||||||
|
// pictureHelp
|
||||||
|
//
|
||||||
|
pictureHelp.BackgroundImage = Resources.icons8_help_64;
|
||||||
|
pictureHelp.BackgroundImageLayout = ImageLayout.Zoom;
|
||||||
|
pictureHelp.Cursor = Cursors.Hand;
|
||||||
|
pictureHelp.Location = new Point(906, 51);
|
||||||
|
pictureHelp.Name = "pictureHelp";
|
||||||
|
pictureHelp.Size = new Size(32, 32);
|
||||||
|
pictureHelp.TabIndex = 9;
|
||||||
|
pictureHelp.TabStop = false;
|
||||||
|
//
|
||||||
// groupLight
|
// groupLight
|
||||||
//
|
//
|
||||||
groupLight.AutoSize = true;
|
groupLight.AutoSize = true;
|
||||||
@@ -211,7 +300,7 @@ namespace GHelper
|
|||||||
groupLight.Controls.Add(panelXMG);
|
groupLight.Controls.Add(panelXMG);
|
||||||
groupLight.Controls.Add(tableBacklight);
|
groupLight.Controls.Add(tableBacklight);
|
||||||
groupLight.Dock = DockStyle.Top;
|
groupLight.Dock = DockStyle.Top;
|
||||||
groupLight.Location = new Point(10, 252);
|
groupLight.Location = new Point(10, 334);
|
||||||
groupLight.Name = "groupLight";
|
groupLight.Name = "groupLight";
|
||||||
groupLight.Size = new Size(954, 516);
|
groupLight.Size = new Size(954, 516);
|
||||||
groupLight.TabIndex = 1;
|
groupLight.TabIndex = 1;
|
||||||
@@ -579,7 +668,7 @@ namespace GHelper
|
|||||||
groupOther.Controls.Add(checkNoOverdrive);
|
groupOther.Controls.Add(checkNoOverdrive);
|
||||||
groupOther.Controls.Add(checkTopmost);
|
groupOther.Controls.Add(checkTopmost);
|
||||||
groupOther.Dock = DockStyle.Top;
|
groupOther.Dock = DockStyle.Top;
|
||||||
groupOther.Location = new Point(10, 768);
|
groupOther.Location = new Point(10, 850);
|
||||||
groupOther.Name = "groupOther";
|
groupOther.Name = "groupOther";
|
||||||
groupOther.Size = new Size(954, 276);
|
groupOther.Size = new Size(954, 276);
|
||||||
groupOther.TabIndex = 2;
|
groupOther.TabIndex = 2;
|
||||||
@@ -643,7 +732,7 @@ namespace GHelper
|
|||||||
AutoScaleMode = AutoScaleMode.Font;
|
AutoScaleMode = AutoScaleMode.Font;
|
||||||
AutoSize = true;
|
AutoSize = true;
|
||||||
AutoSizeMode = AutoSizeMode.GrowAndShrink;
|
AutoSizeMode = AutoSizeMode.GrowAndShrink;
|
||||||
ClientSize = new Size(974, 1059);
|
ClientSize = new Size(974, 1131);
|
||||||
Controls.Add(groupOther);
|
Controls.Add(groupOther);
|
||||||
Controls.Add(groupLight);
|
Controls.Add(groupLight);
|
||||||
Controls.Add(groupBindings);
|
Controls.Add(groupBindings);
|
||||||
@@ -658,7 +747,8 @@ namespace GHelper
|
|||||||
ShowInTaskbar = false;
|
ShowInTaskbar = false;
|
||||||
Text = "Extra Settings";
|
Text = "Extra Settings";
|
||||||
groupBindings.ResumeLayout(false);
|
groupBindings.ResumeLayout(false);
|
||||||
groupBindings.PerformLayout();
|
tableKeys.ResumeLayout(false);
|
||||||
|
tableKeys.PerformLayout();
|
||||||
((System.ComponentModel.ISupportInitialize)pictureHelp).EndInit();
|
((System.ComponentModel.ISupportInitialize)pictureHelp).EndInit();
|
||||||
groupLight.ResumeLayout(false);
|
groupLight.ResumeLayout(false);
|
||||||
groupLight.PerformLayout();
|
groupLight.PerformLayout();
|
||||||
@@ -725,5 +815,12 @@ namespace GHelper
|
|||||||
private NumericUpDown numericBacklightTime;
|
private NumericUpDown numericBacklightTime;
|
||||||
private CheckBox checkKeyboardAuto;
|
private CheckBox checkKeyboardAuto;
|
||||||
private CheckBox checkAutoApplyWindowsPowerMode;
|
private CheckBox checkAutoApplyWindowsPowerMode;
|
||||||
|
private TableLayoutPanel tableKeys;
|
||||||
|
private Label labelM1;
|
||||||
|
private Label labelM2;
|
||||||
|
private RComboBox comboM1;
|
||||||
|
private RComboBox comboM2;
|
||||||
|
private TextBox textM2;
|
||||||
|
private TextBox textM1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
152
app/Extra.cs
@@ -21,13 +21,25 @@ namespace GHelper
|
|||||||
|
|
||||||
private void SetKeyCombo(ComboBox combo, TextBox txbox, string name)
|
private void SetKeyCombo(ComboBox combo, TextBox txbox, string name)
|
||||||
{
|
{
|
||||||
if (name == "m4")
|
|
||||||
customActions[""] = Properties.Strings.OpenGHelper;
|
|
||||||
|
|
||||||
if (name == "fnf4")
|
switch (name)
|
||||||
{
|
{
|
||||||
customActions[""] = Properties.Strings.ToggleAura;
|
case "m1":
|
||||||
customActions.Remove("aura");
|
customActions[""] = Properties.Strings.VolumeDown;
|
||||||
|
break;
|
||||||
|
case "m2":
|
||||||
|
customActions[""] = Properties.Strings.VolumeUp;
|
||||||
|
break;
|
||||||
|
case "m3":
|
||||||
|
customActions[""] = Properties.Strings.MuteMic;
|
||||||
|
break;
|
||||||
|
case "m4":
|
||||||
|
customActions[""] = Properties.Strings.OpenGHelper;
|
||||||
|
break;
|
||||||
|
case "fnf4":
|
||||||
|
customActions[""] = Properties.Strings.ToggleAura;
|
||||||
|
customActions.Remove("aura");
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
combo.DropDownStyle = ComboBoxStyle.DropDownList;
|
combo.DropDownStyle = ComboBoxStyle.DropDownList;
|
||||||
@@ -35,7 +47,7 @@ namespace GHelper
|
|||||||
combo.DisplayMember = "Value";
|
combo.DisplayMember = "Value";
|
||||||
combo.ValueMember = "Key";
|
combo.ValueMember = "Key";
|
||||||
|
|
||||||
string action = Program.config.getConfigString(name);
|
string action = AppConfig.getConfigString(name);
|
||||||
|
|
||||||
combo.SelectedValue = (action is not null) ? action : "";
|
combo.SelectedValue = (action is not null) ? action : "";
|
||||||
if (combo.SelectedValue is null) combo.SelectedValue = "";
|
if (combo.SelectedValue is null) combo.SelectedValue = "";
|
||||||
@@ -43,13 +55,17 @@ namespace GHelper
|
|||||||
combo.SelectedValueChanged += delegate
|
combo.SelectedValueChanged += delegate
|
||||||
{
|
{
|
||||||
if (combo.SelectedValue is not null)
|
if (combo.SelectedValue is not null)
|
||||||
Program.config.setConfig(name, combo.SelectedValue.ToString());
|
AppConfig.setConfig(name, combo.SelectedValue.ToString());
|
||||||
|
|
||||||
|
if (name == "m1" || name == "m2")
|
||||||
|
Program.inputDispatcher.RegisterKeys();
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
txbox.Text = Program.config.getConfigString(name + "_custom");
|
txbox.Text = AppConfig.getConfigString(name + "_custom");
|
||||||
txbox.TextChanged += delegate
|
txbox.TextChanged += delegate
|
||||||
{
|
{
|
||||||
Program.config.setConfig(name + "_custom", txbox.Text);
|
AppConfig.setConfig(name + "_custom", txbox.Text);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -85,6 +101,8 @@ namespace GHelper
|
|||||||
|
|
||||||
InitTheme();
|
InitTheme();
|
||||||
|
|
||||||
|
SetKeyCombo(comboM1, textM1, "m1");
|
||||||
|
SetKeyCombo(comboM2, textM2, "m2");
|
||||||
SetKeyCombo(comboM3, textM3, "m3");
|
SetKeyCombo(comboM3, textM3, "m3");
|
||||||
SetKeyCombo(comboM4, textM4, "m4");
|
SetKeyCombo(comboM4, textM4, "m4");
|
||||||
SetKeyCombo(comboFNF4, textFNF4, "fnf4");
|
SetKeyCombo(comboFNF4, textFNF4, "fnf4");
|
||||||
@@ -92,35 +110,35 @@ namespace GHelper
|
|||||||
Shown += Keyboard_Shown;
|
Shown += Keyboard_Shown;
|
||||||
|
|
||||||
comboKeyboardSpeed.DropDownStyle = ComboBoxStyle.DropDownList;
|
comboKeyboardSpeed.DropDownStyle = ComboBoxStyle.DropDownList;
|
||||||
comboKeyboardSpeed.DataSource = new BindingSource(Aura.GetSpeeds(), null);
|
comboKeyboardSpeed.DataSource = new BindingSource(AsusUSB.GetSpeeds(), null);
|
||||||
comboKeyboardSpeed.DisplayMember = "Value";
|
comboKeyboardSpeed.DisplayMember = "Value";
|
||||||
comboKeyboardSpeed.ValueMember = "Key";
|
comboKeyboardSpeed.ValueMember = "Key";
|
||||||
comboKeyboardSpeed.SelectedValue = Aura.Speed;
|
comboKeyboardSpeed.SelectedValue = AsusUSB.Speed;
|
||||||
comboKeyboardSpeed.SelectedValueChanged += ComboKeyboardSpeed_SelectedValueChanged;
|
comboKeyboardSpeed.SelectedValueChanged += ComboKeyboardSpeed_SelectedValueChanged;
|
||||||
|
|
||||||
// Keyboard
|
// Keyboard
|
||||||
checkAwake.Checked = !(Program.config.getConfig("keyboard_awake") == 0);
|
checkAwake.Checked = !(AppConfig.getConfig("keyboard_awake") == 0);
|
||||||
checkBoot.Checked = !(Program.config.getConfig("keyboard_boot") == 0);
|
checkBoot.Checked = !(AppConfig.getConfig("keyboard_boot") == 0);
|
||||||
checkSleep.Checked = !(Program.config.getConfig("keyboard_sleep") == 0);
|
checkSleep.Checked = !(AppConfig.getConfig("keyboard_sleep") == 0);
|
||||||
checkShutdown.Checked = !(Program.config.getConfig("keyboard_shutdown") == 0);
|
checkShutdown.Checked = !(AppConfig.getConfig("keyboard_shutdown") == 0);
|
||||||
|
|
||||||
// Lightbar
|
// Lightbar
|
||||||
checkAwakeBar.Checked = !(Program.config.getConfig("keyboard_awake_bar") == 0);
|
checkAwakeBar.Checked = !(AppConfig.getConfig("keyboard_awake_bar") == 0);
|
||||||
checkBootBar.Checked = !(Program.config.getConfig("keyboard_boot_bar") == 0);
|
checkBootBar.Checked = !(AppConfig.getConfig("keyboard_boot_bar") == 0);
|
||||||
checkSleepBar.Checked = !(Program.config.getConfig("keyboard_sleep_bar") == 0);
|
checkSleepBar.Checked = !(AppConfig.getConfig("keyboard_sleep_bar") == 0);
|
||||||
checkShutdownBar.Checked = !(Program.config.getConfig("keyboard_shutdown_bar") == 0);
|
checkShutdownBar.Checked = !(AppConfig.getConfig("keyboard_shutdown_bar") == 0);
|
||||||
|
|
||||||
// Lid
|
// Lid
|
||||||
checkAwakeLid.Checked = !(Program.config.getConfig("keyboard_awake_lid") == 0);
|
checkAwakeLid.Checked = !(AppConfig.getConfig("keyboard_awake_lid") == 0);
|
||||||
checkBootLid.Checked = !(Program.config.getConfig("keyboard_boot_lid") == 0);
|
checkBootLid.Checked = !(AppConfig.getConfig("keyboard_boot_lid") == 0);
|
||||||
checkSleepLid.Checked = !(Program.config.getConfig("keyboard_sleep_lid") == 0);
|
checkSleepLid.Checked = !(AppConfig.getConfig("keyboard_sleep_lid") == 0);
|
||||||
checkShutdownLid.Checked = !(Program.config.getConfig("keyboard_shutdown_lid") == 0);
|
checkShutdownLid.Checked = !(AppConfig.getConfig("keyboard_shutdown_lid") == 0);
|
||||||
|
|
||||||
// Logo
|
// Logo
|
||||||
checkAwakeLogo.Checked = !(Program.config.getConfig("keyboard_awake_logo") == 0);
|
checkAwakeLogo.Checked = !(AppConfig.getConfig("keyboard_awake_logo") == 0);
|
||||||
checkBootLogo.Checked = !(Program.config.getConfig("keyboard_boot_logo") == 0);
|
checkBootLogo.Checked = !(AppConfig.getConfig("keyboard_boot_logo") == 0);
|
||||||
checkSleepLogo.Checked = !(Program.config.getConfig("keyboard_sleep_logo") == 0);
|
checkSleepLogo.Checked = !(AppConfig.getConfig("keyboard_sleep_logo") == 0);
|
||||||
checkShutdownLogo.Checked = !(Program.config.getConfig("keyboard_shutdown_logo") == 0);
|
checkShutdownLogo.Checked = !(AppConfig.getConfig("keyboard_shutdown_logo") == 0);
|
||||||
|
|
||||||
checkAwake.CheckedChanged += CheckPower_CheckedChanged;
|
checkAwake.CheckedChanged += CheckPower_CheckedChanged;
|
||||||
checkBoot.CheckedChanged += CheckPower_CheckedChanged;
|
checkBoot.CheckedChanged += CheckPower_CheckedChanged;
|
||||||
@@ -142,7 +160,7 @@ namespace GHelper
|
|||||||
checkSleepLogo.CheckedChanged += CheckPower_CheckedChanged;
|
checkSleepLogo.CheckedChanged += CheckPower_CheckedChanged;
|
||||||
checkShutdownLogo.CheckedChanged += CheckPower_CheckedChanged;
|
checkShutdownLogo.CheckedChanged += CheckPower_CheckedChanged;
|
||||||
|
|
||||||
if (!Program.config.ContainsModel("Strix"))
|
if (!AppConfig.ContainsModel("Strix"))
|
||||||
{
|
{
|
||||||
labelBacklightBar.Visible = false;
|
labelBacklightBar.Visible = false;
|
||||||
checkAwakeBar.Visible = false;
|
checkAwakeBar.Visible = false;
|
||||||
@@ -150,7 +168,7 @@ namespace GHelper
|
|||||||
checkSleepBar.Visible = false;
|
checkSleepBar.Visible = false;
|
||||||
checkShutdownBar.Visible = false;
|
checkShutdownBar.Visible = false;
|
||||||
|
|
||||||
if (!Program.config.ContainsModel("Z13"))
|
if (!AppConfig.ContainsModel("Z13"))
|
||||||
{
|
{
|
||||||
labelBacklightLid.Visible = false;
|
labelBacklightLid.Visible = false;
|
||||||
checkAwakeLid.Visible = false;
|
checkAwakeLid.Visible = false;
|
||||||
@@ -166,32 +184,32 @@ namespace GHelper
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
checkTopmost.Checked = (Program.config.getConfig("topmost") == 1);
|
checkTopmost.Checked = (AppConfig.getConfig("topmost") == 1);
|
||||||
checkTopmost.CheckedChanged += CheckTopmost_CheckedChanged; ;
|
checkTopmost.CheckedChanged += CheckTopmost_CheckedChanged; ;
|
||||||
|
|
||||||
checkKeyboardAuto.Checked = (Program.config.getConfig("keyboard_auto") == 1);
|
checkKeyboardAuto.Checked = (AppConfig.getConfig("keyboard_auto") == 1);
|
||||||
checkKeyboardAuto.CheckedChanged += CheckKeyboardAuto_CheckedChanged;
|
checkKeyboardAuto.CheckedChanged += CheckKeyboardAuto_CheckedChanged;
|
||||||
|
|
||||||
checkNoOverdrive.Checked = (Program.config.getConfig("no_overdrive") == 1);
|
checkNoOverdrive.Checked = (AppConfig.getConfig("no_overdrive") == 1);
|
||||||
checkNoOverdrive.CheckedChanged += CheckNoOverdrive_CheckedChanged;
|
checkNoOverdrive.CheckedChanged += CheckNoOverdrive_CheckedChanged;
|
||||||
|
|
||||||
checkUSBC.Checked = (Program.config.getConfig("optimized_usbc") == 1);
|
checkUSBC.Checked = (AppConfig.getConfig("optimized_usbc") == 1);
|
||||||
checkUSBC.CheckedChanged += CheckUSBC_CheckedChanged;
|
checkUSBC.CheckedChanged += CheckUSBC_CheckedChanged;
|
||||||
|
|
||||||
checkAutoApplyWindowsPowerMode.Checked = (Program.config.getConfig("auto_apply_power_plan") != 0);
|
checkAutoApplyWindowsPowerMode.Checked = (AppConfig.getConfig("auto_apply_power_plan") != 0);
|
||||||
checkAutoApplyWindowsPowerMode.CheckedChanged += checkAutoApplyWindowsPowerMode_CheckedChanged;
|
checkAutoApplyWindowsPowerMode.CheckedChanged += checkAutoApplyWindowsPowerMode_CheckedChanged;
|
||||||
|
|
||||||
int kb_brightness = Program.config.getConfig("keyboard_brightness");
|
int kb_brightness = AppConfig.getConfig("keyboard_brightness");
|
||||||
trackBrightness.Value = (kb_brightness >= 0 && kb_brightness <= 3) ? kb_brightness : 3;
|
trackBrightness.Value = (kb_brightness >= 0 && kb_brightness <= 3) ? kb_brightness : 3;
|
||||||
|
|
||||||
pictureHelp.Click += PictureHelp_Click;
|
pictureHelp.Click += PictureHelp_Click;
|
||||||
trackBrightness.Scroll += TrackBrightness_Scroll;
|
trackBrightness.Scroll += TrackBrightness_Scroll;
|
||||||
|
|
||||||
panelXMG.Visible = (Program.wmi.DeviceGet(ASUSWmi.GPUXGConnected) == 1);
|
panelXMG.Visible = (Program.acpi.DeviceGet(AsusACPI.GPUXGConnected) == 1);
|
||||||
checkXMG.Checked = !(Program.config.getConfig("xmg_light") == 0);
|
checkXMG.Checked = !(AppConfig.getConfig("xmg_light") == 0);
|
||||||
checkXMG.CheckedChanged += CheckXMG_CheckedChanged;
|
checkXMG.CheckedChanged += CheckXMG_CheckedChanged;
|
||||||
|
|
||||||
int kb_timeout = Program.config.getConfig("keyboard_light_tiomeout");
|
int kb_timeout = AppConfig.getConfig("keyboard_light_tiomeout");
|
||||||
numericBacklightTime.Value = (kb_timeout >= 0) ? kb_timeout : 60;
|
numericBacklightTime.Value = (kb_timeout >= 0) ? kb_timeout : 60;
|
||||||
|
|
||||||
numericBacklightTime.ValueChanged += NumericBacklightTime_ValueChanged;
|
numericBacklightTime.ValueChanged += NumericBacklightTime_ValueChanged;
|
||||||
@@ -201,25 +219,25 @@ namespace GHelper
|
|||||||
private void NumericBacklightTime_ValueChanged(object? sender, EventArgs e)
|
private void NumericBacklightTime_ValueChanged(object? sender, EventArgs e)
|
||||||
{
|
{
|
||||||
Program.RunAsAdmin("extra");
|
Program.RunAsAdmin("extra");
|
||||||
Program.config.setConfig("keyboard_light_tiomeout", (int)numericBacklightTime.Value);
|
AppConfig.setConfig("keyboard_light_tiomeout", (int)numericBacklightTime.Value);
|
||||||
Aura.SetBacklightOffDelay((int)numericBacklightTime.Value);
|
AsusUSB.SetBacklightOffDelay((int)numericBacklightTime.Value);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void CheckXMG_CheckedChanged(object? sender, EventArgs e)
|
private void CheckXMG_CheckedChanged(object? sender, EventArgs e)
|
||||||
{
|
{
|
||||||
Program.config.setConfig("xmg_light", (checkXMG.Checked ? 1 : 0));
|
AppConfig.setConfig("xmg_light", (checkXMG.Checked ? 1 : 0));
|
||||||
Aura.ApplyXGMLight(checkXMG.Checked);
|
AsusUSB.ApplyXGMLight(checkXMG.Checked);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void CheckUSBC_CheckedChanged(object? sender, EventArgs e)
|
private void CheckUSBC_CheckedChanged(object? sender, EventArgs e)
|
||||||
{
|
{
|
||||||
Program.config.setConfig("optimized_usbc", (checkUSBC.Checked ? 1 : 0));
|
AppConfig.setConfig("optimized_usbc", (checkUSBC.Checked ? 1 : 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void TrackBrightness_Scroll(object? sender, EventArgs e)
|
private void TrackBrightness_Scroll(object? sender, EventArgs e)
|
||||||
{
|
{
|
||||||
Program.config.setConfig("keyboard_brightness", trackBrightness.Value);
|
AppConfig.setConfig("keyboard_brightness", trackBrightness.Value);
|
||||||
Aura.ApplyBrightness(trackBrightness.Value);
|
AsusUSB.ApplyBrightness(trackBrightness.Value);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void PictureHelp_Click(object? sender, EventArgs e)
|
private void PictureHelp_Click(object? sender, EventArgs e)
|
||||||
@@ -229,42 +247,42 @@ namespace GHelper
|
|||||||
|
|
||||||
private void CheckNoOverdrive_CheckedChanged(object? sender, EventArgs e)
|
private void CheckNoOverdrive_CheckedChanged(object? sender, EventArgs e)
|
||||||
{
|
{
|
||||||
Program.config.setConfig("no_overdrive", (checkNoOverdrive.Checked ? 1 : 0));
|
AppConfig.setConfig("no_overdrive", (checkNoOverdrive.Checked ? 1 : 0));
|
||||||
Program.settingsForm.AutoScreen(true);
|
Program.settingsForm.AutoScreen(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void CheckKeyboardAuto_CheckedChanged(object? sender, EventArgs e)
|
private void CheckKeyboardAuto_CheckedChanged(object? sender, EventArgs e)
|
||||||
{
|
{
|
||||||
Program.config.setConfig("keyboard_auto", (checkKeyboardAuto.Checked ? 1 : 0));
|
AppConfig.setConfig("keyboard_auto", (checkKeyboardAuto.Checked ? 1 : 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void CheckTopmost_CheckedChanged(object? sender, EventArgs e)
|
private void CheckTopmost_CheckedChanged(object? sender, EventArgs e)
|
||||||
{
|
{
|
||||||
Program.config.setConfig("topmost", (checkTopmost.Checked ? 1 : 0));
|
AppConfig.setConfig("topmost", (checkTopmost.Checked ? 1 : 0));
|
||||||
Program.settingsForm.TopMost = checkTopmost.Checked;
|
Program.settingsForm.TopMost = checkTopmost.Checked;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void CheckPower_CheckedChanged(object? sender, EventArgs e)
|
private void CheckPower_CheckedChanged(object? sender, EventArgs e)
|
||||||
{
|
{
|
||||||
Program.config.setConfig("keyboard_awake", (checkAwake.Checked ? 1 : 0));
|
AppConfig.setConfig("keyboard_awake", (checkAwake.Checked ? 1 : 0));
|
||||||
Program.config.setConfig("keyboard_boot", (checkBoot.Checked ? 1 : 0));
|
AppConfig.setConfig("keyboard_boot", (checkBoot.Checked ? 1 : 0));
|
||||||
Program.config.setConfig("keyboard_sleep", (checkSleep.Checked ? 1 : 0));
|
AppConfig.setConfig("keyboard_sleep", (checkSleep.Checked ? 1 : 0));
|
||||||
Program.config.setConfig("keyboard_shutdown", (checkShutdown.Checked ? 1 : 0));
|
AppConfig.setConfig("keyboard_shutdown", (checkShutdown.Checked ? 1 : 0));
|
||||||
|
|
||||||
Program.config.setConfig("keyboard_awake_bar", (checkAwakeBar.Checked ? 1 : 0));
|
AppConfig.setConfig("keyboard_awake_bar", (checkAwakeBar.Checked ? 1 : 0));
|
||||||
Program.config.setConfig("keyboard_boot_bar", (checkBootBar.Checked ? 1 : 0));
|
AppConfig.setConfig("keyboard_boot_bar", (checkBootBar.Checked ? 1 : 0));
|
||||||
Program.config.setConfig("keyboard_sleep_bar", (checkSleepBar.Checked ? 1 : 0));
|
AppConfig.setConfig("keyboard_sleep_bar", (checkSleepBar.Checked ? 1 : 0));
|
||||||
Program.config.setConfig("keyboard_shutdown_bar", (checkShutdownBar.Checked ? 1 : 0));
|
AppConfig.setConfig("keyboard_shutdown_bar", (checkShutdownBar.Checked ? 1 : 0));
|
||||||
|
|
||||||
Program.config.setConfig("keyboard_awake_lid", (checkAwakeLid.Checked ? 1 : 0));
|
AppConfig.setConfig("keyboard_awake_lid", (checkAwakeLid.Checked ? 1 : 0));
|
||||||
Program.config.setConfig("keyboard_boot_lid", (checkBootLid.Checked ? 1 : 0));
|
AppConfig.setConfig("keyboard_boot_lid", (checkBootLid.Checked ? 1 : 0));
|
||||||
Program.config.setConfig("keyboard_sleep_lid", (checkSleepLid.Checked ? 1 : 0));
|
AppConfig.setConfig("keyboard_sleep_lid", (checkSleepLid.Checked ? 1 : 0));
|
||||||
Program.config.setConfig("keyboard_shutdown_lid", (checkShutdownLid.Checked ? 1 : 0));
|
AppConfig.setConfig("keyboard_shutdown_lid", (checkShutdownLid.Checked ? 1 : 0));
|
||||||
|
|
||||||
Program.config.setConfig("keyboard_awake_logo", (checkAwakeLogo.Checked ? 1 : 0));
|
AppConfig.setConfig("keyboard_awake_logo", (checkAwakeLogo.Checked ? 1 : 0));
|
||||||
Program.config.setConfig("keyboard_boot_logo", (checkBootLogo.Checked ? 1 : 0));
|
AppConfig.setConfig("keyboard_boot_logo", (checkBootLogo.Checked ? 1 : 0));
|
||||||
Program.config.setConfig("keyboard_sleep_logo", (checkSleepLogo.Checked ? 1 : 0));
|
AppConfig.setConfig("keyboard_sleep_logo", (checkSleepLogo.Checked ? 1 : 0));
|
||||||
Program.config.setConfig("keyboard_shutdown_logo", (checkShutdownLogo.Checked ? 1 : 0));
|
AppConfig.setConfig("keyboard_shutdown_logo", (checkShutdownLogo.Checked ? 1 : 0));
|
||||||
|
|
||||||
List<AuraDev19b6> flags = new List<AuraDev19b6>();
|
List<AuraDev19b6> flags = new List<AuraDev19b6>();
|
||||||
|
|
||||||
@@ -288,13 +306,13 @@ namespace GHelper
|
|||||||
if (checkSleepLogo.Checked) flags.Add(AuraDev19b6.SleepLogo);
|
if (checkSleepLogo.Checked) flags.Add(AuraDev19b6.SleepLogo);
|
||||||
if (checkShutdownLogo.Checked) flags.Add(AuraDev19b6.ShutdownLogo);
|
if (checkShutdownLogo.Checked) flags.Add(AuraDev19b6.ShutdownLogo);
|
||||||
|
|
||||||
Aura.ApplyAuraPower(flags);
|
AsusUSB.ApplyAuraPower(flags);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ComboKeyboardSpeed_SelectedValueChanged(object? sender, EventArgs e)
|
private void ComboKeyboardSpeed_SelectedValueChanged(object? sender, EventArgs e)
|
||||||
{
|
{
|
||||||
Program.config.setConfig("aura_speed", (int)comboKeyboardSpeed.SelectedValue);
|
AppConfig.setConfig("aura_speed", (int)comboKeyboardSpeed.SelectedValue);
|
||||||
Program.settingsForm.SetAura();
|
Program.settingsForm.SetAura();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -307,7 +325,7 @@ namespace GHelper
|
|||||||
|
|
||||||
private void checkAutoApplyWindowsPowerMode_CheckedChanged(object? sender, EventArgs e)
|
private void checkAutoApplyWindowsPowerMode_CheckedChanged(object? sender, EventArgs e)
|
||||||
{
|
{
|
||||||
Program.config.setConfig("auto_apply_power_plan", checkAutoApplyWindowsPowerMode.Checked ? 1 : 0);
|
AppConfig.setConfig("auto_apply_power_plan", checkAutoApplyWindowsPowerMode.Checked ? 1 : 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
309
app/Fans.Designer.cs
generated
@@ -31,23 +31,28 @@ namespace GHelper
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private void InitializeComponent()
|
private void InitializeComponent()
|
||||||
{
|
{
|
||||||
ChartArea chartArea1 = new ChartArea();
|
ChartArea chartArea9 = new ChartArea();
|
||||||
Title title1 = new Title();
|
Title title9 = new Title();
|
||||||
ChartArea chartArea2 = new ChartArea();
|
ChartArea chartArea10 = new ChartArea();
|
||||||
Title title2 = new Title();
|
Title title10 = new Title();
|
||||||
ChartArea chartArea3 = new ChartArea();
|
ChartArea chartArea11 = new ChartArea();
|
||||||
Title title3 = new Title();
|
Title title11 = new Title();
|
||||||
|
ChartArea chartArea12 = new ChartArea();
|
||||||
|
Title title12 = new Title();
|
||||||
panelFans = new Panel();
|
panelFans = new Panel();
|
||||||
labelFansResult = new Label();
|
|
||||||
labelTip = new Label();
|
labelTip = new Label();
|
||||||
labelBoost = new Label();
|
|
||||||
comboBoost = new RComboBox();
|
|
||||||
picturePerf = new PictureBox();
|
|
||||||
tableFanCharts = new TableLayoutPanel();
|
tableFanCharts = new TableLayoutPanel();
|
||||||
chartGPU = new Chart();
|
chartGPU = new Chart();
|
||||||
chartCPU = new Chart();
|
chartCPU = new Chart();
|
||||||
|
chartXGM = new Chart();
|
||||||
chartMid = new Chart();
|
chartMid = new Chart();
|
||||||
|
panelTitleFans = new Panel();
|
||||||
|
labelBoost = new Label();
|
||||||
|
comboBoost = new RComboBox();
|
||||||
|
picturePerf = new PictureBox();
|
||||||
labelFans = new Label();
|
labelFans = new Label();
|
||||||
|
panelApplyFans = new Panel();
|
||||||
|
labelFansResult = new Label();
|
||||||
checkApplyFans = new RCheckBox();
|
checkApplyFans = new RCheckBox();
|
||||||
buttonReset = new RButton();
|
buttonReset = new RButton();
|
||||||
panelSliders = new Panel();
|
panelSliders = new Panel();
|
||||||
@@ -87,11 +92,14 @@ namespace GHelper
|
|||||||
pictureGPU = new PictureBox();
|
pictureGPU = new PictureBox();
|
||||||
labelGPU = new Label();
|
labelGPU = new Label();
|
||||||
panelFans.SuspendLayout();
|
panelFans.SuspendLayout();
|
||||||
((System.ComponentModel.ISupportInitialize)picturePerf).BeginInit();
|
|
||||||
tableFanCharts.SuspendLayout();
|
tableFanCharts.SuspendLayout();
|
||||||
((System.ComponentModel.ISupportInitialize)chartGPU).BeginInit();
|
((System.ComponentModel.ISupportInitialize)chartGPU).BeginInit();
|
||||||
((System.ComponentModel.ISupportInitialize)chartCPU).BeginInit();
|
((System.ComponentModel.ISupportInitialize)chartCPU).BeginInit();
|
||||||
|
((System.ComponentModel.ISupportInitialize)chartXGM).BeginInit();
|
||||||
((System.ComponentModel.ISupportInitialize)chartMid).BeginInit();
|
((System.ComponentModel.ISupportInitialize)chartMid).BeginInit();
|
||||||
|
panelTitleFans.SuspendLayout();
|
||||||
|
((System.ComponentModel.ISupportInitialize)picturePerf).BeginInit();
|
||||||
|
panelApplyFans.SuspendLayout();
|
||||||
panelSliders.SuspendLayout();
|
panelSliders.SuspendLayout();
|
||||||
panelPower.SuspendLayout();
|
panelPower.SuspendLayout();
|
||||||
panelApplyPower.SuspendLayout();
|
panelApplyPower.SuspendLayout();
|
||||||
@@ -116,53 +124,132 @@ namespace GHelper
|
|||||||
//
|
//
|
||||||
// panelFans
|
// panelFans
|
||||||
//
|
//
|
||||||
panelFans.Controls.Add(labelFansResult);
|
panelFans.AutoSize = true;
|
||||||
|
panelFans.AutoSizeMode = AutoSizeMode.GrowAndShrink;
|
||||||
panelFans.Controls.Add(labelTip);
|
panelFans.Controls.Add(labelTip);
|
||||||
panelFans.Controls.Add(labelBoost);
|
|
||||||
panelFans.Controls.Add(comboBoost);
|
|
||||||
panelFans.Controls.Add(picturePerf);
|
|
||||||
panelFans.Controls.Add(tableFanCharts);
|
panelFans.Controls.Add(tableFanCharts);
|
||||||
panelFans.Controls.Add(labelFans);
|
panelFans.Controls.Add(panelTitleFans);
|
||||||
panelFans.Controls.Add(checkApplyFans);
|
panelFans.Controls.Add(panelApplyFans);
|
||||||
panelFans.Controls.Add(buttonReset);
|
|
||||||
panelFans.Dock = DockStyle.Left;
|
panelFans.Dock = DockStyle.Left;
|
||||||
panelFans.Location = new Point(533, 0);
|
panelFans.Location = new Point(533, 0);
|
||||||
panelFans.Margin = new Padding(0);
|
panelFans.Margin = new Padding(0);
|
||||||
|
panelFans.MaximumSize = new Size(815, 0);
|
||||||
|
panelFans.MinimumSize = new Size(815, 0);
|
||||||
panelFans.Name = "panelFans";
|
panelFans.Name = "panelFans";
|
||||||
panelFans.Padding = new Padding(10);
|
panelFans.Padding = new Padding(0, 0, 10, 0);
|
||||||
panelFans.Size = new Size(824, 1189);
|
panelFans.Size = new Size(815, 1189);
|
||||||
panelFans.TabIndex = 12;
|
panelFans.TabIndex = 12;
|
||||||
//
|
//
|
||||||
// labelFansResult
|
|
||||||
//
|
|
||||||
labelFansResult.Anchor = AnchorStyles.Top | AnchorStyles.Right;
|
|
||||||
labelFansResult.ForeColor = Color.Red;
|
|
||||||
labelFansResult.Location = new Point(30, 1073);
|
|
||||||
labelFansResult.Name = "labelFansResult";
|
|
||||||
labelFansResult.Size = new Size(760, 32);
|
|
||||||
labelFansResult.TabIndex = 41;
|
|
||||||
labelFansResult.TextAlign = ContentAlignment.TopRight;
|
|
||||||
labelFansResult.Visible = false;
|
|
||||||
//
|
|
||||||
// labelTip
|
// labelTip
|
||||||
//
|
//
|
||||||
labelTip.AutoSize = true;
|
labelTip.AutoSize = true;
|
||||||
labelTip.BackColor = SystemColors.ControlLightLight;
|
labelTip.BackColor = SystemColors.ControlLightLight;
|
||||||
labelTip.Location = new Point(155, 9);
|
labelTip.Location = new Point(684, 91);
|
||||||
labelTip.Name = "labelTip";
|
labelTip.Name = "labelTip";
|
||||||
labelTip.Padding = new Padding(5);
|
labelTip.Padding = new Padding(5);
|
||||||
labelTip.Size = new Size(107, 42);
|
labelTip.Size = new Size(107, 42);
|
||||||
labelTip.TabIndex = 40;
|
labelTip.TabIndex = 40;
|
||||||
labelTip.Text = "500,300";
|
labelTip.Text = "500,300";
|
||||||
//
|
//
|
||||||
|
// tableFanCharts
|
||||||
|
//
|
||||||
|
tableFanCharts.AutoSize = true;
|
||||||
|
tableFanCharts.ColumnCount = 1;
|
||||||
|
tableFanCharts.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100F));
|
||||||
|
tableFanCharts.Controls.Add(chartGPU, 0, 1);
|
||||||
|
tableFanCharts.Controls.Add(chartCPU, 0, 0);
|
||||||
|
tableFanCharts.Controls.Add(chartXGM, 0, 2);
|
||||||
|
tableFanCharts.Controls.Add(chartMid, 0, 2);
|
||||||
|
tableFanCharts.Dock = DockStyle.Fill;
|
||||||
|
tableFanCharts.Location = new Point(0, 66);
|
||||||
|
tableFanCharts.Margin = new Padding(4);
|
||||||
|
tableFanCharts.Name = "tableFanCharts";
|
||||||
|
tableFanCharts.Padding = new Padding(10, 0, 10, 10);
|
||||||
|
tableFanCharts.RowCount = 2;
|
||||||
|
tableFanCharts.RowStyles.Add(new RowStyle(SizeType.Percent, 25F));
|
||||||
|
tableFanCharts.RowStyles.Add(new RowStyle(SizeType.Percent, 25F));
|
||||||
|
tableFanCharts.RowStyles.Add(new RowStyle(SizeType.Percent, 25F));
|
||||||
|
tableFanCharts.RowStyles.Add(new RowStyle(SizeType.Percent, 25F));
|
||||||
|
tableFanCharts.Size = new Size(805, 1007);
|
||||||
|
tableFanCharts.TabIndex = 36;
|
||||||
|
//
|
||||||
|
// chartGPU
|
||||||
|
//
|
||||||
|
chartArea9.Name = "ChartArea1";
|
||||||
|
chartGPU.ChartAreas.Add(chartArea9);
|
||||||
|
chartGPU.Dock = DockStyle.Fill;
|
||||||
|
chartGPU.Location = new Point(12, 259);
|
||||||
|
chartGPU.Margin = new Padding(2, 10, 2, 10);
|
||||||
|
chartGPU.Name = "chartGPU";
|
||||||
|
chartGPU.Size = new Size(781, 229);
|
||||||
|
chartGPU.TabIndex = 17;
|
||||||
|
chartGPU.Text = "chartGPU";
|
||||||
|
title9.Name = "Title1";
|
||||||
|
chartGPU.Titles.Add(title9);
|
||||||
|
//
|
||||||
|
// chartCPU
|
||||||
|
//
|
||||||
|
chartArea10.Name = "ChartArea1";
|
||||||
|
chartCPU.ChartAreas.Add(chartArea10);
|
||||||
|
chartCPU.Dock = DockStyle.Fill;
|
||||||
|
chartCPU.Location = new Point(12, 10);
|
||||||
|
chartCPU.Margin = new Padding(2, 10, 2, 10);
|
||||||
|
chartCPU.Name = "chartCPU";
|
||||||
|
chartCPU.Size = new Size(781, 229);
|
||||||
|
chartCPU.TabIndex = 14;
|
||||||
|
chartCPU.Text = "chartCPU";
|
||||||
|
title10.Name = "Title1";
|
||||||
|
chartCPU.Titles.Add(title10);
|
||||||
|
//
|
||||||
|
// chartXGM
|
||||||
|
//
|
||||||
|
chartArea11.Name = "ChartAreaXGM";
|
||||||
|
chartXGM.ChartAreas.Add(chartArea11);
|
||||||
|
chartXGM.Dock = DockStyle.Fill;
|
||||||
|
chartXGM.Location = new Point(12, 757);
|
||||||
|
chartXGM.Margin = new Padding(2, 10, 2, 10);
|
||||||
|
chartXGM.Name = "chartXGM";
|
||||||
|
chartXGM.Size = new Size(781, 230);
|
||||||
|
chartXGM.TabIndex = 14;
|
||||||
|
chartXGM.Text = "chartXGM";
|
||||||
|
title11.Name = "Title4";
|
||||||
|
chartXGM.Titles.Add(title11);
|
||||||
|
chartXGM.Visible = false;
|
||||||
|
//
|
||||||
|
// chartMid
|
||||||
|
//
|
||||||
|
chartArea12.Name = "ChartArea3";
|
||||||
|
chartMid.ChartAreas.Add(chartArea12);
|
||||||
|
chartMid.Dock = DockStyle.Fill;
|
||||||
|
chartMid.Location = new Point(12, 508);
|
||||||
|
chartMid.Margin = new Padding(2, 10, 2, 10);
|
||||||
|
chartMid.Name = "chartMid";
|
||||||
|
chartMid.Size = new Size(781, 229);
|
||||||
|
chartMid.TabIndex = 14;
|
||||||
|
chartMid.Text = "chartMid";
|
||||||
|
title12.Name = "Title3";
|
||||||
|
chartMid.Titles.Add(title12);
|
||||||
|
chartMid.Visible = false;
|
||||||
|
//
|
||||||
|
// panelTitleFans
|
||||||
|
//
|
||||||
|
panelTitleFans.Controls.Add(labelBoost);
|
||||||
|
panelTitleFans.Controls.Add(comboBoost);
|
||||||
|
panelTitleFans.Controls.Add(picturePerf);
|
||||||
|
panelTitleFans.Controls.Add(labelFans);
|
||||||
|
panelTitleFans.Dock = DockStyle.Top;
|
||||||
|
panelTitleFans.Location = new Point(0, 0);
|
||||||
|
panelTitleFans.Name = "panelTitleFans";
|
||||||
|
panelTitleFans.Size = new Size(805, 66);
|
||||||
|
panelTitleFans.TabIndex = 42;
|
||||||
|
//
|
||||||
// labelBoost
|
// labelBoost
|
||||||
//
|
//
|
||||||
labelBoost.Anchor = AnchorStyles.Top | AnchorStyles.Right;
|
labelBoost.Anchor = AnchorStyles.Top | AnchorStyles.Right;
|
||||||
labelBoost.AutoSize = true;
|
labelBoost.Location = new Point(356, 20);
|
||||||
labelBoost.Location = new Point(375, 17);
|
|
||||||
labelBoost.Name = "labelBoost";
|
labelBoost.Name = "labelBoost";
|
||||||
labelBoost.Size = new Size(125, 32);
|
labelBoost.Size = new Size(140, 32);
|
||||||
labelBoost.TabIndex = 39;
|
labelBoost.TabIndex = 43;
|
||||||
labelBoost.Text = "CPU Boost";
|
labelBoost.Text = "CPU Boost";
|
||||||
labelBoost.TextAlign = ContentAlignment.MiddleRight;
|
labelBoost.TextAlign = ContentAlignment.MiddleRight;
|
||||||
//
|
//
|
||||||
@@ -174,106 +261,67 @@ namespace GHelper
|
|||||||
comboBoost.DropDownStyle = ComboBoxStyle.DropDownList;
|
comboBoost.DropDownStyle = ComboBoxStyle.DropDownList;
|
||||||
comboBoost.FormattingEnabled = true;
|
comboBoost.FormattingEnabled = true;
|
||||||
comboBoost.Items.AddRange(new object[] { "Disabled", "Enabled", "Aggressive", "Efficient Enabled", "Efficient Aggressive" });
|
comboBoost.Items.AddRange(new object[] { "Disabled", "Enabled", "Aggressive", "Efficient Enabled", "Efficient Aggressive" });
|
||||||
comboBoost.Location = new Point(526, 15);
|
comboBoost.Location = new Point(506, 16);
|
||||||
comboBoost.Name = "comboBoost";
|
comboBoost.Name = "comboBoost";
|
||||||
comboBoost.Size = new Size(266, 40);
|
comboBoost.Size = new Size(287, 40);
|
||||||
comboBoost.TabIndex = 38;
|
comboBoost.TabIndex = 42;
|
||||||
//
|
//
|
||||||
// picturePerf
|
// picturePerf
|
||||||
//
|
//
|
||||||
picturePerf.BackgroundImage = Properties.Resources.icons8_fan_head_96;
|
picturePerf.BackgroundImage = Properties.Resources.icons8_fan_head_96;
|
||||||
picturePerf.BackgroundImageLayout = ImageLayout.Zoom;
|
picturePerf.BackgroundImageLayout = ImageLayout.Zoom;
|
||||||
picturePerf.InitialImage = null;
|
picturePerf.InitialImage = null;
|
||||||
picturePerf.Location = new Point(30, 18);
|
picturePerf.Location = new Point(20, 18);
|
||||||
picturePerf.Margin = new Padding(4, 2, 4, 2);
|
picturePerf.Margin = new Padding(4, 2, 4, 2);
|
||||||
picturePerf.Name = "picturePerf";
|
picturePerf.Name = "picturePerf";
|
||||||
picturePerf.Size = new Size(36, 38);
|
picturePerf.Size = new Size(36, 38);
|
||||||
picturePerf.TabIndex = 37;
|
picturePerf.TabIndex = 41;
|
||||||
picturePerf.TabStop = false;
|
picturePerf.TabStop = false;
|
||||||
//
|
//
|
||||||
// tableFanCharts
|
|
||||||
//
|
|
||||||
tableFanCharts.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
|
|
||||||
tableFanCharts.ColumnCount = 1;
|
|
||||||
tableFanCharts.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100F));
|
|
||||||
tableFanCharts.Controls.Add(chartGPU, 0, 1);
|
|
||||||
tableFanCharts.Controls.Add(chartCPU, 0, 0);
|
|
||||||
tableFanCharts.Controls.Add(chartMid, 0, 2);
|
|
||||||
tableFanCharts.Location = new Point(28, 64);
|
|
||||||
tableFanCharts.Margin = new Padding(4);
|
|
||||||
tableFanCharts.Name = "tableFanCharts";
|
|
||||||
tableFanCharts.RowCount = 2;
|
|
||||||
tableFanCharts.RowStyles.Add(new RowStyle(SizeType.Percent, 33F));
|
|
||||||
tableFanCharts.RowStyles.Add(new RowStyle(SizeType.Percent, 33F));
|
|
||||||
tableFanCharts.RowStyles.Add(new RowStyle(SizeType.Percent, 33F));
|
|
||||||
tableFanCharts.Size = new Size(764, 1022);
|
|
||||||
tableFanCharts.TabIndex = 36;
|
|
||||||
//
|
|
||||||
// chartGPU
|
|
||||||
//
|
|
||||||
chartArea1.Name = "ChartArea1";
|
|
||||||
chartGPU.ChartAreas.Add(chartArea1);
|
|
||||||
chartGPU.Dock = DockStyle.Fill;
|
|
||||||
chartGPU.Location = new Point(2, 350);
|
|
||||||
chartGPU.Margin = new Padding(2, 10, 2, 10);
|
|
||||||
chartGPU.Name = "chartGPU";
|
|
||||||
chartGPU.Size = new Size(760, 320);
|
|
||||||
chartGPU.TabIndex = 17;
|
|
||||||
chartGPU.Text = "chartGPU";
|
|
||||||
title1.Name = "Title1";
|
|
||||||
chartGPU.Titles.Add(title1);
|
|
||||||
//
|
|
||||||
// chartCPU
|
|
||||||
//
|
|
||||||
chartArea2.Name = "ChartArea1";
|
|
||||||
chartCPU.ChartAreas.Add(chartArea2);
|
|
||||||
chartCPU.Dock = DockStyle.Fill;
|
|
||||||
chartCPU.Location = new Point(2, 10);
|
|
||||||
chartCPU.Margin = new Padding(2, 10, 2, 10);
|
|
||||||
chartCPU.Name = "chartCPU";
|
|
||||||
chartCPU.Size = new Size(760, 320);
|
|
||||||
chartCPU.TabIndex = 14;
|
|
||||||
chartCPU.Text = "chartCPU";
|
|
||||||
title2.Name = "Title1";
|
|
||||||
chartCPU.Titles.Add(title2);
|
|
||||||
//
|
|
||||||
// chartMid
|
|
||||||
//
|
|
||||||
chartArea3.Name = "ChartArea3";
|
|
||||||
chartMid.ChartAreas.Add(chartArea3);
|
|
||||||
chartMid.Dock = DockStyle.Fill;
|
|
||||||
chartMid.Location = new Point(2, 690);
|
|
||||||
chartMid.Margin = new Padding(2, 10, 2, 10);
|
|
||||||
chartMid.Name = "chartMid";
|
|
||||||
chartMid.Size = new Size(760, 322);
|
|
||||||
chartMid.TabIndex = 14;
|
|
||||||
chartMid.Text = "chartMid";
|
|
||||||
title3.Name = "Title3";
|
|
||||||
chartMid.Titles.Add(title3);
|
|
||||||
chartMid.Visible = false;
|
|
||||||
//
|
|
||||||
// labelFans
|
// labelFans
|
||||||
//
|
//
|
||||||
labelFans.AutoSize = true;
|
labelFans.AutoSize = true;
|
||||||
labelFans.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point);
|
labelFans.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point);
|
||||||
labelFans.Location = new Point(66, 20);
|
labelFans.Location = new Point(62, 20);
|
||||||
labelFans.Margin = new Padding(4, 0, 4, 0);
|
labelFans.Margin = new Padding(4, 0, 4, 0);
|
||||||
labelFans.Name = "labelFans";
|
labelFans.Name = "labelFans";
|
||||||
labelFans.Size = new Size(138, 32);
|
labelFans.Size = new Size(138, 32);
|
||||||
labelFans.TabIndex = 28;
|
labelFans.TabIndex = 40;
|
||||||
labelFans.Text = "Fan Curves";
|
labelFans.Text = "Fan Curves";
|
||||||
//
|
//
|
||||||
|
// panelApplyFans
|
||||||
|
//
|
||||||
|
panelApplyFans.Controls.Add(labelFansResult);
|
||||||
|
panelApplyFans.Controls.Add(checkApplyFans);
|
||||||
|
panelApplyFans.Controls.Add(buttonReset);
|
||||||
|
panelApplyFans.Dock = DockStyle.Bottom;
|
||||||
|
panelApplyFans.Location = new Point(0, 1073);
|
||||||
|
panelApplyFans.Name = "panelApplyFans";
|
||||||
|
panelApplyFans.Size = new Size(805, 116);
|
||||||
|
panelApplyFans.TabIndex = 43;
|
||||||
|
//
|
||||||
|
// labelFansResult
|
||||||
|
//
|
||||||
|
labelFansResult.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
|
||||||
|
labelFansResult.ForeColor = Color.Red;
|
||||||
|
labelFansResult.Location = new Point(25, 3);
|
||||||
|
labelFansResult.Name = "labelFansResult";
|
||||||
|
labelFansResult.Size = new Size(760, 32);
|
||||||
|
labelFansResult.TabIndex = 42;
|
||||||
|
labelFansResult.TextAlign = ContentAlignment.TopRight;
|
||||||
|
labelFansResult.Visible = false;
|
||||||
|
//
|
||||||
// checkApplyFans
|
// checkApplyFans
|
||||||
//
|
//
|
||||||
checkApplyFans.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
|
checkApplyFans.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
|
||||||
checkApplyFans.AutoSize = true;
|
checkApplyFans.AutoSize = true;
|
||||||
checkApplyFans.BackColor = SystemColors.ControlLight;
|
checkApplyFans.BackColor = SystemColors.ControlLight;
|
||||||
checkApplyFans.Location = new Point(449, 1118);
|
checkApplyFans.Location = new Point(453, 45);
|
||||||
checkApplyFans.Margin = new Padding(4, 2, 4, 2);
|
checkApplyFans.Margin = new Padding(4, 2, 4, 2);
|
||||||
checkApplyFans.Name = "checkApplyFans";
|
checkApplyFans.Name = "checkApplyFans";
|
||||||
checkApplyFans.Padding = new Padding(15, 5, 15, 5);
|
checkApplyFans.Padding = new Padding(15, 5, 15, 5);
|
||||||
checkApplyFans.Size = new Size(339, 46);
|
checkApplyFans.Size = new Size(339, 46);
|
||||||
checkApplyFans.TabIndex = 17;
|
checkApplyFans.TabIndex = 19;
|
||||||
checkApplyFans.Text = Properties.Strings.ApplyFanCurve;
|
checkApplyFans.Text = Properties.Strings.ApplyFanCurve;
|
||||||
checkApplyFans.UseVisualStyleBackColor = false;
|
checkApplyFans.UseVisualStyleBackColor = false;
|
||||||
//
|
//
|
||||||
@@ -285,12 +333,12 @@ namespace GHelper
|
|||||||
buttonReset.BorderColor = Color.Transparent;
|
buttonReset.BorderColor = Color.Transparent;
|
||||||
buttonReset.BorderRadius = 2;
|
buttonReset.BorderRadius = 2;
|
||||||
buttonReset.FlatStyle = FlatStyle.Flat;
|
buttonReset.FlatStyle = FlatStyle.Flat;
|
||||||
buttonReset.Location = new Point(30, 1112);
|
buttonReset.Location = new Point(12, 38);
|
||||||
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(232, 54);
|
buttonReset.Size = new Size(232, 54);
|
||||||
buttonReset.TabIndex = 15;
|
buttonReset.TabIndex = 18;
|
||||||
buttonReset.Text = Properties.Strings.FactoryDefaults;
|
buttonReset.Text = Properties.Strings.FactoryDefaults;
|
||||||
buttonReset.UseVisualStyleBackColor = false;
|
buttonReset.UseVisualStyleBackColor = false;
|
||||||
//
|
//
|
||||||
@@ -325,10 +373,10 @@ namespace GHelper
|
|||||||
//
|
//
|
||||||
panelApplyPower.Controls.Add(checkApplyPower);
|
panelApplyPower.Controls.Add(checkApplyPower);
|
||||||
panelApplyPower.Dock = DockStyle.Bottom;
|
panelApplyPower.Dock = DockStyle.Bottom;
|
||||||
panelApplyPower.Location = new Point(0, 445);
|
panelApplyPower.Location = new Point(0, 447);
|
||||||
panelApplyPower.Name = "panelApplyPower";
|
panelApplyPower.Name = "panelApplyPower";
|
||||||
panelApplyPower.Padding = new Padding(10);
|
panelApplyPower.Padding = new Padding(10);
|
||||||
panelApplyPower.Size = new Size(523, 92);
|
panelApplyPower.Size = new Size(523, 90);
|
||||||
panelApplyPower.TabIndex = 44;
|
panelApplyPower.TabIndex = 44;
|
||||||
//
|
//
|
||||||
// checkApplyPower
|
// checkApplyPower
|
||||||
@@ -336,7 +384,7 @@ namespace GHelper
|
|||||||
checkApplyPower.Anchor = AnchorStyles.Bottom | AnchorStyles.Left;
|
checkApplyPower.Anchor = AnchorStyles.Bottom | AnchorStyles.Left;
|
||||||
checkApplyPower.AutoSize = true;
|
checkApplyPower.AutoSize = true;
|
||||||
checkApplyPower.BackColor = SystemColors.ControlLight;
|
checkApplyPower.BackColor = SystemColors.ControlLight;
|
||||||
checkApplyPower.Location = new Point(18, 22);
|
checkApplyPower.Location = new Point(18, 20);
|
||||||
checkApplyPower.Margin = new Padding(10);
|
checkApplyPower.Margin = new Padding(10);
|
||||||
checkApplyPower.Name = "checkApplyPower";
|
checkApplyPower.Name = "checkApplyPower";
|
||||||
checkApplyPower.Padding = new Padding(15, 5, 15, 5);
|
checkApplyPower.Padding = new Padding(15, 5, 15, 5);
|
||||||
@@ -724,7 +772,7 @@ namespace GHelper
|
|||||||
//
|
//
|
||||||
labelGPU.AutoSize = true;
|
labelGPU.AutoSize = true;
|
||||||
labelGPU.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point);
|
labelGPU.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point);
|
||||||
labelGPU.Location = new Point(62, 21);
|
labelGPU.Location = new Point(62, 20);
|
||||||
labelGPU.Margin = new Padding(4, 0, 4, 0);
|
labelGPU.Margin = new Padding(4, 0, 4, 0);
|
||||||
labelGPU.Name = "labelGPU";
|
labelGPU.Name = "labelGPU";
|
||||||
labelGPU.Size = new Size(162, 32);
|
labelGPU.Size = new Size(162, 32);
|
||||||
@@ -737,26 +785,31 @@ namespace GHelper
|
|||||||
AutoScaleMode = AutoScaleMode.Dpi;
|
AutoScaleMode = AutoScaleMode.Dpi;
|
||||||
AutoSize = true;
|
AutoSize = true;
|
||||||
AutoSizeMode = AutoSizeMode.GrowAndShrink;
|
AutoSizeMode = AutoSizeMode.GrowAndShrink;
|
||||||
ClientSize = new Size(1361, 1189);
|
ClientSize = new Size(1340, 1189);
|
||||||
Controls.Add(panelFans);
|
Controls.Add(panelFans);
|
||||||
Controls.Add(panelSliders);
|
Controls.Add(panelSliders);
|
||||||
Margin = new Padding(4, 2, 4, 2);
|
Margin = new Padding(4, 2, 4, 2);
|
||||||
MaximizeBox = false;
|
MaximizeBox = false;
|
||||||
MdiChildrenMinimizedAnchorBottom = false;
|
MdiChildrenMinimizedAnchorBottom = false;
|
||||||
MinimizeBox = false;
|
MinimizeBox = false;
|
||||||
MinimumSize = new Size(26, 1260);
|
MinimumSize = new Size(0, 1200);
|
||||||
Name = "Fans";
|
Name = "Fans";
|
||||||
ShowIcon = false;
|
ShowIcon = false;
|
||||||
ShowInTaskbar = false;
|
ShowInTaskbar = false;
|
||||||
StartPosition = FormStartPosition.CenterScreen;
|
StartPosition = FormStartPosition.Manual;
|
||||||
Text = "Fans and Power";
|
Text = "Fans and Power";
|
||||||
panelFans.ResumeLayout(false);
|
panelFans.ResumeLayout(false);
|
||||||
panelFans.PerformLayout();
|
panelFans.PerformLayout();
|
||||||
((System.ComponentModel.ISupportInitialize)picturePerf).EndInit();
|
|
||||||
tableFanCharts.ResumeLayout(false);
|
tableFanCharts.ResumeLayout(false);
|
||||||
((System.ComponentModel.ISupportInitialize)chartGPU).EndInit();
|
((System.ComponentModel.ISupportInitialize)chartGPU).EndInit();
|
||||||
((System.ComponentModel.ISupportInitialize)chartCPU).EndInit();
|
((System.ComponentModel.ISupportInitialize)chartCPU).EndInit();
|
||||||
|
((System.ComponentModel.ISupportInitialize)chartXGM).EndInit();
|
||||||
((System.ComponentModel.ISupportInitialize)chartMid).EndInit();
|
((System.ComponentModel.ISupportInitialize)chartMid).EndInit();
|
||||||
|
panelTitleFans.ResumeLayout(false);
|
||||||
|
panelTitleFans.PerformLayout();
|
||||||
|
((System.ComponentModel.ISupportInitialize)picturePerf).EndInit();
|
||||||
|
panelApplyFans.ResumeLayout(false);
|
||||||
|
panelApplyFans.PerformLayout();
|
||||||
panelSliders.ResumeLayout(false);
|
panelSliders.ResumeLayout(false);
|
||||||
panelSliders.PerformLayout();
|
panelSliders.PerformLayout();
|
||||||
panelPower.ResumeLayout(false);
|
panelPower.ResumeLayout(false);
|
||||||
@@ -790,23 +843,18 @@ namespace GHelper
|
|||||||
panelTitleGPU.PerformLayout();
|
panelTitleGPU.PerformLayout();
|
||||||
((System.ComponentModel.ISupportInitialize)pictureGPU).EndInit();
|
((System.ComponentModel.ISupportInitialize)pictureGPU).EndInit();
|
||||||
ResumeLayout(false);
|
ResumeLayout(false);
|
||||||
|
PerformLayout();
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
private Panel panelFans;
|
private Panel panelFans;
|
||||||
private RCheckBox checkApplyFans;
|
|
||||||
private RButton buttonReset;
|
|
||||||
private Panel panelSliders;
|
private Panel panelSliders;
|
||||||
private TableLayoutPanel tableFanCharts;
|
private TableLayoutPanel tableFanCharts;
|
||||||
private System.Windows.Forms.DataVisualization.Charting.Chart chartGPU;
|
private Chart chartGPU;
|
||||||
private System.Windows.Forms.DataVisualization.Charting.Chart chartCPU;
|
private Chart chartCPU;
|
||||||
private System.Windows.Forms.DataVisualization.Charting.Chart chartMid;
|
private Chart chartMid;
|
||||||
private Label labelFans;
|
private Chart chartXGM;
|
||||||
private PictureBox picturePerf;
|
|
||||||
private RComboBox comboBoost;
|
|
||||||
private Label labelBoost;
|
|
||||||
private Label labelTip;
|
private Label labelTip;
|
||||||
private Label labelFansResult;
|
|
||||||
private Panel panelPower;
|
private Panel panelPower;
|
||||||
private Label labelInfo;
|
private Label labelInfo;
|
||||||
private Panel panelCPU;
|
private Panel panelCPU;
|
||||||
@@ -842,5 +890,14 @@ namespace GHelper
|
|||||||
private Label labelGPUTemp;
|
private Label labelGPUTemp;
|
||||||
private Label labelGPUTempTitle;
|
private Label labelGPUTempTitle;
|
||||||
private TrackBar trackGPUTemp;
|
private TrackBar trackGPUTemp;
|
||||||
|
private Panel panelTitleFans;
|
||||||
|
private Panel panelApplyFans;
|
||||||
|
private Label labelFansResult;
|
||||||
|
private RCheckBox checkApplyFans;
|
||||||
|
private RButton buttonReset;
|
||||||
|
private Label labelBoost;
|
||||||
|
private RComboBox comboBoost;
|
||||||
|
private PictureBox picturePerf;
|
||||||
|
private Label labelFans;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
247
app/Fans.cs
@@ -12,9 +12,12 @@ namespace GHelper
|
|||||||
Series seriesCPU;
|
Series seriesCPU;
|
||||||
Series seriesGPU;
|
Series seriesGPU;
|
||||||
Series seriesMid;
|
Series seriesMid;
|
||||||
|
Series seriesXGM;
|
||||||
|
|
||||||
static int MinRPM, MaxRPM;
|
static int MinRPM, MaxRPM;
|
||||||
|
|
||||||
|
static bool powerVisible = true, gpuVisible = true;
|
||||||
|
|
||||||
const int fansMax = 100;
|
const int fansMax = 100;
|
||||||
|
|
||||||
NvidiaGpuControl? nvControl = null;
|
NvidiaGpuControl? nvControl = null;
|
||||||
@@ -53,10 +56,12 @@ namespace GHelper
|
|||||||
seriesCPU = chartCPU.Series.Add("CPU");
|
seriesCPU = chartCPU.Series.Add("CPU");
|
||||||
seriesGPU = chartGPU.Series.Add("GPU");
|
seriesGPU = chartGPU.Series.Add("GPU");
|
||||||
seriesMid = chartMid.Series.Add("Mid");
|
seriesMid = chartMid.Series.Add("Mid");
|
||||||
|
seriesXGM = chartXGM.Series.Add("XGM");
|
||||||
|
|
||||||
seriesCPU.Color = colorStandard;
|
seriesCPU.Color = colorStandard;
|
||||||
seriesGPU.Color = colorTurbo;
|
seriesGPU.Color = colorTurbo;
|
||||||
seriesMid.Color = colorEco;
|
seriesMid.Color = colorEco;
|
||||||
|
seriesXGM.Color = Color.Orange;
|
||||||
|
|
||||||
chartCPU.MouseMove += ChartCPU_MouseMove;
|
chartCPU.MouseMove += ChartCPU_MouseMove;
|
||||||
chartCPU.MouseUp += ChartCPU_MouseUp;
|
chartCPU.MouseUp += ChartCPU_MouseUp;
|
||||||
@@ -67,13 +72,16 @@ namespace GHelper
|
|||||||
chartMid.MouseMove += ChartCPU_MouseMove;
|
chartMid.MouseMove += ChartCPU_MouseMove;
|
||||||
chartMid.MouseUp += ChartCPU_MouseUp;
|
chartMid.MouseUp += ChartCPU_MouseUp;
|
||||||
|
|
||||||
|
chartXGM.MouseMove += ChartCPU_MouseMove;
|
||||||
|
chartXGM.MouseUp += ChartCPU_MouseUp;
|
||||||
|
|
||||||
buttonReset.Click += ButtonReset_Click;
|
buttonReset.Click += ButtonReset_Click;
|
||||||
|
|
||||||
trackTotal.Maximum = ASUSWmi.MaxTotal;
|
trackTotal.Maximum = AsusACPI.MaxTotal;
|
||||||
trackTotal.Minimum = ASUSWmi.MinTotal;
|
trackTotal.Minimum = AsusACPI.MinTotal;
|
||||||
|
|
||||||
trackCPU.Maximum = ASUSWmi.MaxCPU;
|
trackCPU.Maximum = AsusACPI.MaxCPU;
|
||||||
trackCPU.Minimum = ASUSWmi.MinCPU;
|
trackCPU.Minimum = AsusACPI.MinCPU;
|
||||||
|
|
||||||
trackCPU.Scroll += TrackPower_Scroll;
|
trackCPU.Scroll += TrackPower_Scroll;
|
||||||
trackTotal.Scroll += TrackPower_Scroll;
|
trackTotal.Scroll += TrackPower_Scroll;
|
||||||
@@ -90,11 +98,11 @@ namespace GHelper
|
|||||||
trackGPUMemory.Minimum = NvidiaGpuControl.MinMemoryOffset;
|
trackGPUMemory.Minimum = NvidiaGpuControl.MinMemoryOffset;
|
||||||
trackGPUMemory.Maximum = NvidiaGpuControl.MaxMemoryOffset;
|
trackGPUMemory.Maximum = NvidiaGpuControl.MaxMemoryOffset;
|
||||||
|
|
||||||
trackGPUBoost.Minimum = ASUSWmi.MinGPUBoost;
|
trackGPUBoost.Minimum = AsusACPI.MinGPUBoost;
|
||||||
trackGPUBoost.Maximum = ASUSWmi.MaxGPUBoost;
|
trackGPUBoost.Maximum = AsusACPI.MaxGPUBoost;
|
||||||
|
|
||||||
trackGPUTemp.Minimum = ASUSWmi.MinGPUTemp;
|
trackGPUTemp.Minimum = AsusACPI.MinGPUTemp;
|
||||||
trackGPUTemp.Maximum = ASUSWmi.MaxGPUTemp;
|
trackGPUTemp.Maximum = AsusACPI.MaxGPUTemp;
|
||||||
|
|
||||||
trackGPUCore.Scroll += trackGPU_Scroll;
|
trackGPUCore.Scroll += trackGPU_Scroll;
|
||||||
trackGPUMemory.Scroll += trackGPU_Scroll;
|
trackGPUMemory.Scroll += trackGPU_Scroll;
|
||||||
@@ -138,22 +146,22 @@ namespace GHelper
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
panelGPU.Visible = false;
|
gpuVisible = panelGPU.Visible = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
panelGPU.Visible = true;
|
gpuVisible = panelGPU.Visible = true;
|
||||||
|
|
||||||
int gpu_boost = Program.config.getConfigPerf("gpu_boost");
|
int gpu_boost = AppConfig.getConfigPerf("gpu_boost");
|
||||||
int gpu_temp = Program.config.getConfigPerf("gpu_temp");
|
int gpu_temp = AppConfig.getConfigPerf("gpu_temp");
|
||||||
int core = Program.config.getConfigPerf("gpu_core");
|
int core = AppConfig.getConfigPerf("gpu_core");
|
||||||
int memory = Program.config.getConfigPerf("gpu_memory");
|
int memory = AppConfig.getConfigPerf("gpu_memory");
|
||||||
|
|
||||||
|
if (gpu_boost < 0) gpu_boost = AsusACPI.MaxGPUBoost;
|
||||||
|
if (gpu_temp < 0) gpu_temp = AsusACPI.MaxGPUTemp;
|
||||||
|
|
||||||
if (gpu_boost < 0) gpu_boost = ASUSWmi.MaxGPUBoost;
|
|
||||||
if (gpu_temp < 0) gpu_temp = ASUSWmi.MaxGPUTemp;
|
|
||||||
|
|
||||||
if (core == -1) core = 0;
|
if (core == -1) core = 0;
|
||||||
if (memory == -1) memory = 0;
|
if (memory == -1) memory = 0;
|
||||||
|
|
||||||
@@ -169,7 +177,8 @@ namespace GHelper
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
labelGPU.Text = nvControl.FullName;
|
labelGPU.Text = nvControl.FullName;
|
||||||
} catch
|
}
|
||||||
|
catch
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -179,11 +188,11 @@ namespace GHelper
|
|||||||
trackGPUCore.Value = Math.Max(Math.Min(core, NvidiaGpuControl.MaxCoreOffset), NvidiaGpuControl.MinCoreOffset);
|
trackGPUCore.Value = Math.Max(Math.Min(core, NvidiaGpuControl.MaxCoreOffset), NvidiaGpuControl.MinCoreOffset);
|
||||||
trackGPUMemory.Value = Math.Max(Math.Min(memory, NvidiaGpuControl.MaxMemoryOffset), NvidiaGpuControl.MinMemoryOffset);
|
trackGPUMemory.Value = Math.Max(Math.Min(memory, NvidiaGpuControl.MaxMemoryOffset), NvidiaGpuControl.MinMemoryOffset);
|
||||||
|
|
||||||
trackGPUBoost.Value = Math.Max(Math.Min(gpu_boost, ASUSWmi.MaxGPUBoost), ASUSWmi.MinGPUBoost);
|
trackGPUBoost.Value = Math.Max(Math.Min(gpu_boost, AsusACPI.MaxGPUBoost), AsusACPI.MinGPUBoost);
|
||||||
trackGPUTemp.Value = Math.Max(Math.Min(gpu_temp, ASUSWmi.MaxGPUTemp), ASUSWmi.MinGPUTemp);
|
trackGPUTemp.Value = Math.Max(Math.Min(gpu_temp, AsusACPI.MaxGPUTemp), AsusACPI.MinGPUTemp);
|
||||||
|
|
||||||
panelGPUBoost.Visible = (Program.wmi.DeviceGet(ASUSWmi.PPT_GPUC0) >= 0);
|
panelGPUBoost.Visible = (Program.acpi.DeviceGet(AsusACPI.PPT_GPUC0) >= 0);
|
||||||
panelGPUTemp.Visible = (Program.wmi.DeviceGet(ASUSWmi.PPT_GPUC2) >= 0);
|
panelGPUTemp.Visible = (Program.acpi.DeviceGet(AsusACPI.PPT_GPUC2) >= 0);
|
||||||
|
|
||||||
VisualiseGPUSettings();
|
VisualiseGPUSettings();
|
||||||
|
|
||||||
@@ -191,7 +200,7 @@ namespace GHelper
|
|||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
Logger.WriteLine(ex.ToString());
|
Logger.WriteLine(ex.ToString());
|
||||||
panelGPU.Visible = false;
|
gpuVisible = panelGPU.Visible = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -210,8 +219,8 @@ namespace GHelper
|
|||||||
TrackBar track = (TrackBar)sender;
|
TrackBar track = (TrackBar)sender;
|
||||||
track.Value = (int)Math.Round((float)track.Value / 5) * 5;
|
track.Value = (int)Math.Round((float)track.Value / 5) * 5;
|
||||||
|
|
||||||
Program.config.setConfigPerf("gpu_core", trackGPUCore.Value);
|
AppConfig.setConfigPerf("gpu_core", trackGPUCore.Value);
|
||||||
Program.config.setConfigPerf("gpu_memory", trackGPUMemory.Value);
|
AppConfig.setConfigPerf("gpu_memory", trackGPUMemory.Value);
|
||||||
|
|
||||||
VisualiseGPUSettings();
|
VisualiseGPUSettings();
|
||||||
|
|
||||||
@@ -219,8 +228,8 @@ namespace GHelper
|
|||||||
|
|
||||||
private void trackGPUPower_Scroll(object? sender, EventArgs e)
|
private void trackGPUPower_Scroll(object? sender, EventArgs e)
|
||||||
{
|
{
|
||||||
Program.config.setConfigPerf("gpu_boost", trackGPUBoost.Value);
|
AppConfig.setConfigPerf("gpu_boost", trackGPUBoost.Value);
|
||||||
Program.config.setConfigPerf("gpu_temp", trackGPUTemp.Value);
|
AppConfig.setConfigPerf("gpu_temp", trackGPUTemp.Value);
|
||||||
|
|
||||||
VisualiseGPUSettings();
|
VisualiseGPUSettings();
|
||||||
}
|
}
|
||||||
@@ -232,17 +241,26 @@ namespace GHelper
|
|||||||
return (200 * Math.Round((float)(MinRPM * 100 + (MaxRPM - MinRPM) * percentage) / 200)).ToString() + unit;
|
return (200 * Math.Round((float)(MinRPM * 100 + (MaxRPM - MinRPM) * percentage) / 200)).ToString() + unit;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetChart(Chart chart, int device)
|
void SetChart(Chart chart, AsusFan device)
|
||||||
{
|
{
|
||||||
|
|
||||||
string title;
|
string title = "";
|
||||||
|
|
||||||
if (device == 1)
|
switch (device)
|
||||||
title = Properties.Strings.FanProfileGPU;
|
{
|
||||||
else if (device == 2)
|
case AsusFan.CPU:
|
||||||
title = Properties.Strings.FanProfileMid;
|
title = Properties.Strings.FanProfileCPU;
|
||||||
else
|
break;
|
||||||
title = Properties.Strings.FanProfileCPU;
|
case AsusFan.GPU:
|
||||||
|
title = Properties.Strings.FanProfileGPU;
|
||||||
|
break;
|
||||||
|
case AsusFan.Mid:
|
||||||
|
title = Properties.Strings.FanProfileMid;
|
||||||
|
break;
|
||||||
|
case AsusFan.XGM:
|
||||||
|
title = "XG Mobile";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
if (Program.settingsForm.perfName.Length > 0)
|
if (Program.settingsForm.perfName.Length > 0)
|
||||||
labelFans.Text = Properties.Strings.FanProfiles + ": " + Program.settingsForm.perfName;
|
labelFans.Text = Properties.Strings.FanProfiles + ": " + Program.settingsForm.perfName;
|
||||||
@@ -263,10 +281,10 @@ namespace GHelper
|
|||||||
chart.ChartAreas[0].AxisX.LineColor = chartGrid;
|
chart.ChartAreas[0].AxisX.LineColor = chartGrid;
|
||||||
chart.ChartAreas[0].AxisY.LineColor = chartGrid;
|
chart.ChartAreas[0].AxisY.LineColor = chartGrid;
|
||||||
|
|
||||||
for (int i = 0; i <= fansMax-10; i += 10)
|
for (int i = 0; i <= fansMax - 10; i += 10)
|
||||||
chart.ChartAreas[0].AxisY.CustomLabels.Add(i - 2, i + 2, ChartPercToRPM(i));
|
chart.ChartAreas[0].AxisY.CustomLabels.Add(i - 2, i + 2, ChartPercToRPM(i));
|
||||||
|
|
||||||
chart.ChartAreas[0].AxisY.CustomLabels.Add(fansMax-2, fansMax+2, Properties.Strings.RPM);
|
chart.ChartAreas[0].AxisY.CustomLabels.Add(fansMax - 2, fansMax + 2, Properties.Strings.RPM);
|
||||||
|
|
||||||
chart.ChartAreas[0].AxisY.Interval = 10;
|
chart.ChartAreas[0].AxisY.Interval = 10;
|
||||||
|
|
||||||
@@ -275,9 +293,9 @@ namespace GHelper
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Fans_Shown(object? sender, EventArgs e)
|
public void FormPosition()
|
||||||
{
|
{
|
||||||
panelSliders.Visible = panelGPU.Visible || panelPower.Visible;
|
panelSliders.Visible = gpuVisible || powerVisible;
|
||||||
|
|
||||||
if (Height > Program.settingsForm.Height)
|
if (Height > Program.settingsForm.Height)
|
||||||
{
|
{
|
||||||
@@ -291,7 +309,11 @@ namespace GHelper
|
|||||||
}
|
}
|
||||||
|
|
||||||
Left = Program.settingsForm.Left - Width - 5;
|
Left = Program.settingsForm.Left - Width - 5;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Fans_Shown(object? sender, EventArgs e)
|
||||||
|
{
|
||||||
|
FormPosition();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -310,10 +332,10 @@ namespace GHelper
|
|||||||
|
|
||||||
private void ComboBoost_Changed(object? sender, EventArgs e)
|
private void ComboBoost_Changed(object? sender, EventArgs e)
|
||||||
{
|
{
|
||||||
if (Program.config.getConfigPerf("auto_boost") != comboBoost.SelectedIndex)
|
if (AppConfig.getConfigPerf("auto_boost") != comboBoost.SelectedIndex)
|
||||||
{
|
{
|
||||||
NativeMethods.SetCPUBoost(comboBoost.SelectedIndex);
|
NativeMethods.SetCPUBoost(comboBoost.SelectedIndex);
|
||||||
Program.config.setConfigPerf("auto_boost", comboBoost.SelectedIndex);
|
AppConfig.setConfigPerf("auto_boost", comboBoost.SelectedIndex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -321,7 +343,7 @@ namespace GHelper
|
|||||||
{
|
{
|
||||||
if (sender is null) return;
|
if (sender is null) return;
|
||||||
CheckBox chk = (CheckBox)sender;
|
CheckBox chk = (CheckBox)sender;
|
||||||
Program.config.setConfigPerf("auto_apply_power", chk.Checked ? 1 : 0);
|
AppConfig.setConfigPerf("auto_apply_power", chk.Checked ? 1 : 0);
|
||||||
|
|
||||||
if (chk.Checked)
|
if (chk.Checked)
|
||||||
{
|
{
|
||||||
@@ -329,7 +351,7 @@ namespace GHelper
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Program.wmi.DeviceSet(ASUSWmi.PerformanceMode, Program.config.getConfig("performance_mode"), "PerfMode");
|
Program.acpi.DeviceSet(AsusACPI.PerformanceMode, AppConfig.getConfig("performance_mode"), "PerfMode");
|
||||||
Program.settingsForm.AutoFans();
|
Program.settingsForm.AutoFans();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -340,7 +362,7 @@ namespace GHelper
|
|||||||
if (sender is null) return;
|
if (sender is null) return;
|
||||||
CheckBox chk = (CheckBox)sender;
|
CheckBox chk = (CheckBox)sender;
|
||||||
|
|
||||||
Program.config.setConfigPerf("auto_apply", chk.Checked ? 1 : 0);
|
AppConfig.setConfigPerf("auto_apply", chk.Checked ? 1 : 0);
|
||||||
|
|
||||||
if (chk.Checked)
|
if (chk.Checked)
|
||||||
{
|
{
|
||||||
@@ -348,7 +370,7 @@ namespace GHelper
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Program.wmi.DeviceSet(ASUSWmi.PerformanceMode, Program.config.getConfig("performance_mode"), "PerfMode");
|
Program.acpi.DeviceSet(AsusACPI.PerformanceMode, AppConfig.getConfig("performance_mode"), "PerfMode");
|
||||||
Program.settingsForm.AutoPower();
|
Program.settingsForm.AutoPower();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -375,10 +397,10 @@ namespace GHelper
|
|||||||
public void InitPower(bool changed = false)
|
public void InitPower(bool changed = false)
|
||||||
{
|
{
|
||||||
|
|
||||||
bool cpuBmode = (Program.wmi.DeviceGet(ASUSWmi.PPT_CPUB0) >= 0); // 2022 model +
|
bool cpuBmode = (Program.acpi.DeviceGet(AsusACPI.PPT_CPUB0) >= 0); // 2022 model +
|
||||||
bool cpuAmode = (Program.wmi.DeviceGet(ASUSWmi.PPT_TotalA0) >= 0); // 2021 model +
|
bool cpuAmode = (Program.acpi.DeviceGet(AsusACPI.PPT_TotalA0) >= 0); // 2021 model +
|
||||||
|
|
||||||
panelPower.Visible = cpuAmode;
|
powerVisible = panelPower.Visible = cpuAmode;
|
||||||
panelCPU.Visible = cpuBmode;
|
panelCPU.Visible = cpuBmode;
|
||||||
|
|
||||||
// Yes, that's stupid, but Total slider on 2021 model actually adjusts CPU PPT
|
// Yes, that's stupid, but Total slider on 2021 model actually adjusts CPU PPT
|
||||||
@@ -389,7 +411,7 @@ namespace GHelper
|
|||||||
|
|
||||||
int limit_total;
|
int limit_total;
|
||||||
int limit_cpu;
|
int limit_cpu;
|
||||||
bool apply = Program.config.getConfigPerf("auto_apply_power") == 1;
|
bool apply = AppConfig.getConfigPerf("auto_apply_power") == 1;
|
||||||
|
|
||||||
if (changed)
|
if (changed)
|
||||||
{
|
{
|
||||||
@@ -398,17 +420,17 @@ namespace GHelper
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
limit_total = Program.config.getConfigPerf("limit_total");
|
limit_total = AppConfig.getConfigPerf("limit_total");
|
||||||
limit_cpu = Program.config.getConfigPerf("limit_cpu");
|
limit_cpu = AppConfig.getConfigPerf("limit_cpu");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (limit_total < 0) limit_total = ASUSWmi.DefaultTotal;
|
if (limit_total < 0) limit_total = AsusACPI.DefaultTotal;
|
||||||
if (limit_total > ASUSWmi.MaxTotal) limit_total = ASUSWmi.MaxTotal;
|
if (limit_total > AsusACPI.MaxTotal) limit_total = AsusACPI.MaxTotal;
|
||||||
if (limit_total < ASUSWmi.MinTotal) limit_total = ASUSWmi.MinTotal;
|
if (limit_total < AsusACPI.MinTotal) limit_total = AsusACPI.MinTotal;
|
||||||
|
|
||||||
if (limit_cpu < 0) limit_cpu = ASUSWmi.DefaultCPU;
|
if (limit_cpu < 0) limit_cpu = AsusACPI.DefaultCPU;
|
||||||
if (limit_cpu > ASUSWmi.MaxCPU) limit_cpu = ASUSWmi.MaxCPU;
|
if (limit_cpu > AsusACPI.MaxCPU) limit_cpu = AsusACPI.MaxCPU;
|
||||||
if (limit_cpu < ASUSWmi.MinCPU) limit_cpu = ASUSWmi.MinCPU;
|
if (limit_cpu < AsusACPI.MinCPU) limit_cpu = AsusACPI.MinCPU;
|
||||||
if (limit_cpu > limit_total) limit_cpu = limit_total;
|
if (limit_cpu > limit_total) limit_cpu = limit_total;
|
||||||
|
|
||||||
trackTotal.Value = limit_total;
|
trackTotal.Value = limit_total;
|
||||||
@@ -418,8 +440,8 @@ namespace GHelper
|
|||||||
labelTotal.Text = trackTotal.Value.ToString() + "W";
|
labelTotal.Text = trackTotal.Value.ToString() + "W";
|
||||||
labelCPU.Text = trackCPU.Value.ToString() + "W";
|
labelCPU.Text = trackCPU.Value.ToString() + "W";
|
||||||
|
|
||||||
Program.config.setConfigPerf("limit_total", limit_total);
|
AppConfig.setConfigPerf("limit_total", limit_total);
|
||||||
Program.config.setConfigPerf("limit_cpu", limit_cpu);
|
AppConfig.setConfigPerf("limit_cpu", limit_cpu);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -434,36 +456,52 @@ namespace GHelper
|
|||||||
public void InitFans()
|
public void InitFans()
|
||||||
{
|
{
|
||||||
|
|
||||||
byte[] curve = Program.wmi.GetFanCurve(2);
|
int chartCount = 2;
|
||||||
|
|
||||||
if (curve.All(singleByte => singleByte == 0))
|
// Middle / system fan check
|
||||||
|
if (!AsusACPI.IsEmptyCurve(Program.acpi.GetFanCurve(AsusFan.Mid)))
|
||||||
{
|
{
|
||||||
Program.config.setConfig("mid_fan", 0);
|
AppConfig.setConfig("mid_fan", 1);
|
||||||
|
chartCount++;
|
||||||
|
chartMid.Visible = true;
|
||||||
|
SetChart(chartMid, AsusFan.Mid);
|
||||||
|
LoadProfile(seriesMid, AsusFan.Mid);
|
||||||
|
MinimumSize = new Size(0, chartCount * 400 + 200);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Program.config.setConfig("mid_fan", 1);
|
AppConfig.setConfig("mid_fan", 0);
|
||||||
chartMid.Visible = true;
|
|
||||||
SetChart(chartMid, 2);
|
|
||||||
LoadProfile(seriesMid, 2);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// XG Mobile Fan check
|
||||||
|
if (Program.acpi.IsXGConnected())
|
||||||
|
{
|
||||||
|
AppConfig.setConfig("xgm_fan", 1);
|
||||||
|
chartCount++;
|
||||||
|
chartXGM.Visible = true;
|
||||||
|
SetChart(chartXGM, AsusFan.XGM);
|
||||||
|
LoadProfile(seriesXGM, AsusFan.XGM);
|
||||||
|
MinimumSize = new Size(0, chartCount * 400 + 200);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
AppConfig.setConfig("xgm_fan", 0);
|
||||||
|
}
|
||||||
|
|
||||||
SetChart(chartCPU, 0);
|
SetChart(chartCPU, AsusFan.CPU);
|
||||||
SetChart(chartGPU, 1);
|
SetChart(chartGPU, AsusFan.GPU);
|
||||||
|
|
||||||
LoadProfile(seriesCPU, 0);
|
LoadProfile(seriesCPU, AsusFan.CPU);
|
||||||
LoadProfile(seriesGPU, 1);
|
LoadProfile(seriesGPU, AsusFan.GPU);
|
||||||
|
|
||||||
int auto_apply = Program.config.getConfigPerf("auto_apply");
|
int auto_apply = AppConfig.getConfigPerf("auto_apply");
|
||||||
|
|
||||||
checkApplyFans.Checked = (auto_apply == 1);
|
checkApplyFans.Checked = (auto_apply == 1);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void LoadProfile(Series series, int device, int def = 0)
|
void LoadProfile(Series series, AsusFan device, bool reset = false)
|
||||||
{
|
{
|
||||||
|
|
||||||
series.ChartType = SeriesChartType.Line;
|
series.ChartType = SeriesChartType.Line;
|
||||||
@@ -472,17 +510,17 @@ namespace GHelper
|
|||||||
|
|
||||||
series.Points.Clear();
|
series.Points.Clear();
|
||||||
|
|
||||||
int mode = Program.config.getConfig("performance_mode");
|
int mode = AppConfig.getConfig("performance_mode");
|
||||||
byte[] curve = Program.config.getFanConfig(device);
|
byte[] curve = AppConfig.getFanConfig(device);
|
||||||
|
|
||||||
if (def == 1 || ASUSWmi.IsEmptyCurve(curve))
|
if (reset || AsusACPI.IsInvalidCurve(curve))
|
||||||
{
|
{
|
||||||
curve = Program.wmi.GetFanCurve(device, mode);
|
curve = Program.acpi.GetFanCurve(device, mode);
|
||||||
|
|
||||||
if (ASUSWmi.IsEmptyCurve(curve))
|
|
||||||
curve = Program.config.getDefaultCurve(device);
|
|
||||||
|
|
||||||
curve = ASUSWmi.FixFanCurve(curve);
|
if (AsusACPI.IsInvalidCurve(curve))
|
||||||
|
curve = AppConfig.getDefaultCurve(device);
|
||||||
|
|
||||||
|
curve = AsusACPI.FixFanCurve(curve);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -500,7 +538,7 @@ namespace GHelper
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void SaveProfile(Series series, int device)
|
void SaveProfile(Series series, AsusFan device)
|
||||||
{
|
{
|
||||||
byte[] curve = new byte[16];
|
byte[] curve = new byte[16];
|
||||||
int i = 0;
|
int i = 0;
|
||||||
@@ -511,7 +549,7 @@ namespace GHelper
|
|||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
Program.config.setFanConfig(device, curve);
|
AppConfig.setFanConfig(device, curve);
|
||||||
//Program.wmi.SetFanCurve(device, curve);
|
//Program.wmi.SetFanCurve(device, curve);
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -520,28 +558,33 @@ namespace GHelper
|
|||||||
private void ButtonReset_Click(object? sender, EventArgs e)
|
private void ButtonReset_Click(object? sender, EventArgs e)
|
||||||
{
|
{
|
||||||
|
|
||||||
LoadProfile(seriesCPU, 0, 1);
|
LoadProfile(seriesCPU, AsusFan.CPU, true);
|
||||||
LoadProfile(seriesGPU, 1, 1);
|
LoadProfile(seriesGPU, AsusFan.GPU, true);
|
||||||
if (Program.config.getConfig("mid_fan") == 1)
|
|
||||||
LoadProfile(seriesMid, 2, 1);
|
if (AppConfig.isConfig("mid_fan"))
|
||||||
|
LoadProfile(seriesMid, AsusFan.Mid, true);
|
||||||
|
|
||||||
|
if (AppConfig.isConfig("xgm_fan"))
|
||||||
|
LoadProfile(seriesXGM, AsusFan.XGM, true);
|
||||||
|
|
||||||
checkApplyFans.Checked = false;
|
checkApplyFans.Checked = false;
|
||||||
checkApplyPower.Checked = false;
|
checkApplyPower.Checked = false;
|
||||||
|
|
||||||
Program.config.setConfigPerf("auto_apply", 0);
|
AppConfig.setConfigPerf("auto_apply", 0);
|
||||||
Program.config.setConfigPerf("auto_apply_power", 0);
|
AppConfig.setConfigPerf("auto_apply_power", 0);
|
||||||
|
|
||||||
Program.wmi.DeviceSet(ASUSWmi.PerformanceMode, Program.config.getConfig("performance_mode"), "PerfMode");
|
Program.acpi.DeviceSet(AsusACPI.PerformanceMode, AppConfig.getConfig("performance_mode"), "PerfMode");
|
||||||
|
if (Program.acpi.IsXGConnected()) AsusUSB.ResetXGM();
|
||||||
|
|
||||||
trackGPUCore.Value = 0;
|
trackGPUCore.Value = 0;
|
||||||
trackGPUMemory.Value = 0;
|
trackGPUMemory.Value = 0;
|
||||||
trackGPUBoost.Value = ASUSWmi.MaxGPUBoost;
|
trackGPUBoost.Value = AsusACPI.MaxGPUBoost;
|
||||||
trackGPUTemp.Value = ASUSWmi.MaxGPUTemp;
|
trackGPUTemp.Value = AsusACPI.MaxGPUTemp;
|
||||||
|
|
||||||
Program.config.setConfigPerf("gpu_boost", trackGPUBoost.Value);
|
AppConfig.setConfigPerf("gpu_boost", trackGPUBoost.Value);
|
||||||
Program.config.setConfigPerf("gpu_temp", trackGPUTemp.Value);
|
AppConfig.setConfigPerf("gpu_temp", trackGPUTemp.Value);
|
||||||
Program.config.setConfigPerf("gpu_core", trackGPUCore.Value);
|
AppConfig.setConfigPerf("gpu_core", trackGPUCore.Value);
|
||||||
Program.config.setConfigPerf("gpu_memory", trackGPUMemory.Value);
|
AppConfig.setConfigPerf("gpu_memory", trackGPUMemory.Value);
|
||||||
VisualiseGPUSettings();
|
VisualiseGPUSettings();
|
||||||
|
|
||||||
Program.settingsForm.SetGPUClocks(true);
|
Program.settingsForm.SetGPUClocks(true);
|
||||||
@@ -553,10 +596,14 @@ namespace GHelper
|
|||||||
curPoint = null;
|
curPoint = null;
|
||||||
labelTip.Visible = false;
|
labelTip.Visible = false;
|
||||||
|
|
||||||
SaveProfile(seriesCPU, 0);
|
SaveProfile(seriesCPU, AsusFan.CPU);
|
||||||
SaveProfile(seriesGPU, 1);
|
SaveProfile(seriesGPU, AsusFan.GPU);
|
||||||
if (Program.config.getConfig("mid_fan") == 1)
|
|
||||||
SaveProfile(seriesMid, 2);
|
if (AppConfig.isConfig("mid_fan"))
|
||||||
|
SaveProfile(seriesMid, AsusFan.Mid);
|
||||||
|
|
||||||
|
if (AppConfig.isConfig("xgm_fan"))
|
||||||
|
SaveProfile(seriesXGM, AsusFan.XGM);
|
||||||
|
|
||||||
Program.settingsForm.AutoFans();
|
Program.settingsForm.AutoFans();
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,64 @@
|
|||||||
<root>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<root>
|
||||||
|
<!--
|
||||||
|
Microsoft ResX Schema
|
||||||
|
|
||||||
|
Version 2.0
|
||||||
|
|
||||||
|
The primary goals of this format is to allow a simple XML format
|
||||||
|
that is mostly human readable. The generation and parsing of the
|
||||||
|
various data types are done through the TypeConverter classes
|
||||||
|
associated with the data types.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
... ado.net/XML headers & schema ...
|
||||||
|
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||||
|
<resheader name="version">2.0</resheader>
|
||||||
|
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||||
|
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||||
|
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||||
|
<data name="Color1" type="System.Drawing.Color, System.Drawing"">Blue</data>
|
||||||
|
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||||
|
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||||
|
</data>
|
||||||
|
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||||
|
<comment>This is a comment</comment>
|
||||||
|
</data>
|
||||||
|
|
||||||
|
There are any number of "resheader" rows that contain simple
|
||||||
|
name/value pairs.
|
||||||
|
|
||||||
|
Each data row contains a name, and value. The row also contains a
|
||||||
|
type or mimetype. Type corresponds to a .NET class that support
|
||||||
|
text/value conversion through the TypeConverter architecture.
|
||||||
|
Classes that don't support this are serialized and stored with the
|
||||||
|
mimetype set.
|
||||||
|
|
||||||
|
The mimetype is used for serialized objects, and tells the
|
||||||
|
ResXResourceReader how to depersist the object. This is currently not
|
||||||
|
extensible. For a given mimetype the value must be set accordingly:
|
||||||
|
|
||||||
|
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||||
|
that the ResXResourceWriter will generate, however the reader can
|
||||||
|
read any of the formats listed below.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.binary.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.soap.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||||
|
value : The object must be serialized into a byte array
|
||||||
|
: using a System.ComponentModel.TypeConverter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
-->
|
||||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||||
<xsd:element name="root" msdata:IsDataSet="true">
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
<ProduceReferenceAssembly>False</ProduceReferenceAssembly>
|
<ProduceReferenceAssembly>False</ProduceReferenceAssembly>
|
||||||
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
|
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
|
||||||
<AssemblyVersion>0.64</AssemblyVersion>
|
<AssemblyVersion>0.66</AssemblyVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||||
|
|||||||
@@ -132,8 +132,8 @@ public class NvidiaGpuControl : IGpuControl
|
|||||||
|
|
||||||
public int SetClocksFromConfig()
|
public int SetClocksFromConfig()
|
||||||
{
|
{
|
||||||
int core = Program.config.getConfig("gpu_core");
|
int core = AppConfig.getConfig("gpu_core");
|
||||||
int memory = Program.config.getConfig("gpu_memory");
|
int memory = AppConfig.getConfig("gpu_memory");
|
||||||
int status = SetClocks(core, memory);
|
int status = SetClocks(core, memory);
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,14 +19,14 @@ public static class HardwareControl
|
|||||||
public static int GetFanMax()
|
public static int GetFanMax()
|
||||||
{
|
{
|
||||||
int max = 58;
|
int max = 58;
|
||||||
if (Program.config.ContainsModel("401")) max = 72;
|
if (AppConfig.ContainsModel("401")) max = 72;
|
||||||
else if (Program.config.ContainsModel("503")) max = 68;
|
else if (AppConfig.ContainsModel("503")) max = 68;
|
||||||
return Math.Max(max, Program.config.getConfig("fan_max"));
|
return Math.Max(max, AppConfig.getConfig("fan_max"));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void SetFanMax(int fan)
|
public static void SetFanMax(int fan)
|
||||||
{
|
{
|
||||||
Program.config.setConfig("fan_max", fan);
|
AppConfig.setConfig("fan_max", fan);
|
||||||
}
|
}
|
||||||
private static string FormatFan(int fan)
|
private static string FormatFan(int fan)
|
||||||
{
|
{
|
||||||
@@ -40,8 +40,8 @@ public static class HardwareControl
|
|||||||
int fanMax = GetFanMax();
|
int fanMax = GetFanMax();
|
||||||
if (fan > fanMax && fan < 110) SetFanMax(fan);
|
if (fan > fanMax && fan < 110) SetFanMax(fan);
|
||||||
|
|
||||||
if (Program.config.getConfig("fan_rpm") == 1)
|
if (AppConfig.getConfig("fan_rpm") == 1)
|
||||||
return GHelper.Properties.Strings.FanSpeed + (fan * 100).ToString() + GHelper.Properties.Strings.RPM;
|
return GHelper.Properties.Strings.FanSpeed + (fan * 100).ToString() + "RPM";
|
||||||
else
|
else
|
||||||
return GHelper.Properties.Strings.FanSpeed + Math.Min(Math.Round((float)fan / fanMax * 100), 100).ToString() + "%"; // relatively to 6000 rpm
|
return GHelper.Properties.Strings.FanSpeed + Math.Min(Math.Round((float)fan / fanMax * 100), 100).ToString() + "%"; // relatively to 6000 rpm
|
||||||
}
|
}
|
||||||
@@ -69,11 +69,11 @@ public static class HardwareControl
|
|||||||
gpuTemp = -1;
|
gpuTemp = -1;
|
||||||
gpuUse = -1;
|
gpuUse = -1;
|
||||||
|
|
||||||
cpuFan = FormatFan(Program.wmi.DeviceGet(ASUSWmi.CPU_Fan));
|
cpuFan = FormatFan(Program.acpi.DeviceGet(AsusACPI.CPU_Fan));
|
||||||
gpuFan = FormatFan(Program.wmi.DeviceGet(ASUSWmi.GPU_Fan));
|
gpuFan = FormatFan(Program.acpi.DeviceGet(AsusACPI.GPU_Fan));
|
||||||
midFan = FormatFan(Program.wmi.DeviceGet(ASUSWmi.Mid_Fan));
|
midFan = FormatFan(Program.acpi.DeviceGet(AsusACPI.Mid_Fan));
|
||||||
|
|
||||||
cpuTemp = Program.wmi.DeviceGet(ASUSWmi.Temp_CPU);
|
cpuTemp = Program.acpi.DeviceGet(AsusACPI.Temp_CPU);
|
||||||
|
|
||||||
if (cpuTemp < 0) try
|
if (cpuTemp < 0) try
|
||||||
{
|
{
|
||||||
@@ -99,7 +99,7 @@ public static class HardwareControl
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (gpuTemp is null || gpuTemp < 0)
|
if (gpuTemp is null || gpuTemp < 0)
|
||||||
gpuTemp = Program.wmi.DeviceGet(ASUSWmi.Temp_GPU);
|
gpuTemp = Program.acpi.DeviceGet(AsusACPI.Temp_GPU);
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|||||||
266
app/InputDispatcher.cs
Normal file
@@ -0,0 +1,266 @@
|
|||||||
|
using Microsoft.Win32;
|
||||||
|
using NAudio.CoreAudioApi;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using System.Management;
|
||||||
|
using Tools;
|
||||||
|
|
||||||
|
namespace GHelper
|
||||||
|
{
|
||||||
|
public class InputDispatcher
|
||||||
|
{
|
||||||
|
|
||||||
|
private static bool isOptimizationRunning = OptimizationService.IsRunning();
|
||||||
|
private static nint windowHandle;
|
||||||
|
|
||||||
|
public static Keys keyProfile = Keys.F5;
|
||||||
|
|
||||||
|
KeyHandler m1, m2, togggle;
|
||||||
|
|
||||||
|
public InputDispatcher(nint handle)
|
||||||
|
{
|
||||||
|
|
||||||
|
windowHandle = handle;
|
||||||
|
|
||||||
|
Program.acpi.SubscribeToEvents(WatcherEventArrived);
|
||||||
|
|
||||||
|
if (!isOptimizationRunning) AsusUSB.RunListener(HandleEvent);
|
||||||
|
|
||||||
|
// CTRL + SHIFT + F5 to cycle profiles
|
||||||
|
if (AppConfig.getConfig("keybind_profile") != -1) keyProfile = (Keys)AppConfig.getConfig("keybind_profile");
|
||||||
|
|
||||||
|
togggle = new KeyHandler(KeyHandler.SHIFT | KeyHandler.CTRL, keyProfile, windowHandle);
|
||||||
|
m1 = new KeyHandler(KeyHandler.NOMOD, Keys.VolumeDown, windowHandle);
|
||||||
|
m2 = new KeyHandler(KeyHandler.NOMOD, Keys.VolumeUp, windowHandle);
|
||||||
|
|
||||||
|
RegisterKeys();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void RegisterKeys()
|
||||||
|
{
|
||||||
|
|
||||||
|
string actionM1 = AppConfig.getConfigString("m1");
|
||||||
|
string actionM2 = AppConfig.getConfigString("m2");
|
||||||
|
|
||||||
|
togggle.Unregiser();
|
||||||
|
m1.Unregiser();
|
||||||
|
m2.Unregiser();
|
||||||
|
|
||||||
|
if (keyProfile != Keys.None)
|
||||||
|
{
|
||||||
|
togggle.Register();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (actionM1 is not null && actionM1.Length > 0)
|
||||||
|
{
|
||||||
|
m1.Register();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (actionM2 is not null && actionM2.Length > 0)
|
||||||
|
{
|
||||||
|
m2.Register();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
static void CustomKey(string configKey = "m3")
|
||||||
|
{
|
||||||
|
string command = AppConfig.getConfigString(configKey + "_custom");
|
||||||
|
int intKey;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
intKey = Convert.ToInt32(command, 16);
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
intKey = -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (intKey > 0)
|
||||||
|
NativeMethods.KeyPress(intKey);
|
||||||
|
else
|
||||||
|
LaunchProcess(command);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void KeyProcess(string name = "m3")
|
||||||
|
{
|
||||||
|
string action = AppConfig.getConfigString(name);
|
||||||
|
|
||||||
|
if (action is null || action.Length <= 1)
|
||||||
|
{
|
||||||
|
if (name == "m4")
|
||||||
|
action = "ghelper";
|
||||||
|
if (name == "fnf4")
|
||||||
|
action = "aura";
|
||||||
|
if (name == "fnf5")
|
||||||
|
action = "performance";
|
||||||
|
if (name == "m3" && !isOptimizationRunning)
|
||||||
|
action = "micmute";
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (action)
|
||||||
|
{
|
||||||
|
case "mute":
|
||||||
|
NativeMethods.KeyPress(NativeMethods.VK_VOLUME_MUTE);
|
||||||
|
break;
|
||||||
|
case "play":
|
||||||
|
NativeMethods.KeyPress(NativeMethods.VK_MEDIA_PLAY_PAUSE);
|
||||||
|
break;
|
||||||
|
case "screenshot":
|
||||||
|
NativeMethods.KeyPress(NativeMethods.VK_SNAPSHOT);
|
||||||
|
break;
|
||||||
|
case "screen":
|
||||||
|
NativeMethods.TurnOffScreen(Program.settingsForm.Handle);
|
||||||
|
break;
|
||||||
|
case "miniled":
|
||||||
|
Program.settingsForm.BeginInvoke(Program.settingsForm.ToogleMiniled);
|
||||||
|
break;
|
||||||
|
case "aura":
|
||||||
|
Program.settingsForm.BeginInvoke(Program.settingsForm.CycleAuraMode);
|
||||||
|
break;
|
||||||
|
case "performance":
|
||||||
|
Program.settingsForm.BeginInvoke(Program.settingsForm.CyclePerformanceMode);
|
||||||
|
break;
|
||||||
|
case "ghelper":
|
||||||
|
Program.settingsForm.BeginInvoke(delegate
|
||||||
|
{
|
||||||
|
Program.SettingsToggle();
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
case "custom":
|
||||||
|
CustomKey(name);
|
||||||
|
break;
|
||||||
|
case "micmute":
|
||||||
|
using (var enumerator = new MMDeviceEnumerator())
|
||||||
|
{
|
||||||
|
var commDevice = enumerator.GetDefaultAudioEndpoint(DataFlow.Capture, Role.Communications);
|
||||||
|
bool muteStatus = !commDevice.AudioEndpointVolume.Mute;
|
||||||
|
commDevice.AudioEndpointVolume.Mute = muteStatus;
|
||||||
|
Program.settingsForm.BeginInvoke(Program.settingsForm.RunToast, muteStatus ? "Muted" : "Unmuted", muteStatus ? ToastIcon.MicrophoneMute : ToastIcon.Microphone);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool GetTouchpadState()
|
||||||
|
{
|
||||||
|
using (var key = Registry.CurrentUser.OpenSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\PrecisionTouchPad\Status", false))
|
||||||
|
{
|
||||||
|
return (key?.GetValue("Enabled")?.ToString() == "1");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void TabletMode()
|
||||||
|
{
|
||||||
|
bool touchpadState = GetTouchpadState();
|
||||||
|
bool tabletState = Program.acpi.DeviceGet(AsusACPI.TabletState) > 0;
|
||||||
|
|
||||||
|
Logger.WriteLine("Tablet: " + tabletState + " Touchpad: " + touchpadState);
|
||||||
|
|
||||||
|
if ((tabletState && touchpadState) || (!tabletState && !touchpadState)) AsusUSB.TouchpadToggle();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
static void HandleEvent(int EventID)
|
||||||
|
{
|
||||||
|
switch (EventID)
|
||||||
|
{
|
||||||
|
case 124: // M3
|
||||||
|
KeyProcess("m3");
|
||||||
|
return;
|
||||||
|
case 56: // M4 / Rog button
|
||||||
|
KeyProcess("m4");
|
||||||
|
return;
|
||||||
|
case 174: // FN+F5
|
||||||
|
Program.settingsForm.BeginInvoke(Program.settingsForm.CyclePerformanceMode);
|
||||||
|
return;
|
||||||
|
case 179: // FN+F4
|
||||||
|
KeyProcess("fnf4");
|
||||||
|
return;
|
||||||
|
case 189: // Tablet mode
|
||||||
|
TabletMode();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isOptimizationRunning) return;
|
||||||
|
|
||||||
|
// Asus Optimization service Events
|
||||||
|
|
||||||
|
int backlight = AppConfig.getConfig("keyboard_brightness");
|
||||||
|
|
||||||
|
string[] backlightNames = new string[] { "Off", "Low", "Mid", "Max" };
|
||||||
|
|
||||||
|
int brightness;
|
||||||
|
|
||||||
|
switch (EventID)
|
||||||
|
{
|
||||||
|
case 197: // FN+F2
|
||||||
|
backlight = Math.Max(0, backlight - 1);
|
||||||
|
AppConfig.setConfig("keyboard_brightness", backlight);
|
||||||
|
AsusUSB.ApplyBrightness(backlight);
|
||||||
|
Program.settingsForm.BeginInvoke(Program.settingsForm.RunToast, backlightNames[backlight], ToastIcon.BacklightDown);
|
||||||
|
break;
|
||||||
|
case 196: // FN+F3
|
||||||
|
backlight = Math.Min(3, backlight + 1);
|
||||||
|
AppConfig.setConfig("keyboard_brightness", backlight);
|
||||||
|
AsusUSB.ApplyBrightness(backlight);
|
||||||
|
Program.settingsForm.BeginInvoke(Program.settingsForm.RunToast, backlightNames[backlight], ToastIcon.BacklightUp);
|
||||||
|
break;
|
||||||
|
case 199: // ON Z13 - FN+F11 - cycles backlight
|
||||||
|
if (++backlight > 3) backlight = 0;
|
||||||
|
AppConfig.setConfig("keyboard_brightness", backlight);
|
||||||
|
AsusUSB.ApplyBrightness(backlight);
|
||||||
|
Program.settingsForm.BeginInvoke(Program.settingsForm.RunToast, backlightNames[backlight], ToastIcon.BacklightUp);
|
||||||
|
break;
|
||||||
|
case 16: // FN+F7
|
||||||
|
Program.acpi.DeviceSet(AsusACPI.UniversalControl, 0x10, "Brightness");
|
||||||
|
break;
|
||||||
|
case 32: // FN+F8
|
||||||
|
Program.acpi.DeviceSet(AsusACPI.UniversalControl, 0x20, "Brightness");
|
||||||
|
break;
|
||||||
|
case 107: // FN+F10
|
||||||
|
bool touchpadState = GetTouchpadState();
|
||||||
|
if (!AsusUSB.TouchpadToggle()) Program.acpi.DeviceSet(AsusACPI.UniversalControl, 0x6B, "Touchpad");
|
||||||
|
Program.settingsForm.BeginInvoke(Program.settingsForm.RunToast, touchpadState ? "Off" : "On", ToastIcon.Touchpad);
|
||||||
|
break;
|
||||||
|
case 108: // FN+F11
|
||||||
|
Program.acpi.DeviceSet(AsusACPI.UniversalControl, 0x6c, "Sleep");
|
||||||
|
//NativeMethods.SetSuspendState(false, true, true);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static void LaunchProcess(string command = "")
|
||||||
|
{
|
||||||
|
string executable = command.Split(' ')[0];
|
||||||
|
string arguments = command.Substring(executable.Length).Trim();
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Process proc = Process.Start(executable, arguments);
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
Logger.WriteLine("Failed to run " + command);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
static void WatcherEventArrived(object sender, EventArrivedEventArgs e)
|
||||||
|
{
|
||||||
|
if (e.NewEvent is null) return;
|
||||||
|
int EventID = int.Parse(e.NewEvent["EventID"].ToString());
|
||||||
|
Logger.WriteLine("WMI event " + EventID);
|
||||||
|
HandleEvent(EventID);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -435,6 +435,10 @@ public class NativeMethods
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
[DllImport("Powrprof.dll", CharSet = CharSet.Auto, ExactSpelling = true)]
|
||||||
|
public static extern bool SetSuspendState(bool hiberate, bool forceCritical, bool disableWakeEvent);
|
||||||
|
|
||||||
|
|
||||||
public const int KEYEVENTF_EXTENDEDKEY = 1;
|
public const int KEYEVENTF_EXTENDEDKEY = 1;
|
||||||
public const int KEYEVENTF_KEYUP = 2;
|
public const int KEYEVENTF_KEYUP = 2;
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ using System.Runtime.InteropServices;
|
|||||||
namespace OSD
|
namespace OSD
|
||||||
{
|
{
|
||||||
|
|
||||||
class OSDNativeForm : NativeWindow, IDisposable
|
public class OSDNativeForm : NativeWindow, IDisposable
|
||||||
{
|
{
|
||||||
|
|
||||||
private bool _disposed = false;
|
private bool _disposed = false;
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
using System.Diagnostics;
|
||||||
|
|
||||||
namespace GHelper
|
namespace GHelper
|
||||||
{
|
{
|
||||||
@@ -33,6 +34,11 @@ namespace GHelper
|
|||||||
File.WriteAllText(path, fileContents, Encoding.Unicode);
|
File.WriteAllText(path, fileContents, Encoding.Unicode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static bool IsRunning()
|
||||||
|
{
|
||||||
|
return (Process.GetProcessesByName("AsusOptimization").Count() > 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
171
app/Program.cs
@@ -1,10 +1,12 @@
|
|||||||
using Microsoft.Win32;
|
using Microsoft.Win32;
|
||||||
|
using NAudio.CoreAudioApi;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.Management;
|
using System.Management;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Security.Principal;
|
using System.Security.Principal;
|
||||||
using Tools;
|
using Tools;
|
||||||
|
using static NativeMethods;
|
||||||
|
|
||||||
namespace GHelper
|
namespace GHelper
|
||||||
{
|
{
|
||||||
@@ -18,11 +20,9 @@ namespace GHelper
|
|||||||
Visible = true
|
Visible = true
|
||||||
};
|
};
|
||||||
|
|
||||||
public static ASUSWmi? wmi;
|
public static AsusACPI? acpi;
|
||||||
public static AppConfig config = new AppConfig();
|
|
||||||
|
|
||||||
public static SettingsForm settingsForm = new SettingsForm();
|
public static SettingsForm settingsForm = new SettingsForm();
|
||||||
public static ToastForm toast = new ToastForm();
|
|
||||||
|
|
||||||
public static IntPtr unRegPowerNotify;
|
public static IntPtr unRegPowerNotify;
|
||||||
|
|
||||||
@@ -30,6 +30,8 @@ namespace GHelper
|
|||||||
private static long lastTheme;
|
private static long lastTheme;
|
||||||
private static long lastAdmin;
|
private static long lastAdmin;
|
||||||
|
|
||||||
|
public static InputDispatcher inputDispatcher;
|
||||||
|
|
||||||
private static PowerLineStatus isPlugged = PowerLineStatus.Unknown;
|
private static PowerLineStatus isPlugged = PowerLineStatus.Unknown;
|
||||||
|
|
||||||
// The main entry point for the application
|
// The main entry point for the application
|
||||||
@@ -42,13 +44,13 @@ namespace GHelper
|
|||||||
Thread.CurrentThread.CurrentUICulture = CultureInfo.CurrentUICulture;
|
Thread.CurrentThread.CurrentUICulture = CultureInfo.CurrentUICulture;
|
||||||
Debug.WriteLine(CultureInfo.CurrentUICulture);
|
Debug.WriteLine(CultureInfo.CurrentUICulture);
|
||||||
|
|
||||||
//Thread.CurrentThread.CurrentUICulture = CultureInfo.CreateSpecificCulture("fr");
|
//Thread.CurrentThread.CurrentUICulture = CultureInfo.CreateSpecificCulture("uk");
|
||||||
|
|
||||||
CheckProcesses();
|
CheckProcesses();
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
wmi = new ASUSWmi();
|
acpi = new AsusACPI();
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
@@ -63,7 +65,7 @@ namespace GHelper
|
|||||||
}
|
}
|
||||||
|
|
||||||
Logger.WriteLine("------------");
|
Logger.WriteLine("------------");
|
||||||
Logger.WriteLine("App launched: " + config.GetModel() + " :" + Assembly.GetExecutingAssembly().GetName().Version.ToString() + (IsUserAdministrator() ? "A" : ""));
|
Logger.WriteLine("App launched: " + AppConfig.GetModel() + " :" + Assembly.GetExecutingAssembly().GetName().Version.ToString() + CultureInfo.CurrentUICulture + (IsUserAdministrator() ? "A" : ""));
|
||||||
|
|
||||||
Application.EnableVisualStyles();
|
Application.EnableVisualStyles();
|
||||||
|
|
||||||
@@ -73,12 +75,13 @@ namespace GHelper
|
|||||||
|
|
||||||
trayIcon.MouseClick += TrayIcon_MouseClick;
|
trayIcon.MouseClick += TrayIcon_MouseClick;
|
||||||
|
|
||||||
wmi.SubscribeToEvents(WatcherEventArrived);
|
inputDispatcher = new InputDispatcher(ds);
|
||||||
|
|
||||||
settingsForm.InitAura();
|
settingsForm.InitAura();
|
||||||
settingsForm.InitMatrix();
|
settingsForm.InitMatrix();
|
||||||
settingsForm.SetStartupCheck(Startup.IsScheduled());
|
settingsForm.SetStartupCheck(Startup.IsScheduled());
|
||||||
|
|
||||||
|
|
||||||
SetAutoModes();
|
SetAutoModes();
|
||||||
|
|
||||||
// Subscribing for system power change events
|
// Subscribing for system power change events
|
||||||
@@ -86,24 +89,16 @@ namespace GHelper
|
|||||||
SystemEvents.UserPreferenceChanged += SystemEvents_UserPreferenceChanged;
|
SystemEvents.UserPreferenceChanged += SystemEvents_UserPreferenceChanged;
|
||||||
|
|
||||||
// Subscribing for monitor power on events
|
// Subscribing for monitor power on events
|
||||||
var settingGuid = new NativeMethods.PowerSettingGuid();
|
PowerSettingGuid settingGuid = new NativeMethods.PowerSettingGuid();
|
||||||
unRegPowerNotify = NativeMethods.RegisterPowerSettingNotification(ds, settingGuid.ConsoleDisplayState, NativeMethods.DEVICE_NOTIFY_WINDOW_HANDLE);
|
unRegPowerNotify = NativeMethods.RegisterPowerSettingNotification(ds, settingGuid.ConsoleDisplayState, NativeMethods.DEVICE_NOTIFY_WINDOW_HANDLE);
|
||||||
|
|
||||||
// CTRL + SHIFT + F5 to cycle profiles
|
|
||||||
Keys keybind_profile = (config.getConfig("keybind_profile") != -1) ? (Keys)config.getConfig("keybind_profile") : Keys.F5;
|
|
||||||
if (keybind_profile != 0)
|
|
||||||
{
|
|
||||||
var ghk = new KeyHandler(KeyHandler.SHIFT | KeyHandler.CTRL, keybind_profile, ds);
|
|
||||||
ghk.Register();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if (Environment.CurrentDirectory.Trim('\\') == Application.StartupPath.Trim('\\') || action.Length > 0)
|
if (Environment.CurrentDirectory.Trim('\\') == Application.StartupPath.Trim('\\') || action.Length > 0)
|
||||||
{
|
{
|
||||||
SettingsToggle(action);
|
SettingsToggle(action);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Task.Run(wmi.RunListener);
|
|
||||||
|
|
||||||
Application.Run();
|
Application.Run();
|
||||||
|
|
||||||
@@ -147,7 +142,7 @@ namespace GHelper
|
|||||||
isPlugged = SystemInformation.PowerStatus.PowerLineStatus;
|
isPlugged = SystemInformation.PowerStatus.PowerLineStatus;
|
||||||
Logger.WriteLine("AutoSetting for " + isPlugged.ToString());
|
Logger.WriteLine("AutoSetting for " + isPlugged.ToString());
|
||||||
|
|
||||||
settingsForm.SetBatteryChargeLimit(config.getConfig("charge_limit"));
|
settingsForm.SetBatteryChargeLimit(AppConfig.getConfig("charge_limit"));
|
||||||
settingsForm.AutoPerformance();
|
settingsForm.AutoPerformance();
|
||||||
|
|
||||||
bool switched = settingsForm.AutoGPUMode();
|
bool switched = settingsForm.AutoGPUMode();
|
||||||
@@ -171,146 +166,8 @@ namespace GHelper
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void LaunchProcess(string command = "")
|
|
||||||
{
|
|
||||||
string executable = command.Split(' ')[0];
|
|
||||||
string arguments = command.Substring(executable.Length).Trim();
|
|
||||||
|
|
||||||
try
|
public static void SettingsToggle(string action = "")
|
||||||
{
|
|
||||||
Process proc = Process.Start(executable, arguments);
|
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
Logger.WriteLine("Failed to run " + command);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
static void CustomKey(string configKey = "m3")
|
|
||||||
{
|
|
||||||
string command = config.getConfigString(configKey + "_custom");
|
|
||||||
int intKey;
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
intKey = Convert.ToInt32(command, 16);
|
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
intKey = -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if (intKey > 0)
|
|
||||||
NativeMethods.KeyPress(intKey);
|
|
||||||
else
|
|
||||||
LaunchProcess(command);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
static void KeyProcess(string name = "m3")
|
|
||||||
{
|
|
||||||
string action = config.getConfigString(name);
|
|
||||||
|
|
||||||
if (action is null || action.Length <= 1)
|
|
||||||
{
|
|
||||||
if (name == "m4")
|
|
||||||
action = "ghelper";
|
|
||||||
if (name == "fnf4")
|
|
||||||
action = "aura";
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (action)
|
|
||||||
{
|
|
||||||
case "mute":
|
|
||||||
NativeMethods.KeyPress(NativeMethods.VK_VOLUME_MUTE);
|
|
||||||
break;
|
|
||||||
case "play":
|
|
||||||
NativeMethods.KeyPress(NativeMethods.VK_MEDIA_PLAY_PAUSE);
|
|
||||||
break;
|
|
||||||
case "screenshot":
|
|
||||||
NativeMethods.KeyPress(NativeMethods.VK_SNAPSHOT);
|
|
||||||
break;
|
|
||||||
case "screen":
|
|
||||||
NativeMethods.TurnOffScreen(Program.settingsForm.Handle);
|
|
||||||
break;
|
|
||||||
case "miniled":
|
|
||||||
settingsForm.BeginInvoke(settingsForm.ToogleMiniled);
|
|
||||||
break;
|
|
||||||
case "aura":
|
|
||||||
settingsForm.BeginInvoke(settingsForm.CycleAuraMode);
|
|
||||||
break;
|
|
||||||
case "performance":
|
|
||||||
settingsForm.BeginInvoke(settingsForm.CyclePerformanceMode);
|
|
||||||
break;
|
|
||||||
case "ghelper":
|
|
||||||
settingsForm.BeginInvoke(delegate
|
|
||||||
{
|
|
||||||
SettingsToggle();
|
|
||||||
});
|
|
||||||
break;
|
|
||||||
case "custom":
|
|
||||||
CustomKey(name);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void TabletMode()
|
|
||||||
{
|
|
||||||
bool touchpadState, tabletState;
|
|
||||||
|
|
||||||
using (var key = Registry.CurrentUser.OpenSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\PrecisionTouchPad\Status", false))
|
|
||||||
{
|
|
||||||
touchpadState = (key?.GetValue("Enabled")?.ToString() == "1");
|
|
||||||
}
|
|
||||||
|
|
||||||
tabletState = wmi.DeviceGet(ASUSWmi.TabletState) > 0;
|
|
||||||
|
|
||||||
Logger.WriteLine("Tablet: " + tabletState + " Touchpad: " + touchpadState);
|
|
||||||
|
|
||||||
if ((tabletState && touchpadState) || (!tabletState && !touchpadState))
|
|
||||||
wmi.DeviceSet(ASUSWmi.UniversalControl, ASUSWmi.Touchpad_Toggle, "Touchpad");
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
static void WatcherEventArrived(object sender, EventArrivedEventArgs e)
|
|
||||||
{
|
|
||||||
var collection = (ManagementEventWatcher)sender;
|
|
||||||
|
|
||||||
if (e.NewEvent is null) return;
|
|
||||||
|
|
||||||
int EventID = int.Parse(e.NewEvent["EventID"].ToString());
|
|
||||||
|
|
||||||
Logger.WriteLine("WMI event " + EventID);
|
|
||||||
|
|
||||||
switch (EventID)
|
|
||||||
{
|
|
||||||
case 124: // M3
|
|
||||||
KeyProcess("m3");
|
|
||||||
return;
|
|
||||||
case 56: // M4 / Rog button
|
|
||||||
KeyProcess("m4");
|
|
||||||
return;
|
|
||||||
case 174: // FN+F5
|
|
||||||
settingsForm.BeginInvoke(settingsForm.CyclePerformanceMode);
|
|
||||||
return;
|
|
||||||
case 179: // FN+F4
|
|
||||||
KeyProcess("fnf4");
|
|
||||||
return;
|
|
||||||
case 189: // Tablet mode
|
|
||||||
TabletMode();
|
|
||||||
return;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
static void SettingsToggle(string action = "")
|
|
||||||
{
|
{
|
||||||
if (settingsForm.Visible)
|
if (settingsForm.Visible)
|
||||||
settingsForm.Hide();
|
settingsForm.Hide();
|
||||||
|
|||||||
72
app/Properties/Resources.Designer.cs
generated
@@ -61,25 +61,55 @@ namespace GHelper.Properties {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
|
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal static System.Drawing.Icon eco {
|
internal static System.Drawing.Bitmap backlight_down {
|
||||||
get {
|
get {
|
||||||
object obj = ResourceManager.GetObject("eco", resourceCulture);
|
object obj = ResourceManager.GetObject("backlight_down", resourceCulture);
|
||||||
return ((System.Drawing.Icon)(obj));
|
return ((System.Drawing.Bitmap)(obj));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal static System.Drawing.Bitmap everything_is_fine_itsfine {
|
internal static System.Drawing.Bitmap backlight_up {
|
||||||
get {
|
get {
|
||||||
object obj = ResourceManager.GetObject("everything-is-fine-itsfine", resourceCulture);
|
object obj = ResourceManager.GetObject("backlight_up", resourceCulture);
|
||||||
return ((System.Drawing.Bitmap)(obj));
|
return ((System.Drawing.Bitmap)(obj));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||||
|
/// </summary>
|
||||||
|
internal static System.Drawing.Bitmap brightness_down {
|
||||||
|
get {
|
||||||
|
object obj = ResourceManager.GetObject("brightness_down", resourceCulture);
|
||||||
|
return ((System.Drawing.Bitmap)(obj));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||||
|
/// </summary>
|
||||||
|
internal static System.Drawing.Bitmap brightness_up {
|
||||||
|
get {
|
||||||
|
object obj = ResourceManager.GetObject("brightness_up", resourceCulture);
|
||||||
|
return ((System.Drawing.Bitmap)(obj));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
|
||||||
|
/// </summary>
|
||||||
|
internal static System.Drawing.Icon eco {
|
||||||
|
get {
|
||||||
|
object obj = ResourceManager.GetObject("eco", resourceCulture);
|
||||||
|
return ((System.Drawing.Icon)(obj));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -230,6 +260,26 @@ namespace GHelper.Properties {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||||
|
/// </summary>
|
||||||
|
internal static System.Drawing.Bitmap icons8_microphone_96 {
|
||||||
|
get {
|
||||||
|
object obj = ResourceManager.GetObject("icons8_microphone_96", resourceCulture);
|
||||||
|
return ((System.Drawing.Bitmap)(obj));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||||
|
/// </summary>
|
||||||
|
internal static System.Drawing.Bitmap icons8_mute_unmute_96 {
|
||||||
|
get {
|
||||||
|
object obj = ResourceManager.GetObject("icons8_mute_unmute_96", resourceCulture);
|
||||||
|
return ((System.Drawing.Bitmap)(obj));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -330,6 +380,16 @@ namespace GHelper.Properties {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||||
|
/// </summary>
|
||||||
|
internal static System.Drawing.Bitmap icons8_touchpad_96 {
|
||||||
|
get {
|
||||||
|
object obj = ResourceManager.GetObject("icons8_touchpad_96", resourceCulture);
|
||||||
|
return ((System.Drawing.Bitmap)(obj));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -133,9 +133,6 @@
|
|||||||
<data name="icons8-fiat-500-48" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
<data name="icons8-fiat-500-48" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
<value>..\Resources\icons8-fiat-500-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
<value>..\Resources\icons8-fiat-500-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="icons8-project-management-48 (1)" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
|
||||||
<value>..\Resources\icons8-project-management-48 (1).png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
|
||||||
</data>
|
|
||||||
<data name="icons8-bicycle-48 (1)" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
<data name="icons8-bicycle-48 (1)" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
<value>..\Resources\icons8-bicycle-48 (1).png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
<value>..\Resources\icons8-bicycle-48 (1).png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -205,13 +202,34 @@
|
|||||||
<data name="icons8-speed-48" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
<data name="icons8-speed-48" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
<value>..\Resources\icons8-speed-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
<value>..\Resources\icons8-speed-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="everything-is-fine-itsfine" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
|
||||||
<value>..\Resources\itsfine.jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
|
||||||
</data>
|
|
||||||
<data name="icons8-help-64" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
<data name="icons8-help-64" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
<value>..\Resources\icons8-help-64.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
<value>..\Resources\icons8-help-64.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="icons8_video_48" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
<data name="icons8_video_48" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
<value>..\Resources\icons8-video-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
<value>..\Resources\icons8-video-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="icons8-project-management-48 (1)" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
|
<value>..\Resources\icons8-project-management-48 (1).png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
|
</data>
|
||||||
|
<data name="icons8_microphone_96" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
|
<value>..\Resources\icons8-microphone-96.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
|
</data>
|
||||||
|
<data name="icons8_touchpad_96" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
|
<value>..\Resources\icons8-touchpad-96.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
|
</data>
|
||||||
|
<data name="backlight_down" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
|
<value>..\Resources\backlight-down.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
|
</data>
|
||||||
|
<data name="backlight_up" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
|
<value>..\Resources\backlight-up.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
|
</data>
|
||||||
|
<data name="brightness_down" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
|
<value>..\Resources\brightness-down.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
|
</data>
|
||||||
|
<data name="brightness_up" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
|
<value>..\Resources\brightness-up.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
|
</data>
|
||||||
|
<data name="icons8_mute_unmute_96" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
|
<value>..\Resources\icons8-mute-unmute-96.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
||||||
30
app/Properties/Strings.Designer.cs
generated
@@ -1,6 +1,7 @@
|
|||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// <auto-generated>
|
// <auto-generated>
|
||||||
// This code was generated by a tool.
|
// This code was generated by a tool.
|
||||||
|
// Runtime Version:4.0.30319.42000
|
||||||
//
|
//
|
||||||
// Changes to this file may cause incorrect behavior and will be lost if
|
// Changes to this file may cause incorrect behavior and will be lost if
|
||||||
// the code is regenerated.
|
// the code is regenerated.
|
||||||
@@ -168,7 +169,7 @@ namespace GHelper.Properties {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to Auto adjust Windows Power Mode.
|
/// Looks up a localized string similar to Auto adjust Windows Power Modes.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal static string ApplyWindowsPowerPlan {
|
internal static string ApplyWindowsPowerPlan {
|
||||||
get {
|
get {
|
||||||
@@ -779,6 +780,15 @@ namespace GHelper.Properties {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized string similar to Mute Mic.
|
||||||
|
/// </summary>
|
||||||
|
internal static string MuteMic {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("MuteMic", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to Open G-Helper window.
|
/// Looks up a localized string similar to Open G-Helper window.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -1058,6 +1068,15 @@ namespace GHelper.Properties {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized string similar to Volume Down.
|
||||||
|
/// </summary>
|
||||||
|
internal static string VolumeDown {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("VolumeDown", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to Volume Mute.
|
/// Looks up a localized string similar to Volume Mute.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -1067,6 +1086,15 @@ namespace GHelper.Properties {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized string similar to Volume Up.
|
||||||
|
/// </summary>
|
||||||
|
internal static string VolumeUp {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("VolumeUp", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to Keep app window always on top.
|
/// Looks up a localized string similar to Keep app window always on top.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -154,7 +154,7 @@
|
|||||||
<value>Aplicar límites de energía</value>
|
<value>Aplicar límites de energía</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="ApplyWindowsPowerPlan" xml:space="preserve">
|
<data name="ApplyWindowsPowerPlan" xml:space="preserve">
|
||||||
<value>Auto Adjust Windows Power Mode</value>
|
<value>Auto-ajustar plan de energía Windows</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="AuraBreathe" xml:space="preserve">
|
<data name="AuraBreathe" xml:space="preserve">
|
||||||
<value>Respiración</value>
|
<value>Respiración</value>
|
||||||
@@ -189,6 +189,9 @@
|
|||||||
<data name="Awake" xml:space="preserve">
|
<data name="Awake" xml:space="preserve">
|
||||||
<value>Encendida</value>
|
<value>Encendida</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="BacklightTimeout" xml:space="preserve">
|
||||||
|
<value>Apagar retroiluminación con batería (s.)</value>
|
||||||
|
</data>
|
||||||
<data name="Balanced" xml:space="preserve">
|
<data name="Balanced" xml:space="preserve">
|
||||||
<value>Equilibrado</value>
|
<value>Equilibrado</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -255,11 +258,23 @@
|
|||||||
<data name="FansAndPower" xml:space="preserve">
|
<data name="FansAndPower" xml:space="preserve">
|
||||||
<value>Ventiladores y energía</value>
|
<value>Ventiladores y energía</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="FanSpeed" xml:space="preserve">
|
||||||
|
<value> Fan: </value>
|
||||||
|
</data>
|
||||||
<data name="FansPower" xml:space="preserve">
|
<data name="FansPower" xml:space="preserve">
|
||||||
<value>Ventiladores + Energía</value>
|
<value>Ventiladores + Energía</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="GPUBoost" xml:space="preserve">
|
||||||
|
<value>Dynamic Boost</value>
|
||||||
|
</data>
|
||||||
<data name="GPUChanging" xml:space="preserve">
|
<data name="GPUChanging" xml:space="preserve">
|
||||||
<value>Cargando</value>
|
<value>Cargando</value>
|
||||||
|
</data>
|
||||||
|
<data name="GPUCoreClockOffset" xml:space="preserve">
|
||||||
|
<value>Core Clock Offset</value>
|
||||||
|
</data>
|
||||||
|
<data name="GPUMemoryClockOffset" xml:space="preserve">
|
||||||
|
<value>Memory Clock Offset</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="GPUMode" xml:space="preserve">
|
<data name="GPUMode" xml:space="preserve">
|
||||||
<value>Modo de GPU</value>
|
<value>Modo de GPU</value>
|
||||||
@@ -275,6 +290,9 @@
|
|||||||
</data>
|
</data>
|
||||||
<data name="GPUSettings" xml:space="preserve">
|
<data name="GPUSettings" xml:space="preserve">
|
||||||
<value>Ajustes de GPU</value>
|
<value>Ajustes de GPU</value>
|
||||||
|
</data>
|
||||||
|
<data name="GPUTempTarget" xml:space="preserve">
|
||||||
|
<value>Temperatura objetivo</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="KeyBindings" xml:space="preserve">
|
<data name="KeyBindings" xml:space="preserve">
|
||||||
<value>Atajos de teclado</value>
|
<value>Atajos de teclado</value>
|
||||||
@@ -302,6 +320,9 @@
|
|||||||
</data>
|
</data>
|
||||||
<data name="Logo" xml:space="preserve">
|
<data name="Logo" xml:space="preserve">
|
||||||
<value>Logo</value>
|
<value>Logo</value>
|
||||||
|
</data>
|
||||||
|
<data name="MatrixAudio" xml:space="preserve">
|
||||||
|
<value>Visualizador de audio</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="MatrixBanner" xml:space="preserve">
|
<data name="MatrixBanner" xml:space="preserve">
|
||||||
<value>Banner binario</value>
|
<value>Banner binario</value>
|
||||||
@@ -375,6 +396,9 @@
|
|||||||
<data name="Quit" xml:space="preserve">
|
<data name="Quit" xml:space="preserve">
|
||||||
<value>Quitar</value>
|
<value>Quitar</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="RestartGPU" xml:space="preserve">
|
||||||
|
<value>Algo está usando la dGPU e impide usar Modo Eco. ¿Reiniciar dGPU en administrador de dispositivos? * Proceda bajo su propio riesgo.</value>
|
||||||
|
</data>
|
||||||
<data name="RPM" xml:space="preserve">
|
<data name="RPM" xml:space="preserve">
|
||||||
<value>RPM</value>
|
<value>RPM</value>
|
||||||
</data>
|
</data>
|
||||||
|
|||||||
@@ -154,7 +154,7 @@
|
|||||||
<value>Apply Power Limits</value>
|
<value>Apply Power Limits</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="ApplyWindowsPowerPlan" xml:space="preserve">
|
<data name="ApplyWindowsPowerPlan" xml:space="preserve">
|
||||||
<value>Auto adjust Windows Power Mode</value>
|
<value>Auto adjust Windows Power Modes</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="AuraBreathe" xml:space="preserve">
|
<data name="AuraBreathe" xml:space="preserve">
|
||||||
<value>Breathe</value>
|
<value>Breathe</value>
|
||||||
@@ -357,6 +357,9 @@
|
|||||||
<data name="Multizone" xml:space="preserve">
|
<data name="Multizone" xml:space="preserve">
|
||||||
<value>Multizone</value>
|
<value>Multizone</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="MuteMic" xml:space="preserve">
|
||||||
|
<value>Mute Mic</value>
|
||||||
|
</data>
|
||||||
<data name="OpenGHelper" xml:space="preserve">
|
<data name="OpenGHelper" xml:space="preserve">
|
||||||
<value>Open G-Helper window</value>
|
<value>Open G-Helper window</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -450,9 +453,15 @@
|
|||||||
<data name="VersionLabel" xml:space="preserve">
|
<data name="VersionLabel" xml:space="preserve">
|
||||||
<value>Version</value>
|
<value>Version</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="VolumeDown" xml:space="preserve">
|
||||||
|
<value>Volume Down</value>
|
||||||
|
</data>
|
||||||
<data name="VolumeMute" xml:space="preserve">
|
<data name="VolumeMute" xml:space="preserve">
|
||||||
<value>Volume Mute</value>
|
<value>Volume Mute</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="VolumeUp" xml:space="preserve">
|
||||||
|
<value>Volume Up</value>
|
||||||
|
</data>
|
||||||
<data name="WindowTop" xml:space="preserve">
|
<data name="WindowTop" xml:space="preserve">
|
||||||
<value>Keep app window always on top</value>
|
<value>Keep app window always on top</value>
|
||||||
</data>
|
</data>
|
||||||
|
|||||||
@@ -154,7 +154,7 @@
|
|||||||
<value>Застосувати потужність</value>
|
<value>Застосувати потужність</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="ApplyWindowsPowerPlan" xml:space="preserve">
|
<data name="ApplyWindowsPowerPlan" xml:space="preserve">
|
||||||
<value>Автоматично застосовувати Windows Power Mode</value>
|
<value>Автоматично застосовувати Windows Power Modes</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="AuraBreathe" xml:space="preserve">
|
<data name="AuraBreathe" xml:space="preserve">
|
||||||
<value>Дихання</value>
|
<value>Дихання</value>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<root>
|
<root>
|
||||||
<!--
|
<!--
|
||||||
Microsoft ResX Schema
|
Microsoft ResX Schema
|
||||||
|
|
||||||
Version 2.0
|
Version 2.0
|
||||||
@@ -59,356 +59,404 @@
|
|||||||
: using a System.ComponentModel.TypeConverter
|
: using a System.ComponentModel.TypeConverter
|
||||||
: and then encoded with base64 encoding.
|
: and then encoded with base64 encoding.
|
||||||
-->
|
-->
|
||||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||||
<xsd:element name="root" msdata:IsDataSet="true">
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
<xsd:complexType>
|
<xsd:complexType>
|
||||||
<xsd:choice maxOccurs="unbounded">
|
<xsd:choice maxOccurs="unbounded">
|
||||||
<xsd:element name="metadata">
|
<xsd:element name="metadata">
|
||||||
<xsd:complexType>
|
<xsd:complexType>
|
||||||
<xsd:sequence>
|
<xsd:sequence>
|
||||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||||
</xsd:sequence>
|
</xsd:sequence>
|
||||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||||
<xsd:attribute name="type" type="xsd:string" />
|
<xsd:attribute name="type" type="xsd:string" />
|
||||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||||
<xsd:attribute ref="xml:space" />
|
<xsd:attribute ref="xml:space" />
|
||||||
</xsd:complexType>
|
</xsd:complexType>
|
||||||
</xsd:element>
|
</xsd:element>
|
||||||
<xsd:element name="assembly">
|
<xsd:element name="assembly">
|
||||||
<xsd:complexType>
|
<xsd:complexType>
|
||||||
<xsd:attribute name="alias" type="xsd:string" />
|
<xsd:attribute name="alias" type="xsd:string" />
|
||||||
<xsd:attribute name="name" type="xsd:string" />
|
<xsd:attribute name="name" type="xsd:string" />
|
||||||
</xsd:complexType>
|
</xsd:complexType>
|
||||||
</xsd:element>
|
</xsd:element>
|
||||||
<xsd:element name="data">
|
<xsd:element name="data">
|
||||||
<xsd:complexType>
|
<xsd:complexType>
|
||||||
<xsd:sequence>
|
<xsd:sequence>
|
||||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||||
</xsd:sequence>
|
</xsd:sequence>
|
||||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
<xsd:attribute ref="xml:space" />
|
<xsd:attribute ref="xml:space" />
|
||||||
</xsd:complexType>
|
</xsd:complexType>
|
||||||
</xsd:element>
|
</xsd:element>
|
||||||
<xsd:element name="resheader">
|
<xsd:element name="resheader">
|
||||||
<xsd:complexType>
|
<xsd:complexType>
|
||||||
<xsd:sequence>
|
<xsd:sequence>
|
||||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
</xsd:sequence>
|
</xsd:sequence>
|
||||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||||
</xsd:complexType>
|
</xsd:complexType>
|
||||||
</xsd:element>
|
</xsd:element>
|
||||||
</xsd:choice>
|
</xsd:choice>
|
||||||
</xsd:complexType>
|
</xsd:complexType>
|
||||||
</xsd:element>
|
</xsd:element>
|
||||||
</xsd:schema>
|
</xsd:schema>
|
||||||
<resheader name="resmimetype">
|
<resheader name="resmimetype">
|
||||||
<value>text/microsoft-resx</value>
|
<value>text/microsoft-resx</value>
|
||||||
</resheader>
|
</resheader>
|
||||||
<resheader name="version">
|
<resheader name="version">
|
||||||
<value>2.0</value>
|
<value>2.0</value>
|
||||||
</resheader>
|
</resheader>
|
||||||
<resheader name="reader">
|
<resheader name="reader">
|
||||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
</resheader>
|
</resheader>
|
||||||
<resheader name="writer">
|
<resheader name="writer">
|
||||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
</resheader>
|
</resheader>
|
||||||
<data name="ACPIError" xml:space="preserve">
|
<data name="ACPIError" xml:space="preserve">
|
||||||
<value>無法連結到華碩 ACPI。 没有它,應用程式將無法執行。 嘗試安裝Asus System Control Interface</value>
|
<value>無法連結到華碩 ACPI。 没有它,應用程式將無法執行。 嘗試安裝Asus System Control Interface</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="AlertDGPU" xml:space="preserve">
|
<data name="AlertDGPU" xml:space="preserve">
|
||||||
<value>看起来 GPU 正在大量使用,是否禁用它?</value>
|
<value>看起来 GPU 正在大量使用,是否禁用它?</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="AlertDGPUTitle" xml:space="preserve">
|
<data name="AlertDGPUTitle" xml:space="preserve">
|
||||||
<value>節能模式</value>
|
<value>節能模式</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="AlertUltimateOff" xml:space="preserve">
|
<data name="AlertUltimateOff" xml:space="preserve">
|
||||||
<value>關閉獨顯需要重新啟動</value>
|
<value>關閉獨顯需要重新啟動</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="AlertUltimateOn" xml:space="preserve">
|
<data name="AlertUltimateOn" xml:space="preserve">
|
||||||
<value>獨顯直連需要重啟</value>
|
<value>獨顯直連需要重啟</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="AlertUltimateTitle" xml:space="preserve">
|
<data name="AlertUltimateTitle" xml:space="preserve">
|
||||||
<value>現在重新啟動嗎?</value>
|
<value>現在重新啟動嗎?</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="AnimationSpeed" xml:space="preserve">
|
<data name="AnimationSpeed" xml:space="preserve">
|
||||||
<value>動畫速度</value>
|
<value>動畫速度</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="AnimeMatrix" xml:space="preserve">
|
<data name="AnimeMatrix" xml:space="preserve">
|
||||||
<value>AnimeMatrix</value>
|
<value>AnimeMatrix</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="AppAlreadyRunning" xml:space="preserve">
|
<data name="AppAlreadyRunning" xml:space="preserve">
|
||||||
<value>程式已正在執行</value>
|
<value>程式已正在執行</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="AppAlreadyRunningText" xml:space="preserve">
|
<data name="AppAlreadyRunningText" xml:space="preserve">
|
||||||
<value>G-Helper已經在執行。 請確認右下工作列中的圖示。</value>
|
<value>G-Helper已經在執行。 請確認右下工作列中的圖示。</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="ApplyFanCurve" xml:space="preserve">
|
<data name="ApplyFanCurve" xml:space="preserve">
|
||||||
<value>套用自定義風扇曲線</value>
|
<value>套用自定義風扇曲線</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="ApplyPowerLimits" xml:space="preserve">
|
<data name="ApplyPowerLimits" xml:space="preserve">
|
||||||
<value>套用功率限制</value>
|
<value>套用功率限制</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="ApplyWindowsPowerPlan" xml:space="preserve">
|
<data name="ApplyWindowsPowerPlan" xml:space="preserve">
|
||||||
<value>Auto Adjust Windows Power Mode</value>
|
<value>自動調整Windows電源模式</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="AuraBreathe" xml:space="preserve">
|
<data name="AuraBreathe" xml:space="preserve">
|
||||||
<value>呼吸</value>
|
<value>呼吸</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="AuraColorCycle" xml:space="preserve">
|
<data name="AuraColorCycle" xml:space="preserve">
|
||||||
<value>循環</value>
|
<value>循環</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="AuraFast" xml:space="preserve">
|
<data name="AuraFast" xml:space="preserve">
|
||||||
<value>快速</value>
|
<value>快速</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="AuraNormal" xml:space="preserve">
|
<data name="AuraNormal" xml:space="preserve">
|
||||||
<value>正常</value>
|
<value>正常</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="AuraRainbow" xml:space="preserve">
|
<data name="AuraRainbow" xml:space="preserve">
|
||||||
<value>彩虹</value>
|
<value>彩虹</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="AuraSlow" xml:space="preserve">
|
<data name="AuraSlow" xml:space="preserve">
|
||||||
<value>慢</value>
|
<value>慢</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="AuraStatic" xml:space="preserve">
|
<data name="AuraStatic" xml:space="preserve">
|
||||||
<value>靜態</value>
|
<value>靜態</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="AuraStrobe" xml:space="preserve">
|
<data name="AuraStrobe" xml:space="preserve">
|
||||||
<value>閃爍</value>
|
<value>閃爍</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="AutoMode" xml:space="preserve">
|
<data name="AutoMode" xml:space="preserve">
|
||||||
<value>自動</value>
|
<value>自動</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="AutoRefreshTooltip" xml:space="preserve">
|
<data name="AutoRefreshTooltip" xml:space="preserve">
|
||||||
<value>電池模式時自動60Hz</value>
|
<value>電池模式時自動60Hz</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Awake" xml:space="preserve">
|
<data name="Awake" xml:space="preserve">
|
||||||
<value>喚醒時</value>
|
<value>喚醒時</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Balanced" xml:space="preserve">
|
<data name="BacklightTimeout" xml:space="preserve">
|
||||||
|
<value>電池模式下自動關閉背光的秒數</value>
|
||||||
|
</data>
|
||||||
|
<data name="Balanced" xml:space="preserve">
|
||||||
<value>平衡模式</value>
|
<value>平衡模式</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="BatteryChargeLimit" xml:space="preserve">
|
<data name="BatteryChargeLimit" xml:space="preserve">
|
||||||
<value>電池充電上限</value>
|
<value>電池充電上限</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Boot" xml:space="preserve">
|
<data name="Boot" xml:space="preserve">
|
||||||
<value>開機時</value>
|
<value>開機時</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Brightness" xml:space="preserve">
|
<data name="Brightness" xml:space="preserve">
|
||||||
<value>亮度</value>
|
<value>亮度</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Color" xml:space="preserve">
|
<data name="Color" xml:space="preserve">
|
||||||
<value>顏色</value>
|
<value>顏色</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="CPUBoost" xml:space="preserve">
|
<data name="CPUBoost" xml:space="preserve">
|
||||||
<value>CPU 加速</value>
|
<value>CPU 加速</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Custom" xml:space="preserve">
|
<data name="Custom" xml:space="preserve">
|
||||||
<value>自定義設置</value>
|
<value>自定義設置</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Default" xml:space="preserve">
|
<data name="Default" xml:space="preserve">
|
||||||
<value>預設</value>
|
<value>預設</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="DisableOverdrive" xml:space="preserve">
|
<data name="DisableOverdrive" xml:space="preserve">
|
||||||
<value>禁用螢幕加速OD</value>
|
<value>禁用螢幕加速OD</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Discharging" xml:space="preserve">
|
<data name="Discharging" xml:space="preserve">
|
||||||
<value>正在釋放電力</value>
|
<value>正在釋放電力</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="DownloadUpdate" xml:space="preserve">
|
<data name="DownloadUpdate" xml:space="preserve">
|
||||||
<value>下載更新</value>
|
<value>下載更新</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="EcoGPUTooltip" xml:space="preserve">
|
<data name="EcoGPUTooltip" xml:space="preserve">
|
||||||
<value>禁用獨顯以節省電池電量</value>
|
<value>禁用獨顯以節省電池電量</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="EcoMode" xml:space="preserve">
|
<data name="EcoMode" xml:space="preserve">
|
||||||
<value>節能模式</value>
|
<value>節能模式</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Extra" xml:space="preserve">
|
<data name="Extra" xml:space="preserve">
|
||||||
<value>更多</value>
|
<value>更多</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="ExtraSettings" xml:space="preserve">
|
<data name="ExtraSettings" xml:space="preserve">
|
||||||
<value>更多設定</value>
|
<value>更多設定</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="FactoryDefaults" xml:space="preserve">
|
<data name="FactoryDefaults" xml:space="preserve">
|
||||||
<value>恢復原廠設定</value>
|
<value>恢復原廠設定</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="FanCurves" xml:space="preserve">
|
<data name="FanCurves" xml:space="preserve">
|
||||||
<value>風扇曲線</value>
|
<value>風扇曲線</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="FanProfileCPU" xml:space="preserve">
|
<data name="FanProfileCPU" xml:space="preserve">
|
||||||
<value>CPU 風扇設置文件</value>
|
<value>CPU 風扇設置文件</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="FanProfileGPU" xml:space="preserve">
|
<data name="FanProfileGPU" xml:space="preserve">
|
||||||
<value>GPU 風扇設置文件</value>
|
<value>GPU 風扇設置文件</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="FanProfileMid" xml:space="preserve">
|
<data name="FanProfileMid" xml:space="preserve">
|
||||||
<value>中等風扇設置</value>
|
<value>中等風扇設置</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="FanProfiles" xml:space="preserve">
|
<data name="FanProfiles" xml:space="preserve">
|
||||||
<value>風扇設置</value>
|
<value>風扇設置</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="FansAndPower" xml:space="preserve">
|
<data name="FansAndPower" xml:space="preserve">
|
||||||
<value>風扇和電源</value>
|
<value>風扇和電源</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="FansPower" xml:space="preserve">
|
<data name="FanSpeed" xml:space="preserve">
|
||||||
|
<value> 風扇: </value>
|
||||||
|
</data>
|
||||||
|
<data name="FansPower" xml:space="preserve">
|
||||||
<value>自定義設置</value>
|
<value>自定義設置</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="GPUChanging" xml:space="preserve">
|
<data name="GPUBoost" xml:space="preserve">
|
||||||
|
<value>Dynamic Boost</value>
|
||||||
|
</data>
|
||||||
|
<data name="GPUChanging" xml:space="preserve">
|
||||||
<value>切換中...</value>
|
<value>切換中...</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="GPUMode" xml:space="preserve">
|
<data name="GPUCoreClockOffset" xml:space="preserve">
|
||||||
|
<value>核心時脈偏移量(Offset)</value>
|
||||||
|
</data>
|
||||||
|
<data name="GPUMemoryClockOffset" xml:space="preserve">
|
||||||
|
<value>顯示卡記憶體偏移量(Offset)</value>
|
||||||
|
</data>
|
||||||
|
<data name="GPUMode" xml:space="preserve">
|
||||||
<value>GPU 模式</value>
|
<value>GPU 模式</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="GPUModeEco" xml:space="preserve">
|
<data name="GPUModeEco" xml:space="preserve">
|
||||||
<value>僅限內顯</value>
|
<value>僅限內顯</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="GPUModeStandard" xml:space="preserve">
|
<data name="GPUModeStandard" xml:space="preserve">
|
||||||
<value>內顯 + 獨顯</value>
|
<value>內顯 + 獨顯</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="GPUModeUltimate" xml:space="preserve">
|
<data name="GPUModeUltimate" xml:space="preserve">
|
||||||
<value>獨立顯卡</value>
|
<value>獨立顯卡</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="KeyBindings" xml:space="preserve">
|
<data name="GPUSettings" xml:space="preserve">
|
||||||
|
<value>顯卡設定</value>
|
||||||
|
</data>
|
||||||
|
<data name="GPUTempTarget" xml:space="preserve">
|
||||||
|
<value>GPU溫度上限</value>
|
||||||
|
</data>
|
||||||
|
<data name="KeyBindings" xml:space="preserve">
|
||||||
<value>按鍵綁定</value>
|
<value>按鍵綁定</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Keyboard" xml:space="preserve">
|
<data name="Keyboard" xml:space="preserve">
|
||||||
<value>鍵盤</value>
|
<value>鍵盤</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="KeyboardAuto" xml:space="preserve">
|
<data name="KeyboardAuto" xml:space="preserve">
|
||||||
<value>電池模式時自動降低鍵盤背光亮度以省電</value>
|
<value>電池模式時自動降低鍵盤背光亮度以省電</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="LaptopBacklight" xml:space="preserve">
|
<data name="LaptopBacklight" xml:space="preserve">
|
||||||
<value>背光</value>
|
<value>背光</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="LaptopKeyboard" xml:space="preserve">
|
<data name="LaptopKeyboard" xml:space="preserve">
|
||||||
<value>鍵盤背光:</value>
|
<value>鍵盤背光:</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="LaptopScreen" xml:space="preserve">
|
<data name="LaptopScreen" xml:space="preserve">
|
||||||
<value>螢幕顯示</value>
|
<value>螢幕顯示</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="MatrixBanner" xml:space="preserve">
|
<data name="Lid" xml:space="preserve">
|
||||||
|
<value>螢幕背蓋</value>
|
||||||
|
</data>
|
||||||
|
<data name="Lightbar" xml:space="preserve">
|
||||||
|
<value>燈條</value>
|
||||||
|
</data>
|
||||||
|
<data name="Logo" xml:space="preserve">
|
||||||
|
<value>Logo</value>
|
||||||
|
</data>
|
||||||
|
<data name="MatrixAudio" xml:space="preserve">
|
||||||
|
<value>Audio Visualizer</value>
|
||||||
|
</data>
|
||||||
|
<data name="MatrixBanner" xml:space="preserve">
|
||||||
<value>横幅</value>
|
<value>横幅</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="MatrixBright" xml:space="preserve">
|
<data name="MatrixBright" xml:space="preserve">
|
||||||
<value>明亮</value>
|
<value>明亮</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="MatrixClock" xml:space="preserve">
|
<data name="MatrixClock" xml:space="preserve">
|
||||||
<value>時鐘</value>
|
<value>時鐘</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="MatrixDim" xml:space="preserve">
|
<data name="MatrixDim" xml:space="preserve">
|
||||||
<value>黯淡</value>
|
<value>黯淡</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="MatrixLogo" xml:space="preserve">
|
<data name="MatrixLogo" xml:space="preserve">
|
||||||
<value>ROG logo</value>
|
<value>ROG logo</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="MatrixMedium" xml:space="preserve">
|
<data name="MatrixMedium" xml:space="preserve">
|
||||||
<value>中</value>
|
<value>中</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="MatrixOff" xml:space="preserve">
|
<data name="MatrixOff" xml:space="preserve">
|
||||||
<value>關閉</value>
|
<value>關閉</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="MatrixPicture" xml:space="preserve">
|
<data name="MatrixPicture" xml:space="preserve">
|
||||||
<value>圖片</value>
|
<value>圖片</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="MaxRefreshTooltip" xml:space="preserve">
|
<data name="MaxRefreshTooltip" xml:space="preserve">
|
||||||
<value>更高的更新率和更低延遲</value>
|
<value>更高的更新率和更低延遲</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="MinRefreshTooltip" xml:space="preserve">
|
<data name="MinRefreshTooltip" xml:space="preserve">
|
||||||
<value>維持60Hz以節省電量</value>
|
<value>維持60Hz以節省電量</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Multizone" xml:space="preserve">
|
<data name="Multizone" xml:space="preserve">
|
||||||
<value>多區域</value>
|
<value>多區域</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="OpenGHelper" xml:space="preserve">
|
<data name="MuteMic" xml:space="preserve">
|
||||||
<value>打開G-Helper視窗</value>
|
<value>麥克風開關</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Optimized" xml:space="preserve">
|
<data name="OpenGHelper" xml:space="preserve">
|
||||||
|
<value>開啟G-Helper視窗</value>
|
||||||
|
</data>
|
||||||
|
<data name="Optimized" xml:space="preserve">
|
||||||
<value>自動模式</value>
|
<value>自動模式</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="OptimizedGPUTooltip" xml:space="preserve">
|
<data name="OptimizedGPUTooltip" xml:space="preserve">
|
||||||
<value>使用電池切換到節能模式,插入電源時切換到標準模式</value>
|
<value>使用電池切換到節能模式,插入電源時切換到標準模式</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Other" xml:space="preserve">
|
<data name="OptimizedUSBC" xml:space="preserve">
|
||||||
|
<value>自動模式下,使用USB-C充電時持續關閉獨顯</value>
|
||||||
|
</data>
|
||||||
|
<data name="Other" xml:space="preserve">
|
||||||
<value>其他</value>
|
<value>其他</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Overdrive" xml:space="preserve">
|
<data name="Overdrive" xml:space="preserve">
|
||||||
<value>OD</value>
|
<value>OD</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="PerformanceMode" xml:space="preserve">
|
<data name="PerformanceMode" xml:space="preserve">
|
||||||
<value>性能模式:</value>
|
<value>性能模式:</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="PictureGif" xml:space="preserve">
|
<data name="PictureGif" xml:space="preserve">
|
||||||
<value>圖片/動圖</value>
|
<value>圖片/動圖</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="PlayPause" xml:space="preserve">
|
<data name="PlayPause" xml:space="preserve">
|
||||||
<value>播放/暫停</value>
|
<value>播放/暫停</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="PowerLimits" xml:space="preserve">
|
<data name="PowerLimits" xml:space="preserve">
|
||||||
<value>功率限制 (PPT)</value>
|
<value>功率限制 (PPT)</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="PPTExperimental" xml:space="preserve">
|
<data name="PPTExperimental" xml:space="preserve">
|
||||||
<value>功率限制 (PPT) 是實驗性功能。 謹慎使用,風險自負!</value>
|
<value>功率限制 (PPT) 是實驗性功能。 謹慎使用,風險自負!</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="PrintScreen" xml:space="preserve">
|
<data name="PrintScreen" xml:space="preserve">
|
||||||
<value>截圖</value>
|
<value>截圖</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Quit" xml:space="preserve">
|
<data name="Quit" xml:space="preserve">
|
||||||
<value>退出</value>
|
<value>退出</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="RPM" xml:space="preserve">
|
<data name="RestartGPU" xml:space="preserve">
|
||||||
|
<value>有其他程式正在使用獨顯導致無法切換至節能模式. 是否在裝置管理員中重啟獨顯? * 請自行評估風險</value>
|
||||||
|
</data>
|
||||||
|
<data name="RPM" xml:space="preserve">
|
||||||
<value>每分鐘轉數</value>
|
<value>每分鐘轉數</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="RunOnStartup" xml:space="preserve">
|
<data name="RunOnStartup" xml:space="preserve">
|
||||||
<value>開機自動開啟</value>
|
<value>開機自動開啟</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Shutdown" xml:space="preserve">
|
<data name="Shutdown" xml:space="preserve">
|
||||||
<value>關機時</value>
|
<value>關機時</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Silent" xml:space="preserve">
|
<data name="Silent" xml:space="preserve">
|
||||||
<value>安靜模式</value>
|
<value>安靜模式</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Sleep" xml:space="preserve">
|
<data name="Sleep" xml:space="preserve">
|
||||||
<value>睡眠時</value>
|
<value>睡眠時</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="StandardGPUTooltip" xml:space="preserve">
|
<data name="StandardGPUTooltip" xml:space="preserve">
|
||||||
<value>標準模式會啟用獨顯</value>
|
<value>標準模式會啟用獨顯</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="StandardMode" xml:space="preserve">
|
<data name="StandardMode" xml:space="preserve">
|
||||||
<value>標準模式</value>
|
<value>標準模式</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="StartupError" xml:space="preserve">
|
<data name="StartupError" xml:space="preserve">
|
||||||
<value>啟動錯誤</value>
|
<value>啟動錯誤</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="ToggleAura" xml:space="preserve">
|
<data name="ToggleAura" xml:space="preserve">
|
||||||
<value>切換Aura</value>
|
<value>切換Aura</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Turbo" xml:space="preserve">
|
<data name="ToggleMiniled" xml:space="preserve">
|
||||||
|
<value>切換Miniled(若有支援)</value>
|
||||||
|
</data>
|
||||||
|
<data name="ToggleScreen" xml:space="preserve">
|
||||||
|
<value>切換螢幕</value>
|
||||||
|
</data>
|
||||||
|
<data name="Turbo" xml:space="preserve">
|
||||||
<value>極速模式</value>
|
<value>極速模式</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="TurnedOff" xml:space="preserve">
|
<data name="TurnedOff" xml:space="preserve">
|
||||||
<value>已關閉</value>
|
<value>已關閉</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="TurnOffOnBattery" xml:space="preserve">
|
<data name="TurnOffOnBattery" xml:space="preserve">
|
||||||
<value>電池模式時關閉</value>
|
<value>電池模式時關閉</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="UltimateGPUTooltip" xml:space="preserve">
|
<data name="UltimateGPUTooltip" xml:space="preserve">
|
||||||
<value>開啟獨顯直連獲得最佳幀數</value>
|
<value>開啟獨顯直連獲得最佳幀數</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="UltimateMode" xml:space="preserve">
|
<data name="UltimateMode" xml:space="preserve">
|
||||||
<value>獨顯直連</value>
|
<value>獨顯直連</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="VersionLabel" xml:space="preserve">
|
<data name="VersionLabel" xml:space="preserve">
|
||||||
<value>版本</value>
|
<value>版本</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="VolumeMute" xml:space="preserve">
|
<data name="VolumeMute" xml:space="preserve">
|
||||||
<value>靜音</value>
|
<value>靜音</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="WindowTop" xml:space="preserve">
|
<data name="WindowTop" xml:space="preserve">
|
||||||
<value>視窗置頂</value>
|
<value>視窗置頂</value>
|
||||||
</data>
|
</data>
|
||||||
</root>
|
</root>
|
||||||
BIN
app/Resources/Brightness.bmp
Normal file
|
After Width: | Height: | Size: 3.3 KiB |
BIN
app/Resources/backlight-down.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
app/Resources/backlight-up.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
app/Resources/brightness-down.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
app/Resources/brightness-up.png
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
app/Resources/icons8-microphone-96.png
Normal file
|
After Width: | Height: | Size: 784 B |
BIN
app/Resources/icons8-mute-unmute-96.png
Normal file
|
After Width: | Height: | Size: 979 B |
BIN
app/Resources/icons8-touchpad-96.png
Normal file
|
After Width: | Height: | Size: 377 B |
47
app/ScreenBrightness.cs
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
namespace GHelper
|
||||||
|
{
|
||||||
|
using System;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using System.Management;
|
||||||
|
|
||||||
|
public static class ScreenBrightness
|
||||||
|
{
|
||||||
|
public static int Get()
|
||||||
|
{
|
||||||
|
using var mclass = new ManagementClass("WmiMonitorBrightness")
|
||||||
|
{
|
||||||
|
Scope = new ManagementScope(@"\\.\root\wmi")
|
||||||
|
};
|
||||||
|
using var instances = mclass.GetInstances();
|
||||||
|
foreach (ManagementObject instance in instances)
|
||||||
|
{
|
||||||
|
return (byte)instance.GetPropertyValue("CurrentBrightness");
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void Set(int brightness)
|
||||||
|
{
|
||||||
|
using var mclass = new ManagementClass("WmiMonitorBrightnessMethods")
|
||||||
|
{
|
||||||
|
Scope = new ManagementScope(@"\\.\root\wmi")
|
||||||
|
};
|
||||||
|
using var instances = mclass.GetInstances();
|
||||||
|
var args = new object[] { 1, brightness };
|
||||||
|
foreach (ManagementObject instance in instances)
|
||||||
|
{
|
||||||
|
instance.InvokeMethod("WmiSetBrightness", args);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int Adjust(int delta)
|
||||||
|
{
|
||||||
|
int brightness = Get();
|
||||||
|
Debug.WriteLine(brightness);
|
||||||
|
brightness = Math.Min(100, Math.Max(0, brightness + delta));
|
||||||
|
Set(brightness);
|
||||||
|
return brightness;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
414
app/Settings.cs
@@ -1,12 +1,7 @@
|
|||||||
using CustomControls;
|
using CustomControls;
|
||||||
using GHelper.AnimeMatrix;
|
using GHelper.AnimeMatrix;
|
||||||
using GHelper.Gpu;
|
using GHelper.Gpu;
|
||||||
using NAudio.CoreAudioApi;
|
|
||||||
using NAudio.Wave;
|
|
||||||
using Starlight.AnimeMatrix;
|
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Drawing.Drawing2D;
|
|
||||||
using System.Drawing.Imaging;
|
|
||||||
using System.Net;
|
using System.Net;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Text.Json;
|
using System.Text.Json;
|
||||||
@@ -22,6 +17,8 @@ namespace GHelper
|
|||||||
private ContextMenuStrip contextMenuStrip = new CustomContextMenu();
|
private ContextMenuStrip contextMenuStrip = new CustomContextMenu();
|
||||||
private ToolStripMenuItem menuSilent, menuBalanced, menuTurbo, menuEco, menuStandard, menuUltimate, menuOptimized;
|
private ToolStripMenuItem menuSilent, menuBalanced, menuTurbo, menuEco, menuStandard, menuUltimate, menuOptimized;
|
||||||
|
|
||||||
|
public ToastForm toast = new ToastForm();
|
||||||
|
|
||||||
public static System.Timers.Timer aTimer = default!;
|
public static System.Timers.Timer aTimer = default!;
|
||||||
public static Point trayPoint;
|
public static Point trayPoint;
|
||||||
|
|
||||||
@@ -30,7 +27,6 @@ namespace GHelper
|
|||||||
public string perfName = "Balanced";
|
public string perfName = "Balanced";
|
||||||
|
|
||||||
public AniMatrix matrix;
|
public AniMatrix matrix;
|
||||||
|
|
||||||
public Fans fans;
|
public Fans fans;
|
||||||
public Extra keyb;
|
public Extra keyb;
|
||||||
|
|
||||||
@@ -42,7 +38,6 @@ namespace GHelper
|
|||||||
public SettingsForm()
|
public SettingsForm()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
InitTheme(true);
|
InitTheme(true);
|
||||||
|
|
||||||
@@ -119,6 +114,9 @@ namespace GHelper
|
|||||||
buttonUltimate.MouseMove += ButtonUltimate_MouseHover;
|
buttonUltimate.MouseMove += ButtonUltimate_MouseHover;
|
||||||
buttonUltimate.MouseLeave += ButtonGPU_MouseLeave;
|
buttonUltimate.MouseLeave += ButtonGPU_MouseLeave;
|
||||||
|
|
||||||
|
tableGPU.MouseMove += ButtonXGM_MouseMove;
|
||||||
|
tableGPU.MouseLeave += ButtonGPU_MouseLeave;
|
||||||
|
|
||||||
buttonXGM.Click += ButtonXGM_Click;
|
buttonXGM.Click += ButtonXGM_Click;
|
||||||
|
|
||||||
buttonScreenAuto.MouseMove += ButtonScreenAuto_MouseHover;
|
buttonScreenAuto.MouseMove += ButtonScreenAuto_MouseHover;
|
||||||
@@ -139,13 +137,13 @@ namespace GHelper
|
|||||||
|
|
||||||
SetVersionLabel(Properties.Strings.VersionLabel + ": " + Assembly.GetExecutingAssembly().GetName().Version);
|
SetVersionLabel(Properties.Strings.VersionLabel + ": " + Assembly.GetExecutingAssembly().GetName().Version);
|
||||||
|
|
||||||
string model = Program.config.GetModel();
|
string model = AppConfig.GetModel();
|
||||||
int trim = model.LastIndexOf("_");
|
int trim = model.LastIndexOf("_");
|
||||||
if (trim > 0) model = model.Substring(0, trim);
|
if (trim > 0) model = model.Substring(0, trim);
|
||||||
|
|
||||||
labelModel.Text = model + (Program.IsUserAdministrator() ? "." : "");
|
labelModel.Text = model + (Program.IsUserAdministrator() ? "." : "");
|
||||||
|
|
||||||
TopMost = Program.config.getConfig("topmost") == 1;
|
TopMost = AppConfig.getConfig("topmost") == 1;
|
||||||
|
|
||||||
SetContextMenu();
|
SetContextMenu();
|
||||||
|
|
||||||
@@ -157,6 +155,11 @@ namespace GHelper
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void RunToast(string text, ToastIcon? icon = null)
|
||||||
|
{
|
||||||
|
toast.RunToast(text, icon);
|
||||||
|
}
|
||||||
|
|
||||||
public void SetContextMenu()
|
public void SetContextMenu()
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -265,15 +268,40 @@ namespace GHelper
|
|||||||
|
|
||||||
private void ButtonXGM_Click(object? sender, EventArgs e)
|
private void ButtonXGM_Click(object? sender, EventArgs e)
|
||||||
{
|
{
|
||||||
if (Program.wmi.DeviceGet(ASUSWmi.GPUXG) == 1)
|
|
||||||
|
Task.Run(async () =>
|
||||||
{
|
{
|
||||||
Program.wmi.DeviceSet(ASUSWmi.GPUXG, 0, "GPU XGM");
|
BeginInvoke(delegate
|
||||||
}
|
{
|
||||||
else
|
ButtonEnabled(buttonOptimized, false);
|
||||||
{
|
ButtonEnabled(buttonEco, false);
|
||||||
Program.wmi.DeviceSet(ASUSWmi.GPUXG, 1, "GPU XGM");
|
ButtonEnabled(buttonStandard, false);
|
||||||
}
|
ButtonEnabled(buttonUltimate, false);
|
||||||
InitXGM();
|
ButtonEnabled(buttonXGM, false);
|
||||||
|
});
|
||||||
|
|
||||||
|
if (Program.acpi.DeviceGet(AsusACPI.GPUXG) == 1)
|
||||||
|
{
|
||||||
|
Program.acpi.DeviceSet(AsusACPI.GPUXG, 0, "GPU XGM");
|
||||||
|
await Task.Delay(TimeSpan.FromSeconds(15));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Program.acpi.DeviceSet(AsusACPI.GPUXG, 1, "GPU XGM");
|
||||||
|
await Task.Delay(TimeSpan.FromSeconds(15));
|
||||||
|
|
||||||
|
if (AppConfig.getConfigPerf("auto_apply") == 1)
|
||||||
|
AsusUSB.SetXGMFan(AppConfig.getFanConfig(AsusFan.XGM));
|
||||||
|
}
|
||||||
|
|
||||||
|
BeginInvoke(delegate
|
||||||
|
{
|
||||||
|
InitGPUMode();
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SliderBattery_ValueChanged(object? sender, EventArgs e)
|
private void SliderBattery_ValueChanged(object? sender, EventArgs e)
|
||||||
@@ -303,13 +331,13 @@ namespace GHelper
|
|||||||
if (gitVersion.CompareTo(appVersion) > 0)
|
if (gitVersion.CompareTo(appVersion) > 0)
|
||||||
{
|
{
|
||||||
SetVersionLabel(Properties.Strings.DownloadUpdate + ": " + tag, url);
|
SetVersionLabel(Properties.Strings.DownloadUpdate + ": " + tag, url);
|
||||||
if (Program.config.getConfigString("skip_version") != tag)
|
if (AppConfig.getConfigString("skip_version") != tag)
|
||||||
{
|
{
|
||||||
DialogResult dialogResult = MessageBox.Show(Properties.Strings.DownloadUpdate + ": G-Helper " + tag + "?", "Update", MessageBoxButtons.YesNo);
|
DialogResult dialogResult = MessageBox.Show(Properties.Strings.DownloadUpdate + ": G-Helper " + tag + "?", "Update", MessageBoxButtons.YesNo);
|
||||||
if (dialogResult == DialogResult.Yes)
|
if (dialogResult == DialogResult.Yes)
|
||||||
AutoUpdate(url);
|
AutoUpdate(url);
|
||||||
else
|
else
|
||||||
Program.config.setConfig("skip_version", tag);
|
AppConfig.setConfig("skip_version", tag);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -435,17 +463,29 @@ namespace GHelper
|
|||||||
labelTipGPU.Text = "";
|
labelTipGPU.Text = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void ButtonXGM_MouseMove(object? sender, MouseEventArgs e)
|
||||||
|
{
|
||||||
|
if (sender is null) return;
|
||||||
|
TableLayoutPanel table = (TableLayoutPanel)sender;
|
||||||
|
|
||||||
|
if (!buttonXGM.Visible) return;
|
||||||
|
|
||||||
|
labelTipGPU.Text = buttonXGM.Bounds.Contains(table.PointToClient(Cursor.Position)) ?
|
||||||
|
"XGMobile toggle works only in Standard mode" : "";
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private void ButtonOptimized_Click(object? sender, EventArgs e)
|
private void ButtonOptimized_Click(object? sender, EventArgs e)
|
||||||
{
|
{
|
||||||
Program.config.setConfig("gpu_auto", (Program.config.getConfig("gpu_auto") == 1) ? 0 : 1);
|
AppConfig.setConfig("gpu_auto", (AppConfig.getConfig("gpu_auto") == 1) ? 0 : 1);
|
||||||
VisualiseGPUMode();
|
VisualiseGPUMode();
|
||||||
AutoGPUMode();
|
AutoGPUMode();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ButtonScreenAuto_Click(object? sender, EventArgs e)
|
private void ButtonScreenAuto_Click(object? sender, EventArgs e)
|
||||||
{
|
{
|
||||||
Program.config.setConfig("screen_auto", 1);
|
AppConfig.setConfig("screen_auto", 1);
|
||||||
InitScreen();
|
InitScreen();
|
||||||
AutoScreen();
|
AutoScreen();
|
||||||
}
|
}
|
||||||
@@ -463,7 +503,7 @@ namespace GHelper
|
|||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
Logger.WriteLine("Monitor Power Off");
|
Logger.WriteLine("Monitor Power Off");
|
||||||
SetBatteryChargeLimit(Program.config.getConfig("charge_limit"));
|
SetBatteryChargeLimit(AppConfig.getConfig("charge_limit"));
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
Logger.WriteLine("Monitor Power On");
|
Logger.WriteLine("Monitor Power On");
|
||||||
@@ -476,8 +516,24 @@ namespace GHelper
|
|||||||
}
|
}
|
||||||
m.Result = (IntPtr)1;
|
m.Result = (IntPtr)1;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case KeyHandler.WM_HOTKEY_MSG_ID:
|
case KeyHandler.WM_HOTKEY_MSG_ID:
|
||||||
CyclePerformanceMode();
|
|
||||||
|
Keys key = (Keys)(((int)m.LParam >> 16) & 0xFFFF);
|
||||||
|
|
||||||
|
switch (key)
|
||||||
|
{
|
||||||
|
case Keys.VolumeDown:
|
||||||
|
InputDispatcher.KeyProcess("m1");
|
||||||
|
break;
|
||||||
|
case Keys.VolumeUp:
|
||||||
|
InputDispatcher.KeyProcess("m2");
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
if (key == InputDispatcher.keyProfile) CyclePerformanceMode();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
base.WndProc(ref m);
|
base.WndProc(ref m);
|
||||||
@@ -506,7 +562,7 @@ namespace GHelper
|
|||||||
{
|
{
|
||||||
if (sender is null) return;
|
if (sender is null) return;
|
||||||
CheckBox check = (CheckBox)sender;
|
CheckBox check = (CheckBox)sender;
|
||||||
Program.config.setConfig("matrix_auto", check.Checked ? 1 : 0);
|
AppConfig.setConfig("matrix_auto", check.Checked ? 1 : 0);
|
||||||
matrix?.SetMatrix();
|
matrix?.SetMatrix();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -533,8 +589,8 @@ namespace GHelper
|
|||||||
|
|
||||||
if (fileName is not null)
|
if (fileName is not null)
|
||||||
{
|
{
|
||||||
Program.config.setConfig("matrix_picture", fileName);
|
AppConfig.setConfig("matrix_picture", fileName);
|
||||||
Program.config.setConfig("matrix_running", 2);
|
AppConfig.setConfig("matrix_running", 2);
|
||||||
|
|
||||||
matrix?.SetMatrixPicture(fileName);
|
matrix?.SetMatrixPicture(fileName);
|
||||||
BeginInvoke(delegate
|
BeginInvoke(delegate
|
||||||
@@ -548,21 +604,21 @@ namespace GHelper
|
|||||||
|
|
||||||
private void ComboMatrixRunning_SelectedValueChanged(object? sender, EventArgs e)
|
private void ComboMatrixRunning_SelectedValueChanged(object? sender, EventArgs e)
|
||||||
{
|
{
|
||||||
Program.config.setConfig("matrix_running", comboMatrixRunning.SelectedIndex);
|
AppConfig.setConfig("matrix_running", comboMatrixRunning.SelectedIndex);
|
||||||
matrix?.SetMatrix();
|
matrix?.SetMatrix();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void ComboMatrix_SelectedValueChanged(object? sender, EventArgs e)
|
private void ComboMatrix_SelectedValueChanged(object? sender, EventArgs e)
|
||||||
{
|
{
|
||||||
Program.config.setConfig("matrix_brightness", comboMatrix.SelectedIndex);
|
AppConfig.setConfig("matrix_brightness", comboMatrix.SelectedIndex);
|
||||||
matrix?.SetMatrix();
|
matrix?.SetMatrix();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void LabelCPUFan_Click(object? sender, EventArgs e)
|
private void LabelCPUFan_Click(object? sender, EventArgs e)
|
||||||
{
|
{
|
||||||
Program.config.setConfig("fan_rpm", (Program.config.getConfig("fan_rpm") == 1) ? 0 : 1);
|
AppConfig.setConfig("fan_rpm", (AppConfig.getConfig("fan_rpm") == 1) ? 0 : 1);
|
||||||
RefreshSensors(true);
|
RefreshSensors(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -575,7 +631,7 @@ namespace GHelper
|
|||||||
|
|
||||||
if (colorDlg.ShowDialog() == DialogResult.OK)
|
if (colorDlg.ShowDialog() == DialogResult.OK)
|
||||||
{
|
{
|
||||||
Program.config.setConfig("aura_color2", colorDlg.Color.ToArgb());
|
AppConfig.setConfig("aura_color2", colorDlg.Color.ToArgb());
|
||||||
SetAura();
|
SetAura();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -611,6 +667,7 @@ namespace GHelper
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
fans.FormPosition();
|
||||||
fans.Show();
|
fans.Show();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -630,28 +687,28 @@ namespace GHelper
|
|||||||
|
|
||||||
if (colorDlg.ShowDialog() == DialogResult.OK)
|
if (colorDlg.ShowDialog() == DialogResult.OK)
|
||||||
{
|
{
|
||||||
Program.config.setConfig("aura_color", colorDlg.Color.ToArgb());
|
AppConfig.setConfig("aura_color", colorDlg.Color.ToArgb());
|
||||||
SetAura();
|
SetAura();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void InitAura()
|
public void InitAura()
|
||||||
{
|
{
|
||||||
Aura.Mode = Program.config.getConfig("aura_mode");
|
AsusUSB.Mode = AppConfig.getConfig("aura_mode");
|
||||||
Aura.Speed = Program.config.getConfig("aura_speed");
|
AsusUSB.Speed = AppConfig.getConfig("aura_speed");
|
||||||
Aura.SetColor(Program.config.getConfig("aura_color"));
|
AsusUSB.SetColor(AppConfig.getConfig("aura_color"));
|
||||||
Aura.SetColor2(Program.config.getConfig("aura_color2"));
|
AsusUSB.SetColor2(AppConfig.getConfig("aura_color2"));
|
||||||
|
|
||||||
comboKeyboard.DropDownStyle = ComboBoxStyle.DropDownList;
|
comboKeyboard.DropDownStyle = ComboBoxStyle.DropDownList;
|
||||||
comboKeyboard.DataSource = new BindingSource(Aura.GetModes(), null);
|
comboKeyboard.DataSource = new BindingSource(AsusUSB.GetModes(), null);
|
||||||
comboKeyboard.DisplayMember = "Value";
|
comboKeyboard.DisplayMember = "Value";
|
||||||
comboKeyboard.ValueMember = "Key";
|
comboKeyboard.ValueMember = "Key";
|
||||||
comboKeyboard.SelectedValue = Aura.Mode;
|
comboKeyboard.SelectedValue = AsusUSB.Mode;
|
||||||
comboKeyboard.SelectedValueChanged += ComboKeyboard_SelectedValueChanged;
|
comboKeyboard.SelectedValueChanged += ComboKeyboard_SelectedValueChanged;
|
||||||
|
|
||||||
pictureColor.BackColor = Aura.Color1;
|
pictureColor.BackColor = AsusUSB.Color1;
|
||||||
pictureColor2.BackColor = Aura.Color2;
|
pictureColor2.BackColor = AsusUSB.Color2;
|
||||||
pictureColor2.Visible = Aura.HasSecondColor();
|
pictureColor2.Visible = AsusUSB.HasSecondColor();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void InitMatrix()
|
public void InitMatrix()
|
||||||
@@ -659,19 +716,19 @@ namespace GHelper
|
|||||||
|
|
||||||
matrix = new AniMatrix();
|
matrix = new AniMatrix();
|
||||||
|
|
||||||
if (matrix is null)
|
if (!AniMatrix.IsValid)
|
||||||
{
|
{
|
||||||
panelMatrix.Visible = false;
|
panelMatrix.Visible = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
int brightness = Program.config.getConfig("matrix_brightness");
|
int brightness = AppConfig.getConfig("matrix_brightness");
|
||||||
int running = Program.config.getConfig("matrix_running");
|
int running = AppConfig.getConfig("matrix_running");
|
||||||
|
|
||||||
comboMatrix.SelectedIndex = (brightness != -1) ? Math.Min(brightness, comboMatrix.Items.Count - 1) : 0;
|
comboMatrix.SelectedIndex = (brightness != -1) ? Math.Min(brightness, comboMatrix.Items.Count - 1) : 0;
|
||||||
comboMatrixRunning.SelectedIndex = (running != -1) ? Math.Min(running, comboMatrixRunning.Items.Count - 1) : 0;
|
comboMatrixRunning.SelectedIndex = (running != -1) ? Math.Min(running, comboMatrixRunning.Items.Count - 1) : 0;
|
||||||
|
|
||||||
checkMatrix.Checked = (Program.config.getConfig("matrix_auto") == 1);
|
checkMatrix.Checked = (AppConfig.getConfig("matrix_auto") == 1);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -679,16 +736,16 @@ namespace GHelper
|
|||||||
|
|
||||||
public void SetAura()
|
public void SetAura()
|
||||||
{
|
{
|
||||||
Aura.Mode = Program.config.getConfig("aura_mode");
|
AsusUSB.Mode = AppConfig.getConfig("aura_mode");
|
||||||
Aura.Speed = Program.config.getConfig("aura_speed");
|
AsusUSB.Speed = AppConfig.getConfig("aura_speed");
|
||||||
Aura.SetColor(Program.config.getConfig("aura_color"));
|
AsusUSB.SetColor(AppConfig.getConfig("aura_color"));
|
||||||
Aura.SetColor2(Program.config.getConfig("aura_color2"));
|
AsusUSB.SetColor2(AppConfig.getConfig("aura_color2"));
|
||||||
|
|
||||||
pictureColor.BackColor = Aura.Color1;
|
pictureColor.BackColor = AsusUSB.Color1;
|
||||||
pictureColor2.BackColor = Aura.Color2;
|
pictureColor2.BackColor = AsusUSB.Color2;
|
||||||
pictureColor2.Visible = Aura.HasSecondColor();
|
pictureColor2.Visible = AsusUSB.HasSecondColor();
|
||||||
|
|
||||||
Aura.ApplyAura();
|
AsusUSB.ApplyAura();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -702,27 +759,27 @@ namespace GHelper
|
|||||||
|
|
||||||
private void ComboKeyboard_SelectedValueChanged(object? sender, EventArgs e)
|
private void ComboKeyboard_SelectedValueChanged(object? sender, EventArgs e)
|
||||||
{
|
{
|
||||||
Program.config.setConfig("aura_mode", (int)comboKeyboard.SelectedValue);
|
AppConfig.setConfig("aura_mode", (int)comboKeyboard.SelectedValue);
|
||||||
SetAura();
|
SetAura();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void Button120Hz_Click(object? sender, EventArgs e)
|
private void Button120Hz_Click(object? sender, EventArgs e)
|
||||||
{
|
{
|
||||||
Program.config.setConfig("screen_auto", 0);
|
AppConfig.setConfig("screen_auto", 0);
|
||||||
SetScreen(1000, 1);
|
SetScreen(1000, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Button60Hz_Click(object? sender, EventArgs e)
|
private void Button60Hz_Click(object? sender, EventArgs e)
|
||||||
{
|
{
|
||||||
Program.config.setConfig("screen_auto", 0);
|
AppConfig.setConfig("screen_auto", 0);
|
||||||
SetScreen(60, 0);
|
SetScreen(60, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ToogleMiniled()
|
public void ToogleMiniled()
|
||||||
{
|
{
|
||||||
int miniled = (Program.config.getConfig("miniled") == 1) ? 0 : 1;
|
int miniled = (AppConfig.getConfig("miniled") == 1) ? 0 : 1;
|
||||||
Program.config.setConfig("miniled", miniled);
|
AppConfig.setConfig("miniled", miniled);
|
||||||
SetScreen(-1, -1, miniled);
|
SetScreen(-1, -1, miniled);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -752,14 +809,14 @@ namespace GHelper
|
|||||||
|
|
||||||
if (overdrive >= 0)
|
if (overdrive >= 0)
|
||||||
{
|
{
|
||||||
if (Program.config.getConfig("no_overdrive") == 1) overdrive = 0;
|
if (AppConfig.getConfig("no_overdrive") == 1) overdrive = 0;
|
||||||
Program.wmi.DeviceSet(ASUSWmi.ScreenOverdrive, overdrive, "ScreenOverdrive");
|
Program.acpi.DeviceSet(AsusACPI.ScreenOverdrive, overdrive, "ScreenOverdrive");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (miniled >= 0)
|
if (miniled >= 0)
|
||||||
{
|
{
|
||||||
Program.wmi.DeviceSet(ASUSWmi.ScreenMiniled, miniled, "Miniled");
|
Program.acpi.DeviceSet(AsusACPI.ScreenMiniled, miniled, "Miniled");
|
||||||
Debug.WriteLine("Miniled " + miniled);
|
Debug.WriteLine("Miniled " + miniled);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -772,11 +829,11 @@ namespace GHelper
|
|||||||
int frequency = NativeMethods.GetRefreshRate();
|
int frequency = NativeMethods.GetRefreshRate();
|
||||||
int maxFrequency = NativeMethods.GetRefreshRate(true);
|
int maxFrequency = NativeMethods.GetRefreshRate(true);
|
||||||
|
|
||||||
bool screenAuto = (Program.config.getConfig("screen_auto") == 1);
|
bool screenAuto = (AppConfig.getConfig("screen_auto") == 1);
|
||||||
bool overdriveSetting = (Program.config.getConfig("no_overdrive") != 1);
|
bool overdriveSetting = (AppConfig.getConfig("no_overdrive") != 1);
|
||||||
|
|
||||||
int overdrive = Program.wmi.DeviceGet(ASUSWmi.ScreenOverdrive);
|
int overdrive = Program.acpi.DeviceGet(AsusACPI.ScreenOverdrive);
|
||||||
int miniled = Program.wmi.DeviceGet(ASUSWmi.ScreenMiniled);
|
int miniled = Program.acpi.DeviceGet(AsusACPI.ScreenMiniled);
|
||||||
|
|
||||||
bool screenEnabled = (frequency >= 0);
|
bool screenEnabled = (frequency >= 0);
|
||||||
|
|
||||||
@@ -819,19 +876,20 @@ namespace GHelper
|
|||||||
if (miniled >= 0)
|
if (miniled >= 0)
|
||||||
{
|
{
|
||||||
buttonMiniled.Activated = (miniled == 1);
|
buttonMiniled.Activated = (miniled == 1);
|
||||||
Program.config.setConfig("miniled", miniled);
|
AppConfig.setConfig("miniled", miniled);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
buttonMiniled.Visible = false;
|
buttonMiniled.Visible = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
Program.config.setConfig("frequency", frequency);
|
AppConfig.setConfig("frequency", frequency);
|
||||||
Program.config.setConfig("overdrive", overdrive);
|
AppConfig.setConfig("overdrive", overdrive);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ButtonQuit_Click(object? sender, EventArgs e)
|
private void ButtonQuit_Click(object? sender, EventArgs e)
|
||||||
{
|
{
|
||||||
|
matrix.Dispose();
|
||||||
Close();
|
Close();
|
||||||
Program.trayIcon.Visible = false;
|
Program.trayIcon.Visible = false;
|
||||||
Application.Exit();
|
Application.Exit();
|
||||||
@@ -848,17 +906,17 @@ namespace GHelper
|
|||||||
|
|
||||||
private void ButtonUltimate_Click(object? sender, EventArgs e)
|
private void ButtonUltimate_Click(object? sender, EventArgs e)
|
||||||
{
|
{
|
||||||
SetGPUMode(ASUSWmi.GPUModeUltimate);
|
SetGPUMode(AsusACPI.GPUModeUltimate);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ButtonStandard_Click(object? sender, EventArgs e)
|
private void ButtonStandard_Click(object? sender, EventArgs e)
|
||||||
{
|
{
|
||||||
SetGPUMode(ASUSWmi.GPUModeStandard);
|
SetGPUMode(AsusACPI.GPUModeStandard);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ButtonEco_Click(object? sender, EventArgs e)
|
private void ButtonEco_Click(object? sender, EventArgs e)
|
||||||
{
|
{
|
||||||
SetGPUMode(ASUSWmi.GPUModeEco);
|
SetGPUMode(AsusACPI.GPUModeEco);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async void RefreshSensors(bool force = false)
|
public async void RefreshSensors(bool force = false)
|
||||||
@@ -932,25 +990,25 @@ namespace GHelper
|
|||||||
public void SetPower()
|
public void SetPower()
|
||||||
{
|
{
|
||||||
|
|
||||||
int limit_total = Program.config.getConfigPerf("limit_total");
|
int limit_total = AppConfig.getConfigPerf("limit_total");
|
||||||
int limit_cpu = Program.config.getConfigPerf("limit_cpu");
|
int limit_cpu = AppConfig.getConfigPerf("limit_cpu");
|
||||||
|
|
||||||
if (limit_total > ASUSWmi.MaxTotal) return;
|
if (limit_total > AsusACPI.MaxTotal) return;
|
||||||
if (limit_total < ASUSWmi.MinTotal) return;
|
if (limit_total < AsusACPI.MinTotal) return;
|
||||||
|
|
||||||
if (limit_cpu > ASUSWmi.MaxCPU) return;
|
if (limit_cpu > AsusACPI.MaxCPU) return;
|
||||||
if (limit_cpu < ASUSWmi.MinCPU) return;
|
if (limit_cpu < AsusACPI.MinCPU) return;
|
||||||
|
|
||||||
if (Program.wmi.DeviceGet(ASUSWmi.PPT_TotalA0) >= 0)
|
if (Program.acpi.DeviceGet(AsusACPI.PPT_TotalA0) >= 0)
|
||||||
{
|
{
|
||||||
Program.wmi.DeviceSet(ASUSWmi.PPT_TotalA0, limit_total, "PowerLimit A0");
|
Program.acpi.DeviceSet(AsusACPI.PPT_TotalA0, limit_total, "PowerLimit A0");
|
||||||
Program.wmi.DeviceSet(ASUSWmi.PPT_APUA3, limit_total, "PowerLimit A3");
|
Program.acpi.DeviceSet(AsusACPI.PPT_APUA3, limit_total, "PowerLimit A3");
|
||||||
customPower = limit_total;
|
customPower = limit_total;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Program.wmi.DeviceGet(ASUSWmi.PPT_CPUB0) >= 0)
|
if (Program.acpi.DeviceGet(AsusACPI.PPT_CPUB0) >= 0)
|
||||||
{
|
{
|
||||||
Program.wmi.DeviceSet(ASUSWmi.PPT_CPUB0, limit_cpu, "PowerLimit B0");
|
Program.acpi.DeviceSet(AsusACPI.PPT_CPUB0, limit_cpu, "PowerLimit B0");
|
||||||
customPower = limit_cpu;
|
customPower = limit_cpu;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -962,14 +1020,14 @@ namespace GHelper
|
|||||||
public void SetGPUClocks(bool launchAsAdmin = true)
|
public void SetGPUClocks(bool launchAsAdmin = true)
|
||||||
{
|
{
|
||||||
|
|
||||||
int gpu_core = Program.config.getConfigPerf("gpu_core");
|
int gpu_core = AppConfig.getConfigPerf("gpu_core");
|
||||||
int gpu_memory = Program.config.getConfigPerf("gpu_memory");
|
int gpu_memory = AppConfig.getConfigPerf("gpu_memory");
|
||||||
|
|
||||||
if (gpu_core == -1 && gpu_memory == -1) return;
|
if (gpu_core == -1 && gpu_memory == -1) return;
|
||||||
|
|
||||||
//if ((gpu_core > -5 && gpu_core < 5) && (gpu_memory > -5 && gpu_memory < 5)) launchAsAdmin = false;
|
//if ((gpu_core > -5 && gpu_core < 5) && (gpu_memory > -5 && gpu_memory < 5)) launchAsAdmin = false;
|
||||||
|
|
||||||
if (Program.wmi.DeviceGet(ASUSWmi.GPUEco) == 1) return;
|
if (Program.acpi.DeviceGet(AsusACPI.GPUEco) == 1) return;
|
||||||
if (HardwareControl.GpuControl is null) return;
|
if (HardwareControl.GpuControl is null) return;
|
||||||
if (!HardwareControl.GpuControl!.IsNvidia) return;
|
if (!HardwareControl.GpuControl!.IsNvidia) return;
|
||||||
|
|
||||||
@@ -995,21 +1053,21 @@ namespace GHelper
|
|||||||
public void SetGPUPower()
|
public void SetGPUPower()
|
||||||
{
|
{
|
||||||
|
|
||||||
int gpu_boost = Program.config.getConfigPerf("gpu_boost");
|
int gpu_boost = AppConfig.getConfigPerf("gpu_boost");
|
||||||
int gpu_temp = Program.config.getConfigPerf("gpu_temp");
|
int gpu_temp = AppConfig.getConfigPerf("gpu_temp");
|
||||||
|
|
||||||
|
|
||||||
if (gpu_boost < ASUSWmi.MinGPUBoost || gpu_boost > ASUSWmi.MaxGPUBoost) return;
|
if (gpu_boost < AsusACPI.MinGPUBoost || gpu_boost > AsusACPI.MaxGPUBoost) return;
|
||||||
if (gpu_temp < ASUSWmi.MinGPUTemp || gpu_temp > ASUSWmi.MaxGPUTemp) return;
|
if (gpu_temp < AsusACPI.MinGPUTemp || gpu_temp > AsusACPI.MaxGPUTemp) return;
|
||||||
|
|
||||||
if (Program.wmi.DeviceGet(ASUSWmi.PPT_GPUC0) >= 0)
|
if (Program.acpi.DeviceGet(AsusACPI.PPT_GPUC0) >= 0)
|
||||||
{
|
{
|
||||||
Program.wmi.DeviceSet(ASUSWmi.PPT_GPUC0, gpu_boost, "PowerLimit C0");
|
Program.acpi.DeviceSet(AsusACPI.PPT_GPUC0, gpu_boost, "PowerLimit C0");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Program.wmi.DeviceGet(ASUSWmi.PPT_GPUC2) >= 0)
|
if (Program.acpi.DeviceGet(AsusACPI.PPT_GPUC2) >= 0)
|
||||||
{
|
{
|
||||||
Program.wmi.DeviceSet(ASUSWmi.PPT_GPUC2, gpu_temp, "PowerLimit C2");
|
Program.acpi.DeviceSet(AsusACPI.PPT_GPUC2, gpu_temp, "PowerLimit C2");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1025,20 +1083,23 @@ namespace GHelper
|
|||||||
{
|
{
|
||||||
customFans = false;
|
customFans = false;
|
||||||
|
|
||||||
if (Program.config.getConfigPerf("auto_apply") == 1 || force)
|
if (AppConfig.getConfigPerf("auto_apply") == 1 || force)
|
||||||
{
|
{
|
||||||
int cpuResult = Program.wmi.SetFanCurve(0, Program.config.getFanConfig(0));
|
int cpuResult = Program.acpi.SetFanCurve(AsusFan.CPU, AppConfig.getFanConfig(AsusFan.CPU));
|
||||||
int gpuResult = Program.wmi.SetFanCurve(1, Program.config.getFanConfig(1));
|
int gpuResult = Program.acpi.SetFanCurve(AsusFan.GPU, AppConfig.getFanConfig(AsusFan.GPU));
|
||||||
|
|
||||||
if (Program.config.getConfig("mid_fan") == 1)
|
if (AppConfig.isConfig("mid_fan"))
|
||||||
Program.wmi.SetFanCurve(2, Program.config.getFanConfig(2));
|
Program.acpi.SetFanCurve(AsusFan.Mid, AppConfig.getFanConfig(AsusFan.Mid));
|
||||||
|
|
||||||
|
if (AppConfig.isConfig("xgm_fan") && Program.acpi.IsXGConnected())
|
||||||
|
AsusUSB.SetXGMFan(AppConfig.getFanConfig(AsusFan.XGM));
|
||||||
|
|
||||||
// something went wrong, resetting to default profile
|
// something went wrong, resetting to default profile
|
||||||
if (cpuResult != 1 || gpuResult != 1)
|
if (cpuResult != 1 || gpuResult != 1)
|
||||||
{
|
{
|
||||||
int mode = Program.config.getConfig("performance_mode");
|
int mode = AppConfig.getConfig("performance_mode");
|
||||||
Logger.WriteLine("ASUS BIOS rejected fan curve, resetting mode to " + mode);
|
Logger.WriteLine("ASUS BIOS rejected fan curve, resetting mode to " + mode);
|
||||||
Program.wmi.DeviceSet(ASUSWmi.PerformanceMode, mode, "PerformanceMode");
|
Program.acpi.DeviceSet(AsusACPI.PerformanceMode, mode, "PerformanceMode");
|
||||||
LabelFansResult("ASUS BIOS rejected fan curve");
|
LabelFansResult("ASUS BIOS rejected fan curve");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -1048,13 +1109,13 @@ namespace GHelper
|
|||||||
}
|
}
|
||||||
|
|
||||||
// fix for misbehaving bios on intell based TUF 2022
|
// fix for misbehaving bios on intell based TUF 2022
|
||||||
if ((Program.config.ContainsModel("FX507") || Program.config.ContainsModel("FX517")) && Program.config.getConfigPerf("auto_apply_power") != 1)
|
if ((AppConfig.ContainsModel("FX507") || AppConfig.ContainsModel("FX517")) && AppConfig.getConfigPerf("auto_apply_power") != 1)
|
||||||
{
|
{
|
||||||
Task.Run(async () =>
|
Task.Run(async () =>
|
||||||
{
|
{
|
||||||
await Task.Delay(TimeSpan.FromSeconds(1));
|
await Task.Delay(TimeSpan.FromSeconds(1));
|
||||||
Program.wmi.DeviceSet(ASUSWmi.PPT_TotalA0, 80, "PowerLimit Fix A0");
|
Program.acpi.DeviceSet(AsusACPI.PPT_TotalA0, 80, "PowerLimit Fix A0");
|
||||||
Program.wmi.DeviceSet(ASUSWmi.PPT_APUA3, 80, "PowerLimit Fix A3");
|
Program.acpi.DeviceSet(AsusACPI.PPT_APUA3, 80, "PowerLimit Fix A3");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1068,7 +1129,7 @@ namespace GHelper
|
|||||||
{
|
{
|
||||||
|
|
||||||
// fix for misbehaving bios PPTs on G513
|
// fix for misbehaving bios PPTs on G513
|
||||||
if (Program.config.ContainsModel("G513") && Program.config.getConfigPerf("auto_apply") != 1)
|
if (AppConfig.ContainsModel("G513") && AppConfig.getConfigPerf("auto_apply") != 1)
|
||||||
{
|
{
|
||||||
AutoFans(true);
|
AutoFans(true);
|
||||||
delay = 500;
|
delay = 500;
|
||||||
@@ -1076,7 +1137,7 @@ namespace GHelper
|
|||||||
|
|
||||||
customPower = 0;
|
customPower = 0;
|
||||||
|
|
||||||
bool applyPower = Program.config.getConfigPerf("auto_apply_power") == 1;
|
bool applyPower = AppConfig.getConfigPerf("auto_apply_power") == 1;
|
||||||
bool applyGPU = true;
|
bool applyGPU = true;
|
||||||
|
|
||||||
if (delay > 0)
|
if (delay > 0)
|
||||||
@@ -1104,7 +1165,7 @@ namespace GHelper
|
|||||||
{
|
{
|
||||||
|
|
||||||
if (PerformanceMode < 0)
|
if (PerformanceMode < 0)
|
||||||
PerformanceMode = Program.config.getConfig("performance_mode");
|
PerformanceMode = AppConfig.getConfig("performance_mode");
|
||||||
|
|
||||||
buttonSilent.Activated = false;
|
buttonSilent.Activated = false;
|
||||||
buttonBalanced.Activated = false;
|
buttonBalanced.Activated = false;
|
||||||
@@ -1112,17 +1173,17 @@ namespace GHelper
|
|||||||
|
|
||||||
switch (PerformanceMode)
|
switch (PerformanceMode)
|
||||||
{
|
{
|
||||||
case ASUSWmi.PerformanceSilent:
|
case AsusACPI.PerformanceSilent:
|
||||||
buttonSilent.Activated = true;
|
buttonSilent.Activated = true;
|
||||||
perfName = Properties.Strings.Silent;
|
perfName = Properties.Strings.Silent;
|
||||||
break;
|
break;
|
||||||
case ASUSWmi.PerformanceTurbo:
|
case AsusACPI.PerformanceTurbo:
|
||||||
buttonTurbo.Activated = true;
|
buttonTurbo.Activated = true;
|
||||||
perfName = Properties.Strings.Turbo;
|
perfName = Properties.Strings.Turbo;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
buttonBalanced.Activated = true;
|
buttonBalanced.Activated = true;
|
||||||
PerformanceMode = ASUSWmi.PerformanceBalanced;
|
PerformanceMode = AsusACPI.PerformanceBalanced;
|
||||||
perfName = Properties.Strings.Balanced;
|
perfName = Properties.Strings.Balanced;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -1131,17 +1192,18 @@ namespace GHelper
|
|||||||
menuBalanced.Checked = buttonBalanced.Activated;
|
menuBalanced.Checked = buttonBalanced.Activated;
|
||||||
menuTurbo.Checked = buttonTurbo.Activated;
|
menuTurbo.Checked = buttonTurbo.Activated;
|
||||||
|
|
||||||
int oldMode = Program.config.getConfig("performance_mode");
|
int oldMode = AppConfig.getConfig("performance_mode");
|
||||||
Program.config.setConfig("performance_" + (int)SystemInformation.PowerStatus.PowerLineStatus, PerformanceMode);
|
AppConfig.setConfig("performance_" + (int)SystemInformation.PowerStatus.PowerLineStatus, PerformanceMode);
|
||||||
Program.config.setConfig("performance_mode", PerformanceMode);
|
AppConfig.setConfig("performance_mode", PerformanceMode);
|
||||||
|
|
||||||
Program.wmi.DeviceSet(ASUSWmi.PerformanceMode, PerformanceMode, "PerformanceMode");
|
Program.acpi.DeviceSet(AsusACPI.PerformanceMode, PerformanceMode, "PerformanceMode");
|
||||||
|
if (AppConfig.isConfig("xgm_fan") && Program.acpi.IsXGConnected()) AsusUSB.ResetXGM();
|
||||||
|
|
||||||
if (notify && (oldMode != PerformanceMode))
|
if (notify && (oldMode != PerformanceMode))
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Program.toast.RunToast(perfName);
|
toast.RunToast(perfName);
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
@@ -1154,17 +1216,17 @@ namespace GHelper
|
|||||||
AutoFans();
|
AutoFans();
|
||||||
AutoPower(1000);
|
AutoPower(1000);
|
||||||
|
|
||||||
if (Program.config.getConfig("auto_apply_power_plan") != 0)
|
if (AppConfig.getConfig("auto_apply_power_plan") != 0)
|
||||||
{
|
{
|
||||||
if (Program.config.getConfigPerfString("scheme") is not null)
|
if (AppConfig.getConfigPerfString("scheme") is not null)
|
||||||
NativeMethods.SetPowerScheme(Program.config.getConfigPerfString("scheme"));
|
NativeMethods.SetPowerScheme(AppConfig.getConfigPerfString("scheme"));
|
||||||
else
|
else
|
||||||
NativeMethods.SetPowerScheme(PerformanceMode);
|
NativeMethods.SetPowerScheme(PerformanceMode);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Program.config.getConfigPerf("auto_boost") != -1)
|
if (AppConfig.getConfigPerf("auto_boost") != -1)
|
||||||
{
|
{
|
||||||
NativeMethods.SetCPUBoost(Program.config.getConfigPerf("auto_boost"));
|
NativeMethods.SetCPUBoost(AppConfig.getConfigPerf("auto_boost"));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (NativeMethods.PowerGetEffectiveOverlayScheme(out Guid activeScheme) == 0)
|
if (NativeMethods.PowerGetEffectiveOverlayScheme(out Guid activeScheme) == 0)
|
||||||
@@ -1184,7 +1246,7 @@ namespace GHelper
|
|||||||
|
|
||||||
public void CyclePerformanceMode()
|
public void CyclePerformanceMode()
|
||||||
{
|
{
|
||||||
int mode = Program.config.getConfig("performance_mode");
|
int mode = AppConfig.getConfig("performance_mode");
|
||||||
|
|
||||||
if (Control.ModifierKeys == Keys.Shift)
|
if (Control.ModifierKeys == Keys.Shift)
|
||||||
mode = (mode == 0) ? 2 : mode - 1;
|
mode = (mode == 0) ? 2 : mode - 1;
|
||||||
@@ -1197,12 +1259,14 @@ namespace GHelper
|
|||||||
|
|
||||||
public void AutoKeyboard()
|
public void AutoKeyboard()
|
||||||
{
|
{
|
||||||
if (Program.config.getConfig("keyboard_auto") != 1) return;
|
AsusUSB.Init();
|
||||||
|
|
||||||
|
if (AppConfig.getConfig("keyboard_auto") != 1) return;
|
||||||
|
|
||||||
if (SystemInformation.PowerStatus.PowerLineStatus == PowerLineStatus.Online)
|
if (SystemInformation.PowerStatus.PowerLineStatus == PowerLineStatus.Online)
|
||||||
Aura.ApplyBrightness(3);
|
AsusUSB.ApplyBrightness(3);
|
||||||
else
|
else
|
||||||
Aura.ApplyBrightness(0);
|
AsusUSB.ApplyBrightness(0);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1211,17 +1275,17 @@ namespace GHelper
|
|||||||
{
|
{
|
||||||
var Plugged = SystemInformation.PowerStatus.PowerLineStatus;
|
var Plugged = SystemInformation.PowerStatus.PowerLineStatus;
|
||||||
|
|
||||||
int mode = Program.config.getConfig("performance_" + (int)Plugged);
|
int mode = AppConfig.getConfig("performance_" + (int)Plugged);
|
||||||
if (mode != -1)
|
if (mode != -1)
|
||||||
SetPerformanceMode(mode, true);
|
SetPerformanceMode(mode, true);
|
||||||
else
|
else
|
||||||
SetPerformanceMode(Program.config.getConfig("performance_mode"));
|
SetPerformanceMode(AppConfig.getConfig("performance_mode"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void AutoScreen(bool force = false)
|
public void AutoScreen(bool force = false)
|
||||||
{
|
{
|
||||||
if (force || Program.config.getConfig("screen_auto") == 1)
|
if (force || AppConfig.getConfig("screen_auto") == 1)
|
||||||
{
|
{
|
||||||
if (SystemInformation.PowerStatus.PowerLineStatus == PowerLineStatus.Online)
|
if (SystemInformation.PowerStatus.PowerLineStatus == PowerLineStatus.Online)
|
||||||
SetScreen(1000, 1);
|
SetScreen(1000, 1);
|
||||||
@@ -1230,7 +1294,7 @@ namespace GHelper
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
SetScreen(overdrive: Program.config.getConfig("overdrive"));
|
SetScreen(overdrive: AppConfig.getConfig("overdrive"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1239,25 +1303,25 @@ namespace GHelper
|
|||||||
|
|
||||||
public static bool IsPlugged()
|
public static bool IsPlugged()
|
||||||
{
|
{
|
||||||
bool optimizedUSBC = Program.config.getConfig("optimized_usbc") != 1;
|
bool optimizedUSBC = AppConfig.getConfig("optimized_usbc") != 1;
|
||||||
|
|
||||||
return SystemInformation.PowerStatus.PowerLineStatus == PowerLineStatus.Online &&
|
return SystemInformation.PowerStatus.PowerLineStatus == PowerLineStatus.Online &&
|
||||||
(optimizedUSBC || Program.wmi.DeviceGet(ASUSWmi.ChargerMode) != ASUSWmi.ChargerUSB);
|
(optimizedUSBC || Program.acpi.DeviceGet(AsusACPI.ChargerMode) != AsusACPI.ChargerUSB);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool AutoGPUMode()
|
public bool AutoGPUMode()
|
||||||
{
|
{
|
||||||
|
|
||||||
bool GpuAuto = Program.config.getConfig("gpu_auto") == 1;
|
bool GpuAuto = AppConfig.getConfig("gpu_auto") == 1;
|
||||||
bool ForceGPU = Program.config.ContainsModel("503");
|
bool ForceGPU = AppConfig.ContainsModel("503");
|
||||||
|
|
||||||
int GpuMode = Program.config.getConfig("gpu_mode");
|
int GpuMode = AppConfig.getConfig("gpu_mode");
|
||||||
|
|
||||||
if (!GpuAuto && !ForceGPU) return false;
|
if (!GpuAuto && !ForceGPU) return false;
|
||||||
|
|
||||||
int eco = Program.wmi.DeviceGet(ASUSWmi.GPUEco);
|
int eco = Program.acpi.DeviceGet(AsusACPI.GPUEco);
|
||||||
int mux = Program.wmi.DeviceGet(ASUSWmi.GPUMux);
|
int mux = Program.acpi.DeviceGet(AsusACPI.GPUMux);
|
||||||
|
|
||||||
if (mux == 0) // GPU in Ultimate, ignore
|
if (mux == 0) // GPU in Ultimate, ignore
|
||||||
return false;
|
return false;
|
||||||
@@ -1267,13 +1331,13 @@ namespace GHelper
|
|||||||
if (ReEnableGPU()) return true;
|
if (ReEnableGPU()) return true;
|
||||||
|
|
||||||
if (eco == 1)
|
if (eco == 1)
|
||||||
if ((GpuAuto && IsPlugged()) || (ForceGPU && GpuMode == ASUSWmi.GPUModeStandard))
|
if ((GpuAuto && IsPlugged()) || (ForceGPU && GpuMode == AsusACPI.GPUModeStandard))
|
||||||
{
|
{
|
||||||
SetGPUEco(0);
|
SetGPUEco(0);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (eco == 0)
|
if (eco == 0)
|
||||||
if ((GpuAuto && !IsPlugged()) || (ForceGPU && GpuMode == ASUSWmi.GPUModeEco))
|
if ((GpuAuto && !IsPlugged()) || (ForceGPU && GpuMode == AsusACPI.GPUModeEco))
|
||||||
{
|
{
|
||||||
|
|
||||||
if (HardwareControl.IsUsedGPU())
|
if (HardwareControl.IsUsedGPU())
|
||||||
@@ -1294,7 +1358,7 @@ namespace GHelper
|
|||||||
public bool ReEnableGPU()
|
public bool ReEnableGPU()
|
||||||
{
|
{
|
||||||
|
|
||||||
if (Program.config.getConfig("gpu_reenable") != 1) return false;
|
if (AppConfig.getConfig("gpu_reenable") != 1) return false;
|
||||||
if (Screen.AllScreens.Length <= 1) return false;
|
if (Screen.AllScreens.Length <= 1) return false;
|
||||||
|
|
||||||
Logger.WriteLine("Re-enabling gpu for 503 model");
|
Logger.WriteLine("Re-enabling gpu for 503 model");
|
||||||
@@ -1322,11 +1386,28 @@ namespace GHelper
|
|||||||
|
|
||||||
public void InitXGM()
|
public void InitXGM()
|
||||||
{
|
{
|
||||||
int connected = Program.wmi.DeviceGet(ASUSWmi.GPUXGConnected);
|
|
||||||
int enabled = Program.wmi.DeviceGet(ASUSWmi.GPUXG);
|
|
||||||
|
|
||||||
buttonXGM.Enabled = buttonXGM.Visible = (connected == 1);
|
buttonXGM.Enabled = buttonXGM.Visible = Program.acpi.IsXGConnected();
|
||||||
buttonXGM.Activated = (enabled == 1);
|
|
||||||
|
int activated = Program.acpi.DeviceGet(AsusACPI.GPUXG);
|
||||||
|
if (activated < 0) return;
|
||||||
|
|
||||||
|
buttonXGM.Activated = (activated == 1);
|
||||||
|
|
||||||
|
if (buttonXGM.Activated)
|
||||||
|
{
|
||||||
|
ButtonEnabled(buttonOptimized, false);
|
||||||
|
ButtonEnabled(buttonEco, false);
|
||||||
|
ButtonEnabled(buttonStandard, false);
|
||||||
|
ButtonEnabled(buttonUltimate, false);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ButtonEnabled(buttonOptimized, true);
|
||||||
|
ButtonEnabled(buttonEco, true);
|
||||||
|
ButtonEnabled(buttonStandard, true);
|
||||||
|
ButtonEnabled(buttonUltimate, true);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1334,8 +1415,8 @@ namespace GHelper
|
|||||||
public int InitGPUMode()
|
public int InitGPUMode()
|
||||||
{
|
{
|
||||||
|
|
||||||
int eco = Program.wmi.DeviceGet(ASUSWmi.GPUEco);
|
int eco = Program.acpi.DeviceGet(AsusACPI.GPUEco);
|
||||||
int mux = Program.wmi.DeviceGet(ASUSWmi.GPUMux);
|
int mux = Program.acpi.DeviceGet(AsusACPI.GPUMux);
|
||||||
|
|
||||||
Logger.WriteLine("Eco flag : " + eco);
|
Logger.WriteLine("Eco flag : " + eco);
|
||||||
Logger.WriteLine("Mux flag : " + mux);
|
Logger.WriteLine("Mux flag : " + mux);
|
||||||
@@ -1343,19 +1424,19 @@ namespace GHelper
|
|||||||
int GpuMode;
|
int GpuMode;
|
||||||
|
|
||||||
if (mux == 0)
|
if (mux == 0)
|
||||||
GpuMode = ASUSWmi.GPUModeUltimate;
|
GpuMode = AsusACPI.GPUModeUltimate;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (eco == 1)
|
if (eco == 1)
|
||||||
GpuMode = ASUSWmi.GPUModeEco;
|
GpuMode = AsusACPI.GPUModeEco;
|
||||||
else
|
else
|
||||||
GpuMode = ASUSWmi.GPUModeStandard;
|
GpuMode = AsusACPI.GPUModeStandard;
|
||||||
|
|
||||||
UltimateUI(mux == 1);
|
UltimateUI(mux == 1);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Program.config.setConfig("gpu_mode", GpuMode);
|
AppConfig.setConfig("gpu_mode", GpuMode);
|
||||||
|
|
||||||
ButtonEnabled(buttonOptimized, true);
|
ButtonEnabled(buttonOptimized, true);
|
||||||
ButtonEnabled(buttonEco, true);
|
ButtonEnabled(buttonEco, true);
|
||||||
@@ -1417,6 +1498,7 @@ namespace GHelper
|
|||||||
ButtonEnabled(buttonEco, false);
|
ButtonEnabled(buttonEco, false);
|
||||||
ButtonEnabled(buttonStandard, false);
|
ButtonEnabled(buttonStandard, false);
|
||||||
ButtonEnabled(buttonUltimate, false);
|
ButtonEnabled(buttonUltimate, false);
|
||||||
|
ButtonEnabled(buttonXGM, false);
|
||||||
|
|
||||||
labelGPU.Text = Properties.Strings.GPUMode + ": " + Properties.Strings.GPUChanging + " ...";
|
labelGPU.Text = Properties.Strings.GPUMode + ": " + Properties.Strings.GPUChanging + " ...";
|
||||||
|
|
||||||
@@ -1433,7 +1515,7 @@ namespace GHelper
|
|||||||
}
|
}
|
||||||
|
|
||||||
//if (eco == 1) status = 0; else
|
//if (eco == 1) status = 0; else
|
||||||
status = Program.wmi.SetGPUEco(eco);
|
status = Program.acpi.SetGPUEco(eco);
|
||||||
|
|
||||||
if (status == 0 && eco == 1 && hardWay)
|
if (status == 0 && eco == 1 && hardWay)
|
||||||
{
|
{
|
||||||
@@ -1462,8 +1544,8 @@ namespace GHelper
|
|||||||
public void SetGPUMode(int GPUMode)
|
public void SetGPUMode(int GPUMode)
|
||||||
{
|
{
|
||||||
|
|
||||||
int CurrentGPU = Program.config.getConfig("gpu_mode");
|
int CurrentGPU = AppConfig.getConfig("gpu_mode");
|
||||||
Program.config.setConfig("gpu_auto", 0);
|
AppConfig.setConfig("gpu_auto", 0);
|
||||||
|
|
||||||
if (CurrentGPU == GPUMode)
|
if (CurrentGPU == GPUMode)
|
||||||
{
|
{
|
||||||
@@ -1474,34 +1556,34 @@ namespace GHelper
|
|||||||
var restart = false;
|
var restart = false;
|
||||||
var changed = false;
|
var changed = false;
|
||||||
|
|
||||||
if (CurrentGPU == ASUSWmi.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.wmi.DeviceSet(ASUSWmi.GPUMux, 1, "GPUMux");
|
Program.acpi.DeviceSet(AsusACPI.GPUMux, 1, "GPUMux");
|
||||||
restart = true;
|
restart = true;
|
||||||
changed = true;
|
changed = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (GPUMode == ASUSWmi.GPUModeUltimate)
|
else if (GPUMode == AsusACPI.GPUModeUltimate)
|
||||||
{
|
{
|
||||||
DialogResult dialogResult = MessageBox.Show(Properties.Strings.AlertUltimateOn, Properties.Strings.AlertUltimateTitle, MessageBoxButtons.YesNo);
|
DialogResult dialogResult = MessageBox.Show(Properties.Strings.AlertUltimateOn, Properties.Strings.AlertUltimateTitle, MessageBoxButtons.YesNo);
|
||||||
if (dialogResult == DialogResult.Yes)
|
if (dialogResult == DialogResult.Yes)
|
||||||
{
|
{
|
||||||
Program.wmi.DeviceSet(ASUSWmi.GPUMux, 0, "GPUMux");
|
Program.acpi.DeviceSet(AsusACPI.GPUMux, 0, "GPUMux");
|
||||||
restart = true;
|
restart = true;
|
||||||
changed = true;
|
changed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else if (GPUMode == ASUSWmi.GPUModeEco)
|
else if (GPUMode == AsusACPI.GPUModeEco)
|
||||||
{
|
{
|
||||||
VisualiseGPUMode(GPUMode);
|
VisualiseGPUMode(GPUMode);
|
||||||
SetGPUEco(1, true);
|
SetGPUEco(1, true);
|
||||||
changed = true;
|
changed = true;
|
||||||
}
|
}
|
||||||
else if (GPUMode == ASUSWmi.GPUModeStandard)
|
else if (GPUMode == AsusACPI.GPUModeStandard)
|
||||||
{
|
{
|
||||||
VisualiseGPUMode(GPUMode);
|
VisualiseGPUMode(GPUMode);
|
||||||
SetGPUEco(0);
|
SetGPUEco(0);
|
||||||
@@ -1510,7 +1592,7 @@ namespace GHelper
|
|||||||
|
|
||||||
if (changed)
|
if (changed)
|
||||||
{
|
{
|
||||||
Program.config.setConfig("gpu_mode", GPUMode);
|
AppConfig.setConfig("gpu_mode", GPUMode);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (restart)
|
if (restart)
|
||||||
@@ -1526,9 +1608,9 @@ namespace GHelper
|
|||||||
{
|
{
|
||||||
|
|
||||||
if (GPUMode == -1)
|
if (GPUMode == -1)
|
||||||
GPUMode = Program.config.getConfig("gpu_mode");
|
GPUMode = AppConfig.getConfig("gpu_mode");
|
||||||
|
|
||||||
bool GPUAuto = (Program.config.getConfig("gpu_auto") == 1);
|
bool GPUAuto = (AppConfig.getConfig("gpu_auto") == 1);
|
||||||
|
|
||||||
buttonEco.Activated = false;
|
buttonEco.Activated = false;
|
||||||
buttonStandard.Activated = false;
|
buttonStandard.Activated = false;
|
||||||
@@ -1537,14 +1619,15 @@ namespace GHelper
|
|||||||
|
|
||||||
switch (GPUMode)
|
switch (GPUMode)
|
||||||
{
|
{
|
||||||
case ASUSWmi.GPUModeEco:
|
case AsusACPI.GPUModeEco:
|
||||||
buttonOptimized.BorderColor = colorEco;
|
buttonOptimized.BorderColor = colorEco;
|
||||||
buttonEco.Activated = !GPUAuto;
|
buttonEco.Activated = !GPUAuto;
|
||||||
buttonOptimized.Activated = GPUAuto;
|
buttonOptimized.Activated = GPUAuto;
|
||||||
labelGPU.Text = Properties.Strings.GPUMode + ": " + Properties.Strings.GPUModeEco;
|
labelGPU.Text = Properties.Strings.GPUMode + ": " + Properties.Strings.GPUModeEco;
|
||||||
Program.trayIcon.Icon = Properties.Resources.eco;
|
Program.trayIcon.Icon = Properties.Resources.eco;
|
||||||
|
ButtonEnabled(buttonXGM, false);
|
||||||
break;
|
break;
|
||||||
case ASUSWmi.GPUModeUltimate:
|
case AsusACPI.GPUModeUltimate:
|
||||||
buttonUltimate.Activated = true;
|
buttonUltimate.Activated = true;
|
||||||
labelGPU.Text = Properties.Strings.GPUMode + ": " + Properties.Strings.GPUModeUltimate;
|
labelGPU.Text = Properties.Strings.GPUMode + ": " + Properties.Strings.GPUModeUltimate;
|
||||||
Program.trayIcon.Icon = Properties.Resources.ultimate;
|
Program.trayIcon.Icon = Properties.Resources.ultimate;
|
||||||
@@ -1555,6 +1638,7 @@ namespace GHelper
|
|||||||
buttonOptimized.Activated = GPUAuto;
|
buttonOptimized.Activated = GPUAuto;
|
||||||
labelGPU.Text = Properties.Strings.GPUMode + ": " + Properties.Strings.GPUModeStandard;
|
labelGPU.Text = Properties.Strings.GPUMode + ": " + Properties.Strings.GPUModeStandard;
|
||||||
Program.trayIcon.Icon = Properties.Resources.standard;
|
Program.trayIcon.Icon = Properties.Resources.standard;
|
||||||
|
ButtonEnabled(buttonXGM, true);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1568,17 +1652,17 @@ namespace GHelper
|
|||||||
|
|
||||||
private void ButtonSilent_Click(object? sender, EventArgs e)
|
private void ButtonSilent_Click(object? sender, EventArgs e)
|
||||||
{
|
{
|
||||||
SetPerformanceMode(ASUSWmi.PerformanceSilent);
|
SetPerformanceMode(AsusACPI.PerformanceSilent);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ButtonBalanced_Click(object? sender, EventArgs e)
|
private void ButtonBalanced_Click(object? sender, EventArgs e)
|
||||||
{
|
{
|
||||||
SetPerformanceMode(ASUSWmi.PerformanceBalanced);
|
SetPerformanceMode(AsusACPI.PerformanceBalanced);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ButtonTurbo_Click(object? sender, EventArgs e)
|
private void ButtonTurbo_Click(object? sender, EventArgs e)
|
||||||
{
|
{
|
||||||
SetPerformanceMode(ASUSWmi.PerformanceTurbo);
|
SetPerformanceMode(AsusACPI.PerformanceTurbo);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Settings_Load(object sender, EventArgs e)
|
private void Settings_Load(object sender, EventArgs e)
|
||||||
@@ -1609,7 +1693,7 @@ namespace GHelper
|
|||||||
labelBatteryTitle.Text = Properties.Strings.BatteryChargeLimit + ": " + limit.ToString() + "%";
|
labelBatteryTitle.Text = Properties.Strings.BatteryChargeLimit + ": " + limit.ToString() + "%";
|
||||||
sliderBattery.Value = limit;
|
sliderBattery.Value = limit;
|
||||||
|
|
||||||
Program.wmi.DeviceSet(ASUSWmi.BatteryLimit, limit, "BatteryLimit");
|
Program.acpi.DeviceSet(AsusACPI.BatteryLimit, limit, "BatteryLimit");
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
OptimizationService.SetChargeLimit(limit);
|
OptimizationService.SetChargeLimit(limit);
|
||||||
@@ -1619,7 +1703,7 @@ namespace GHelper
|
|||||||
Debug.WriteLine(ex);
|
Debug.WriteLine(ex);
|
||||||
}
|
}
|
||||||
|
|
||||||
Program.config.setConfig("charge_limit", limit);
|
AppConfig.setConfig("charge_limit", limit);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
using System.Drawing.Drawing2D;
|
using System.Diagnostics;
|
||||||
|
using System.Drawing;
|
||||||
|
using System.Drawing.Drawing2D;
|
||||||
using OSD;
|
using OSD;
|
||||||
|
|
||||||
|
|
||||||
@@ -41,12 +43,32 @@ namespace GHelper
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class ToastForm : OSDNativeForm
|
public enum ToastIcon
|
||||||
|
{
|
||||||
|
BrightnessUp,
|
||||||
|
BrightnessDown,
|
||||||
|
BacklightUp,
|
||||||
|
BacklightDown,
|
||||||
|
Touchpad,
|
||||||
|
Microphone,
|
||||||
|
MicrophoneMute
|
||||||
|
}
|
||||||
|
|
||||||
|
public class ToastForm : OSDNativeForm
|
||||||
{
|
{
|
||||||
|
|
||||||
protected static string toastText = "Balanced";
|
protected static string toastText = "Balanced";
|
||||||
|
protected static ToastIcon? toastIcon = null;
|
||||||
|
|
||||||
protected static System.Windows.Forms.Timer timer = new System.Windows.Forms.Timer();
|
protected static System.Windows.Forms.Timer timer = new System.Windows.Forms.Timer();
|
||||||
|
|
||||||
|
public ToastForm()
|
||||||
|
{
|
||||||
|
timer.Tick += timer_Tick;
|
||||||
|
timer.Enabled = false;
|
||||||
|
timer.Interval = 2000;
|
||||||
|
}
|
||||||
|
|
||||||
protected override void PerformPaint(PaintEventArgs e)
|
protected override void PerformPaint(PaintEventArgs e)
|
||||||
{
|
{
|
||||||
Brush brush = new SolidBrush(Color.FromArgb(150,Color.Black));
|
Brush brush = new SolidBrush(Color.FromArgb(150,Color.Black));
|
||||||
@@ -56,17 +78,58 @@ namespace GHelper
|
|||||||
format.LineAlignment = StringAlignment.Center;
|
format.LineAlignment = StringAlignment.Center;
|
||||||
format.Alignment = StringAlignment.Center;
|
format.Alignment = StringAlignment.Center;
|
||||||
|
|
||||||
e.Graphics.DrawString(toastText,
|
Bitmap? icon = null;
|
||||||
new Font("Segoe UI", 16f, FontStyle.Bold),
|
|
||||||
new SolidBrush(Color.White),
|
switch (toastIcon)
|
||||||
new PointF(this.Bound.Width/2, this.Bound.Height / 2),
|
{
|
||||||
format);
|
case ToastIcon.BrightnessUp:
|
||||||
|
icon = Properties.Resources.brightness_up;
|
||||||
|
break;
|
||||||
|
case ToastIcon.BrightnessDown:
|
||||||
|
icon = Properties.Resources.brightness_down;
|
||||||
|
break;
|
||||||
|
case ToastIcon.BacklightUp:
|
||||||
|
icon = Properties.Resources.backlight_up;
|
||||||
|
break;
|
||||||
|
case ToastIcon.BacklightDown:
|
||||||
|
icon = Properties.Resources.backlight_down;
|
||||||
|
break;
|
||||||
|
case ToastIcon.Microphone:
|
||||||
|
icon = Properties.Resources.icons8_microphone_96;
|
||||||
|
break;
|
||||||
|
case ToastIcon.MicrophoneMute:
|
||||||
|
icon = Properties.Resources.icons8_mute_unmute_96;
|
||||||
|
break;
|
||||||
|
case ToastIcon.Touchpad:
|
||||||
|
icon = Properties.Resources.icons8_touchpad_96;
|
||||||
|
break;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
int shiftX = 0;
|
||||||
|
|
||||||
|
if (icon is not null)
|
||||||
|
{
|
||||||
|
e.Graphics.DrawImage(icon, 18, 18, 64, 64);
|
||||||
|
shiftX = 40;
|
||||||
|
}
|
||||||
|
|
||||||
|
e.Graphics.DrawString(toastText,
|
||||||
|
new Font("Segoe UI", 36f, FontStyle.Bold, GraphicsUnit.Pixel),
|
||||||
|
new SolidBrush(Color.White),
|
||||||
|
new PointF(this.Bound.Width / 2 + shiftX, this.Bound.Height / 2),
|
||||||
|
format);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void RunToast(string text)
|
public void RunToast(string text, ToastIcon? icon = null)
|
||||||
{
|
{
|
||||||
|
//Hide();
|
||||||
|
timer.Stop();
|
||||||
|
|
||||||
toastText = text;
|
toastText = text;
|
||||||
|
toastIcon = icon;
|
||||||
|
|
||||||
Screen screen1 = Screen.FromHandle(base.Handle);
|
Screen screen1 = Screen.FromHandle(base.Handle);
|
||||||
|
|
||||||
Width = 300;
|
Width = 300;
|
||||||
@@ -75,20 +138,15 @@ namespace GHelper
|
|||||||
Y = screen1.Bounds.Height - 300 - this.Height;
|
Y = screen1.Bounds.Height - 300 - this.Height;
|
||||||
|
|
||||||
Show();
|
Show();
|
||||||
|
|
||||||
timer.Stop();
|
|
||||||
timer.Tick -= timer_Tick;
|
|
||||||
|
|
||||||
timer.Tick += timer_Tick;
|
|
||||||
timer.Enabled = true;
|
|
||||||
timer.Interval = 2000;
|
|
||||||
timer.Start();
|
timer.Start();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void timer_Tick(object? sender, EventArgs e)
|
private void timer_Tick(object? sender, EventArgs e)
|
||||||
{
|
{
|
||||||
timer.Stop();
|
Debug.WriteLine("Toast end");
|
||||||
|
|
||||||
Hide();
|
Hide();
|
||||||
|
timer.Stop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,12 +32,13 @@ _If you post about the app - please include a link. Thanks._
|
|||||||
2. **GPU modes**: Eco - Standard - Ultimate - Optimized
|
2. **GPU modes**: Eco - Standard - Ultimate - Optimized
|
||||||
3. Laptop screen refresh rate 60hz or 120hz (144hz, etc) with display overdrive (OD) and miniled multizone switch
|
3. Laptop screen refresh rate 60hz or 120hz (144hz, etc) with display overdrive (OD) and miniled multizone switch
|
||||||
4. Custom fan curve editor, power limits (PPT) and turbo boost selection for every performance mode
|
4. Custom fan curve editor, power limits (PPT) and turbo boost selection for every performance mode
|
||||||
5. Anime matrix control thanks to [Starlight](https://github.com/vddCore/Starlight) + some tweaks from my side including animated GIFs
|
5. Anime matrix control thanks to [Starlight](https://github.com/vddCore/Starlight) + some tweaks from my side including animated GIFs, clock and autio visualizer
|
||||||
6. Keyboard backlit animation and colors (including sleep animation and support for TUF models)
|
6. Keyboard backlit animation and colors (including sleep animation and support for TUF models)
|
||||||
7. Custom bindings for M3, M4 keys and FN+F5 (performance mode) FN+F4 (keyboard animation modes)
|
7. All basic and custom Keyboard hotkeys (M-keys, FN+X keys)
|
||||||
8. Monitor CPU / GPU temperature, fan speeds and battery discharge rate
|
8. Monitor CPU / GPU temperature, fan speeds and battery discharge rate
|
||||||
9. Battery charge limit to preserve battery health
|
9. Battery charge limit to preserve battery health
|
||||||
10. NVidia GPU overclocking
|
10. NVidia GPU overclocking
|
||||||
|
11. XG Mobile Control
|
||||||
|
|
||||||
### :gear: Automatic switching when on battery or plugged in
|
### :gear: Automatic switching when on battery or plugged in
|
||||||
- Performance modes (app remembers last mode used on battery or when plugged)
|
- Performance modes (app remembers last mode used on battery or when plugged)
|
||||||
@@ -100,13 +101,11 @@ Open "Event Viewer" from start menu, go to Windows Logs -> Application and check
|
|||||||
#### Battery charge limiter is not working
|
#### Battery charge limiter is not working
|
||||||
Open application log.text from ``%AppData%\GHelper`` . If you see something like ``BatteryLimit = 60 : OK`` there (with your selected limit). App has done everything it could to set a limit. It could be that MyASUS or other Asus services are overwriting this limit after. You may want to right click and save this [debloat.bat](https://raw.githubusercontent.com/seerge/g-helper/main/debloat.bat) and then right-click Run it As Admin. It will stop not mandatory asus services.
|
Open application log.text from ``%AppData%\GHelper`` . If you see something like ``BatteryLimit = 60 : OK`` there (with your selected limit). App has done everything it could to set a limit. It could be that MyASUS or other Asus services are overwriting this limit after. You may want to right click and save this [debloat.bat](https://raw.githubusercontent.com/seerge/g-helper/main/debloat.bat) and then right-click Run it As Admin. It will stop not mandatory asus services.
|
||||||
|
|
||||||
What you can also try is to open ``C:\ProgramData\ASUS\ASUS System Control Interface\ASUSOptimization\Customization.ini`` and find following section from that file : ``[BatteryHealthCharging] ... value=100`` and either delete it or put same value as you use in G-helper.
|
|
||||||
|
|
||||||
#### Can I use MyASUS app along with G-Helper?
|
#### Can I use MyASUS app along with G-Helper?
|
||||||
You can, the only problem is that MyASUS may override the battery charge limit that you set before. My advice in such a situation would be to set the same limit (i.e. 80%) in both MyASUS and G-Helper.
|
You can, the only problem is that MyASUS may override the battery charge limit that you set before. My advice in such a situation would be to set the same limit (i.e. 80%) in both MyASUS and G-Helper.
|
||||||
|
|
||||||
#### How do I set Mute Microphone to M3?
|
#### How do I set Mute Microphone to M3?
|
||||||
This function is handled by Asus Optimization Service (therefore G-helper doesn't interfere and doesn't touch this function). Make sure that this service is up and running
|
If you have Asus Optimization Service running, it's controlled by that service (therefore G-helper doesn't interfere and doesn't touch this function). Alternatively you can stop that service - and you can bind M3 to anything you want.
|
||||||
|
|
||||||
#### How do I set different "Visual styles"?
|
#### How do I set different "Visual styles"?
|
||||||
Personally, i'm not a big fan of them, as they make colors very inaccurate. But if you want so - you can adjust display colors using either Nvidia Control panel or AMD Adrenaline (appropriate display sections). If you really want you can also use [own ASUS utility from MS Store](https://apps.microsoft.com/store/detail/gamevisual/9P4K1LFTXSH8?hl=nl-nl&gl=nl&rtc=1)
|
Personally, i'm not a big fan of them, as they make colors very inaccurate. But if you want so - you can adjust display colors using either Nvidia Control panel or AMD Adrenaline (appropriate display sections). If you really want you can also use [own ASUS utility from MS Store](https://apps.microsoft.com/store/detail/gamevisual/9P4K1LFTXSH8?hl=nl-nl&gl=nl&rtc=1)
|
||||||
@@ -124,8 +123,11 @@ It's a lightweight Armoury Crate alternative for Asus laptops. A small utility t
|
|||||||
-----------------------------
|
-----------------------------
|
||||||
|
|
||||||
## :euro: [Support Project](https://www.paypal.com/donate/?hosted_button_id=4HMSHS4EBQWTA)
|
## :euro: [Support Project](https://www.paypal.com/donate/?hosted_button_id=4HMSHS4EBQWTA)
|
||||||
#### If you like the app you can make a [Donation via Paypal](https://www.paypal.com/donate/?hosted_button_id=4HMSHS4EBQWTA)
|
#### If you like the app you can make a Donation
|
||||||
[](https://www.paypal.com/donate/?hosted_button_id=4HMSHS4EBQWTA)
|
|
||||||
|
| [Paypal in EUR](https://www.paypal.com/donate/?hosted_button_id=4HMSHS4EBQWTA) | [Paypal in USD](https://www.paypal.com/donate/?hosted_button_id=SRM6QUX6ACXDY) |
|
||||||
|
| ------------------------------------------ | ----------------------------------------------- |
|
||||||
|
| [](https://www.paypal.com/donate/?hosted_button_id=4HMSHS4EBQWTA) | [](https://www.paypal.com/donate/?hosted_button_id=SRM6QUX6ACXDY) |
|
||||||
|
|
||||||
----------------
|
----------------
|
||||||
|
|
||||||
@@ -143,9 +145,7 @@ It's a lightweight Armoury Crate alternative for Asus laptops. A small utility t
|
|||||||
|
|
||||||
### Recommendations (optional)
|
### Recommendations (optional)
|
||||||
|
|
||||||
- I recommend keeping "Asus Optimization Service" running, as it keeps basic laptop hotkeys such as screen or keyboard brightness adjustment working.
|
- You can disable / remove unnecessary services. Ruight click and save [debloat.bat](https://raw.githubusercontent.com/seerge/g-helper/main/debloat.bat). Then right click and Run it as Admin. To restore services - save and run [bloat.bat](https://raw.githubusercontent.com/seerge/g-helper/main/bloat.bat) instead.
|
||||||
|
|
||||||
- Optionally(!) you can disable / remove unnecessary services. Ruight click and save [debloat.bat](https://raw.githubusercontent.com/seerge/g-helper/main/debloat.bat). Then right click and Run it as Admin. To restore services - save and run [bloat.bat](https://raw.githubusercontent.com/seerge/g-helper/main/bloat.bat) instead.
|
|
||||||
|
|
||||||
- It's not recommended to use an app in combination with Armoury Crate services, because they adjust the same settings. You can [uninstall it using it's own uninstall tool](https://dlcdnets.asus.com/pub/ASUS/mb/14Utilities/Armoury_Crate_Uninstall_Tool.zip?model=armoury%20crate). Just in case, you can always install it back later.
|
- It's not recommended to use an app in combination with Armoury Crate services, because they adjust the same settings. You can [uninstall it using it's own uninstall tool](https://dlcdnets.asus.com/pub/ASUS/mb/14Utilities/Armoury_Crate_Uninstall_Tool.zip?model=armoury%20crate). Just in case, you can always install it back later.
|
||||||
|
|
||||||
@@ -196,7 +196,7 @@ Full list of keycodes https://learn.microsoft.com/en-us/windows/win32/inputdev/v
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
### Workaround for [bugged bios on G15](https://github.com/seerge/g-helper/issues/253)
|
### Workaround for [bugged bios on G15](https://github.com/seerge/g-helper/issues/253) when external monitor is connected
|
||||||
|
|
||||||
Some people reported that on G15 model bios can be bugged and either not turn on or not turn off fans, when you set custom fan curve (in Armoury or g-helper, or any other app)
|
Some people reported that on G15 model bios can be bugged and either not turn on or not turn off fans, when you set custom fan curve (in Armoury or g-helper, or any other app)
|
||||||
I have added a very optional workaround as it was asked, on launch app will try to disable and re-enable dGPU when external monitor is connected, that seems to wake up fans :)
|
I have added a very optional workaround as it was asked, on launch app will try to disable and re-enable dGPU when external monitor is connected, that seems to wake up fans :)
|
||||||
|
|||||||