Compare commits

...

39 Commits
v0.53 ... v0.57

Author SHA1 Message Date
Serge
8e1099545a Overdrive fix 2023-05-05 12:35:55 +02:00
Serge
7740678cd4 Added on/off control for aura lightbar, lid and logo 2023-05-05 11:44:33 +02:00
Serge
c6faec9628 Merge branch 'main' of https://github.com/seerge/g-helper 2023-05-04 13:55:50 +02:00
Serge
3a5c4de9b6 Context menu 2023-05-04 13:55:49 +02:00
Serge
f90fec24b9 Update README.md 2023-05-03 19:56:58 +02:00
Serge
240537dbd4 Merge pull request #315 from marcelomijas/main
Added Spanish translation for new options
2023-05-03 19:56:17 +02:00
Marcelo Moreno
cc3c16cdf1 Added Spanish translation for new options
Added Spanish translation for the new options:
- dGPU off in Optimized mode when on USB-charger.
- Minilled related options.
2023-05-03 19:19:17 +02:00
Serge
a7c662a0d4 Merge branch 'main' of https://github.com/seerge/g-helper 2023-05-03 18:18:44 +02:00
Serge
b0958cb2fc Translations fix 2023-05-03 18:18:42 +02:00
Serge
29f27ed4d6 Update README.md 2023-05-03 18:07:31 +02:00
Serge
801096299b Anime matrix tweaks 2023-05-03 17:53:21 +02:00
Serge
5ed1de0fcf Added option to keep dGPU off on usb-c 2023-05-03 16:49:12 +02:00
Serge
0ec0a382e9 Merge 2023-05-01 15:13:15 +02:00
Serge
e810adb358 Added Screen Toggle feature for M3 button 2023-05-01 15:12:08 +02:00
Serge
dc6c94fe4a Merge pull request #305 from sklynic/main
Minor update of zh-CN translation
2023-05-01 12:04:24 +02:00
sklynic
8479c129ff Update translation of zh-CN 2023-05-01 17:58:47 +08:00
Serge
3173c2e688 Merge branch 'main' of https://github.com/seerge/g-helper 2023-04-27 10:14:15 +02:00
Serge
730ba0a2f9 Matrix logging 2023-04-27 10:14:13 +02:00
Serge
d26a83287d Update README.md 2023-04-22 22:42:11 +02:00
Serge
47deb669d1 UI tweaks 2023-04-22 00:09:22 +02:00
Serge
a30f5d801b UI tweaks 2023-04-21 23:32:02 +02:00
Serge
75f4b9f2c5 Update README.md 2023-04-21 16:19:26 +02:00
Serge
2289f36ba5 Create FUNDING.yml 2023-04-21 16:13:27 +02:00
Serge
6322e25e78 Merge pull request #279 from marcelomijas/main
Spanish translation fix for v0.55
2023-04-21 15:01:10 +02:00
seerge
62c0147548 - 2023-04-21 14:59:19 +02:00
seerge
9bd2688da2 UI tweaks 2023-04-21 14:59:06 +02:00
Marcelo Moreno
9649814085 Add files via upload 2023-04-21 14:46:03 +02:00
seerge
1ebc2021f6 KB Brightness control for TUF models 2023-04-20 14:53:37 +02:00
seerge
52b165f250 Merge branch 'main' of https://github.com/seerge/g-helper 2023-04-19 17:42:01 +02:00
seerge
b2ed390bdf XGMobile support 2023-04-19 17:41:59 +02:00
Serge
1588f84c97 Update README.md 2023-04-19 16:46:28 +02:00
seerge
a3a2fdfe14 Merge branch 'main' of https://github.com/seerge/g-helper 2023-04-18 17:50:12 +02:00
seerge
2c867eb960 UI tweaks 2023-04-18 17:50:10 +02:00
Serge
6fbf4f2a49 Merge pull request #258 from lswlc33/main
Update Strings.zh-CN.resx
2023-04-16 19:01:35 +02:00
Serge
d4ecb2bcf3 Merge pull request #259 from lswlc33/patch-2
Update README.zh-CN.md
2023-04-16 19:01:26 +02:00
雪中明月
c70c6ef4d6 Update README.zh-CN.md 2023-04-16 21:30:14 +08:00
雪中明月
5d77d5c700 Update Strings.zh-CN.resx 2023-04-16 21:23:01 +08:00
seerge
89f096778d Merge branch 'main' of https://github.com/seerge/g-helper 2023-04-16 13:55:03 +02:00
seerge
2b9fc913ad TUF keyboard adjustment 2023-04-16 13:55:01 +02:00
34 changed files with 1262 additions and 356 deletions

13
.github/FUNDING.yml vendored Normal file
View File

@@ -0,0 +1,13 @@
# These are supported funding model platforms
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
custom: https://www.paypal.com/donate/?hosted_button_id=4HMSHS4EBQWTA

View File

@@ -14,6 +14,11 @@ public class ASUSWmi
public const int KB_Light_Up = 0xc4;
public const int KB_Light_Down = 0xc5;
public const int ChargerMode = 0x0012006C;
public const int ChargerUSB = 2;
public const int ChargerBarrel = 1;
public const uint CPU_Fan = 0x00110013;
public const uint GPU_Fan = 0x00110014;
public const uint Mid_Fan = 0x00110031;
@@ -48,6 +53,7 @@ public class ASUSWmi
public const int PPT_APUC1 = 0x001200C1; // Actual Power Limit (PPT_LIMIT_FAST) AND Sustained Power Limit (STAPM_LIMIT)
public const int PPT_APUC2 = 0x001200C2; // does nothing on G14 2022
public const int TUF_KB_BRIGHTNESS = 0x00050021;
public const int TUF_KB = 0x00100056;
public const int TUF_KB_STATE = 0x00100057;
@@ -260,11 +266,17 @@ public class ASUSWmi
}
public void TUFKeyboardBrightness(int brightness)
{
int param = 0x80 | (brightness & 0x7F);
DeviceSet(TUF_KB_BRIGHTNESS, param, "TUF Brightness");
}
public void TUFKeyboardRGB(int mode, Color color, int speed)
{
byte[] setting = new byte[12];
setting[0] = (byte)1;
setting[0] = (byte)0xB4;
setting[1] = (byte)mode;
setting[2] = color.R;
setting[3] = color.G;
@@ -309,4 +321,5 @@ public class ASUSWmi
}
}
}

View File

@@ -1,11 +1,10 @@
// Source thanks to https://github.com/vddCore/Starlight with some adjustments from me
using Starlight.Communication;
using System.Management;
using System.Drawing.Drawing2D;
using System.Text;
using System.Globalization;
using System;
using System.Management;
using System.Text;
namespace Starlight.AnimeMatrix
{
@@ -107,9 +106,6 @@ namespace Starlight.AnimeMatrix
MaxColumns = 33;
dx = 1;
//FullRows = 7;
//FullEvenRows = 3;
MaxRows = 55;
LedCount = 1245;
@@ -177,17 +173,8 @@ namespace Starlight.AnimeMatrix
{
return (y + 1) / 2 - 3;
}
case AnimeType.GA402:
if (y < 11)
{
return 0;
}
else
{
return (y) / 2 - 5;
}
default:
throw new ArgumentException("Invalid anime type", nameof(_model));
return (int)Math.Ceiling(Math.Max(0, y - 11) / 2F);
}
}
@@ -197,10 +184,8 @@ namespace Starlight.AnimeMatrix
{
case AnimeType.GA401:
return 33;
case AnimeType.GA402:
return 34;
default:
throw new ArgumentException("Invalid anime type", nameof(_model));
return 34;
}
}
@@ -221,36 +206,15 @@ namespace Starlight.AnimeMatrix
default:
return 36 - y / 2;
}
case AnimeType.GA402:
return Width(y) - FirstX(y);
default:
throw new ArgumentException("Invalid anime type", nameof(_model));
return Width(y) - FirstX(y);
}
}
/*
public int XStart(int row)
{
return (int)Math.Ceiling(Math.Max(0, row - FullRows) / 2.0);
}
public int XEnd(int row)
{
if (row <= FullEvenRows)
{
if (row % 2 == 1) return MaxColumns + 2;
else return MaxColumns;
}
return MaxColumns;
}
*/
public int RowToLinearAddress(int y)
{
EnsureRowInRange(y);
int ret = 0;
for (var i = 0; i < y; i++)
ret += Pitch(i);
@@ -259,13 +223,10 @@ namespace Starlight.AnimeMatrix
public void SetLedPlanar(int x, int y, byte value)
{
EnsureRowInRange(y);
if (!IsRowInRange(y)) return;
if (x >= FirstX(y) && x < Width(y))
{
SetLedLinear(RowToLinearAddress(y) - FirstX(y) + x + dx, value);
//Debug.Write((RowToLinearAddress(y) - FirstX(y) + x + dx).ToString() + " ");
}
}
public void WakeUp()
@@ -366,9 +327,9 @@ namespace Starlight.AnimeMatrix
int second = DateTime.Now.Second;
if (CultureInfo.CurrentCulture.DateTimeFormat.ShortTimePattern.Contains("H"))
PresentText(DateTime.Now.ToString("H" + ((second % 2 == 0)?":":" ") + "mm"));
PresentTextDiagonal(DateTime.Now.ToString("H" + ((second % 2 == 0) ? ":" : " ") + "mm"));
else
PresentText(DateTime.Now.ToString("h" + ((second % 2 == 0) ? ":" : " ") + "mm"), DateTime.Now.ToString("tt"));
PresentTextDiagonal(DateTime.Now.ToString("h" + ((second % 2 == 0) ? ":" : " ") + "mmtt"));
}
public void PresentText(string text1, string text2 = "")
@@ -383,14 +344,14 @@ namespace Starlight.AnimeMatrix
using (Font font = new Font("Arial", 24F, GraphicsUnit.Pixel))
{
SizeF textSize = g.MeasureString(text1, font);
g.DrawString(text1, font, Brushes.White, (MaxColumns*3 - textSize.Width)+3, -3);
g.DrawString(text1, font, Brushes.White, (MaxColumns * 3 - textSize.Width) + 3, -3);
}
if (text2.Length > 0)
using (Font font = new Font("Arial", 18F, GraphicsUnit.Pixel))
{
SizeF textSize = g.MeasureString(text2, font);
g.DrawString(text2, font, Brushes.White, (MaxColumns * 3 - textSize.Width)+1, 25);
g.DrawString(text2, font, Brushes.White, (MaxColumns * 3 - textSize.Width) + 1, 25);
}
}
@@ -404,7 +365,7 @@ namespace Starlight.AnimeMatrix
public void GenerateFrame(Image image, InterpolationMode interpolation = InterpolationMode.High)
{
int width = MaxColumns/2 * 6;
int width = MaxColumns / 2 * 6;
int height = MaxRows;
int targetWidth = MaxColumns * 2;
@@ -431,7 +392,7 @@ namespace Starlight.AnimeMatrix
for (int y = 0; y < bmp.Height; y++)
{
for (int x = 0; x < bmp.Width; x++)
if (x % 2 == (y+dx) % 2)
if (x % 2 == (y + dx) % 2)
{
var pixel = bmp.GetPixel(x, y);
var color = (pixel.R + pixel.G + pixel.B) / 3;
@@ -442,12 +403,55 @@ namespace Starlight.AnimeMatrix
}
}
private void EnsureRowInRange(int row)
public void SetLedDiagonal(int x, int y, byte color, int delta = 10)
{
if (row < 0 || row >= MaxRows)
//x+=delta;
y -= delta;
int dx = (x - y) / 2;
int dy = x + y;
SetLedPlanar(dx, dy, color);
}
public void PresentTextDiagonal(string text)
{
Clear();
int maxX = (int)Math.Sqrt(MaxRows * MaxRows + MaxColumns * MaxColumns);
using (Bitmap bmp = new Bitmap(maxX, MaxRows))
{
throw new IndexOutOfRangeException($"Y-coordinate should fall in range of [0, {MaxRows - 1}].");
using (Graphics g = Graphics.FromImage(bmp))
{
g.CompositingQuality = CompositingQuality.HighQuality;
g.SmoothingMode = SmoothingMode.AntiAlias;
using (Font font = new Font("Calibri", 16F, GraphicsUnit.Pixel))
{
SizeF textSize = g.MeasureString(text, font);
g.DrawString(text, font, Brushes.White, 4, 0);
}
}
for (int y = 0; y < bmp.Height; y++)
{
for (int x = 0; x < bmp.Width; x++)
{
var pixel = bmp.GetPixel(x, y);
var color = (pixel.R + pixel.G + pixel.B) / 3;
SetLedDiagonal(x, y, (byte)color);
}
}
}
Present();
}
private bool IsRowInRange(int row)
{
return (row >= 0 && row < MaxRows);
}
private bool IsAddressableLed(int address)

View File

@@ -1,5 +1,6 @@
using HidLibrary;
using System.Diagnostics;
using static Starlight.AnimeMatrix.BuiltInAnimation;
namespace GHelper
{
@@ -195,6 +196,9 @@ namespace GHelper
}
Logger.WriteLine("USB-KB = " + BitConverter.ToString(msg));
if (Program.config.ContainsModel("TUF"))
Program.wmi.TUFKeyboardBrightness(brightness);
}
@@ -204,10 +208,37 @@ namespace GHelper
List<AuraDev19b6> flags = new List<AuraDev19b6>();
if (awake) flags.Add(AuraDev19b6.AwakeKeyb);
if (boot) flags.Add(AuraDev19b6.BootKeyb);
if (sleep) flags.Add(AuraDev19b6.SleepKeyb);
if (shutdown) flags.Add(AuraDev19b6.ShutdownKeyb);
if (awake)
{
flags.Add(AuraDev19b6.AwakeKeyb);
flags.Add(AuraDev19b6.AwakeBar);
flags.Add(AuraDev19b6.AwakeLid);
flags.Add(AuraDev19b6.AwakeLogo);
}
if (boot)
{
flags.Add(AuraDev19b6.BootKeyb);
flags.Add(AuraDev19b6.BootBar);
flags.Add(AuraDev19b6.BootLid);
flags.Add(AuraDev19b6.BootLogo);
}
if (sleep)
{
flags.Add(AuraDev19b6.SleepKeyb);
flags.Add(AuraDev19b6.SleepBar);
flags.Add(AuraDev19b6.SleepLid);
flags.Add(AuraDev19b6.SleepLogo);
}
if (shutdown)
{
flags.Add(AuraDev19b6.ShutdownKeyb);
flags.Add(AuraDev19b6.ShutdownBar);
flags.Add(AuraDev19b6.ShutdownLid);
flags.Add(AuraDev19b6.ShutdownLogo);
}
byte[] msg = AuraDev19b6Extensions.ToBytes(flags.ToArray());

View File

@@ -1,7 +1,7 @@
using CustomControls;
using WinFormsSliderBar;
using System.Drawing.Drawing2D;
using System.Windows.Forms.DataVisualization.Charting;
using WinFormsSliderBar;
public static class ControlHelper
{
@@ -86,7 +86,7 @@ public static class ControlHelper
}
var sl = control as Slider;
if (sl != null)
if (sl != null)
{
sl.borderColor = RForm.buttonMain;
}

View File

@@ -30,6 +30,11 @@ namespace CustomControls
public bool darkTheme = false;
public RForm()
{
DoubleBuffered = true;
}
public static void InitColors(bool darkTheme)
{
if (darkTheme)
@@ -97,7 +102,7 @@ namespace CustomControls
}
public class RComboBox : ComboBox
public class RComboBox : ComboBox
{
private Color borderColor = Color.Gray;
[DefaultValue(typeof(Color), "Gray")]
@@ -332,8 +337,9 @@ namespace CustomControls
public RButton()
{
this.FlatStyle = FlatStyle.Flat;
this.FlatAppearance.BorderSize = 0;
DoubleBuffered = true;
FlatStyle = FlatStyle.Flat;
FlatAppearance.BorderSize = 0;
}
private GraphicsPath GetFigurePath(Rectangle rect, int radius)

View File

@@ -1,8 +1,9 @@
using CustomControls;
using GHelper.Properties;
namespace GHelper
{
partial class Keyboard
partial class Extra
{
/// <summary>
/// Required designer variable.
@@ -30,7 +31,8 @@ namespace GHelper
/// </summary>
private void InitializeComponent()
{
groupBox1 = new GroupBox();
groupBindings = new GroupBox();
pictureHelp = new PictureBox();
textFNF4 = new TextBox();
comboFNF4 = new RComboBox();
labelFNF4 = new Label();
@@ -41,6 +43,8 @@ namespace GHelper
comboM3 = new RComboBox();
labelM3 = new Label();
groupLight = new GroupBox();
labelBrightness = new Label();
trackBrightness = new TrackBar();
labelSpeed = new Label();
comboKeyboardSpeed = new RComboBox();
checkShutdown = new CheckBox();
@@ -48,35 +52,47 @@ namespace GHelper
checkBoot = new CheckBox();
checkAwake = new CheckBox();
groupOther = new GroupBox();
checkUSBC = new CheckBox();
checkNoOverdrive = new CheckBox();
checkKeyboardAuto = new CheckBox();
checkTopmost = new CheckBox();
pictureHelp = new PictureBox();
groupBox1.SuspendLayout();
groupLight.SuspendLayout();
groupOther.SuspendLayout();
groupBindings.SuspendLayout();
((System.ComponentModel.ISupportInitialize)pictureHelp).BeginInit();
groupLight.SuspendLayout();
((System.ComponentModel.ISupportInitialize)trackBrightness).BeginInit();
groupOther.SuspendLayout();
SuspendLayout();
//
// groupBox1
// groupBindings
//
groupBox1.Controls.Add(pictureHelp);
groupBox1.Controls.Add(textFNF4);
groupBox1.Controls.Add(comboFNF4);
groupBox1.Controls.Add(labelFNF4);
groupBox1.Controls.Add(textM4);
groupBox1.Controls.Add(textM3);
groupBox1.Controls.Add(comboM4);
groupBox1.Controls.Add(labelM4);
groupBox1.Controls.Add(comboM3);
groupBox1.Controls.Add(labelM3);
groupBox1.Dock = DockStyle.Top;
groupBox1.Location = new Point(10, 10);
groupBox1.Name = "groupBox1";
groupBox1.Size = new Size(810, 242);
groupBox1.TabIndex = 0;
groupBox1.TabStop = false;
groupBox1.Text = Properties.Strings.KeyBindings;
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.Location = new Point(10, 10);
groupBindings.Name = "groupBindings";
groupBindings.Size = new Size(844, 242);
groupBindings.TabIndex = 0;
groupBindings.TabStop = false;
groupBindings.Text = "Key Bindings";
//
// pictureHelp
//
pictureHelp.BackgroundImage = Resources.icons8_help_64;
pictureHelp.BackgroundImageLayout = ImageLayout.Zoom;
pictureHelp.Cursor = Cursors.Hand;
pictureHelp.Location = new Point(744, 57);
pictureHelp.Name = "pictureHelp";
pictureHelp.Size = new Size(32, 32);
pictureHelp.TabIndex = 9;
pictureHelp.TabStop = false;
//
// textFNF4
//
@@ -88,12 +104,13 @@ namespace GHelper
//
// comboFNF4
//
comboFNF4.BorderColor = Color.White;
comboFNF4.ButtonColor = Color.FromArgb(255, 255, 255);
comboFNF4.FormattingEnabled = true;
comboFNF4.Location = new Point(93, 175);
comboFNF4.Name = "comboFNF4";
comboFNF4.Size = new Size(312, 40);
comboFNF4.TabIndex = 7;
comboFNF4.BorderColor = Color.White;
//
// labelFNF4
//
@@ -122,14 +139,14 @@ namespace GHelper
//
// comboM4
//
comboM4.BorderColor = Color.White;
comboM4.ButtonColor = Color.FromArgb(255, 255, 255);
comboM4.FormattingEnabled = true;
comboM4.Items.AddRange(new object[] { Properties.Strings.PerformanceMode, Properties.Strings.OpenGHelper, Properties.Strings.Custom });
comboM4.Items.AddRange(new object[] { Strings.PerformanceMode, Strings.OpenGHelper, Strings.Custom });
comboM4.Location = new Point(93, 112);
comboM4.Name = "comboM4";
comboM4.Size = new Size(312, 40);
comboM4.TabIndex = 3;
comboM4.BorderColor = Color.White;
//
// labelM4
//
@@ -142,14 +159,14 @@ namespace GHelper
//
// comboM3
//
comboM3.BorderColor = Color.White;
comboM3.ButtonColor = Color.FromArgb(255, 255, 255);
comboM3.FormattingEnabled = true;
comboM3.Items.AddRange(new object[] { Properties.Strings.Default, Properties.Strings.VolumeMute, Properties.Strings.PlayPause, Properties.Strings.PrintScreen, Properties.Strings.ToggleAura, Properties.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.Name = "comboM3";
comboM3.Size = new Size(312, 40);
comboM3.TabIndex = 1;
comboM3.BorderColor = Color.White;
//
// labelM3
//
@@ -162,6 +179,8 @@ namespace GHelper
//
// groupLight
//
groupLight.Controls.Add(labelBrightness);
groupLight.Controls.Add(trackBrightness);
groupLight.Controls.Add(labelSpeed);
groupLight.Controls.Add(comboKeyboardSpeed);
groupLight.Controls.Add(checkShutdown);
@@ -171,20 +190,37 @@ namespace GHelper
groupLight.Dock = DockStyle.Top;
groupLight.Location = new Point(10, 252);
groupLight.Name = "groupLight";
groupLight.Size = new Size(810, 320);
groupLight.Size = new Size(844, 395);
groupLight.TabIndex = 1;
groupLight.TabStop = false;
groupLight.Text = Properties.Strings.KeyboardBacklight;
groupLight.Text = "Keyboard Backlight";
//
// labelBrightness
//
labelBrightness.Location = new Point(25, 304);
labelBrightness.Name = "labelBrightness";
labelBrightness.Size = new Size(197, 49);
labelBrightness.TabIndex = 0;
labelBrightness.Text = "Brightness";
//
// trackBrightness
//
trackBrightness.Location = new Point(228, 294);
trackBrightness.Maximum = 3;
trackBrightness.Name = "trackBrightness";
trackBrightness.Size = new Size(600, 90);
trackBrightness.TabIndex = 1;
trackBrightness.TickStyle = TickStyle.TopLeft;
//
// labelSpeed
//
labelSpeed.AutoSize = true;
labelSpeed.Location = new Point(25, 237);
labelSpeed.Location = new Point(25, 235);
labelSpeed.MaximumSize = new Size(200, 0);
labelSpeed.Name = "labelSpeed";
labelSpeed.Size = new Size(198, 32);
labelSpeed.TabIndex = 40;
labelSpeed.Text = Properties.Strings.AnimationSpeed;
labelSpeed.Text = "Animation Speed";
//
// comboKeyboardSpeed
//
@@ -195,7 +231,7 @@ namespace GHelper
comboKeyboardSpeed.FormattingEnabled = true;
comboKeyboardSpeed.ItemHeight = 32;
comboKeyboardSpeed.Items.AddRange(new object[] { "Slow", "Normal", "Fast" });
comboKeyboardSpeed.Location = new Point(230, 234);
comboKeyboardSpeed.Location = new Point(230, 232);
comboKeyboardSpeed.Margin = new Padding(4, 10, 4, 8);
comboKeyboardSpeed.Name = "comboKeyboardSpeed";
comboKeyboardSpeed.Size = new Size(291, 40);
@@ -209,7 +245,7 @@ namespace GHelper
checkShutdown.Name = "checkShutdown";
checkShutdown.Size = new Size(154, 36);
checkShutdown.TabIndex = 3;
checkShutdown.Text = Properties.Strings.Shutdown;
checkShutdown.Text = Strings.Shutdown;
checkShutdown.UseVisualStyleBackColor = true;
//
// checkSleep
@@ -219,7 +255,7 @@ namespace GHelper
checkSleep.Name = "checkSleep";
checkSleep.Size = new Size(105, 36);
checkSleep.TabIndex = 2;
checkSleep.Text = Properties.Strings.Sleep;
checkSleep.Text = Strings.Sleep;
checkSleep.UseVisualStyleBackColor = true;
//
// checkBoot
@@ -229,7 +265,7 @@ namespace GHelper
checkBoot.Name = "checkBoot";
checkBoot.Size = new Size(96, 36);
checkBoot.TabIndex = 1;
checkBoot.Text = Properties.Strings.Boot;
checkBoot.Text = Strings.Boot;
checkBoot.UseVisualStyleBackColor = true;
//
// checkAwake
@@ -239,21 +275,32 @@ namespace GHelper
checkAwake.Name = "checkAwake";
checkAwake.Size = new Size(115, 36);
checkAwake.TabIndex = 0;
checkAwake.Text = Properties.Strings.Awake;
checkAwake.Text = Strings.Awake;
checkAwake.UseVisualStyleBackColor = true;
//
// groupOther
//
groupOther.Controls.Add(checkUSBC);
groupOther.Controls.Add(checkNoOverdrive);
groupOther.Controls.Add(checkKeyboardAuto);
groupOther.Controls.Add(checkTopmost);
groupOther.Dock = DockStyle.Top;
groupOther.Location = new Point(10, 572);
groupOther.Location = new Point(10, 647);
groupOther.Name = "groupOther";
groupOther.Size = new Size(810, 225);
groupOther.Size = new Size(844, 293);
groupOther.TabIndex = 2;
groupOther.TabStop = false;
groupOther.Text = Properties.Strings.Other;
groupOther.Text = "Other";
//
// checkUSBC
//
checkUSBC.AutoSize = true;
checkUSBC.Location = new Point(25, 210);
checkUSBC.Name = "checkUSBC";
checkUSBC.Size = new Size(659, 36);
checkUSBC.TabIndex = 4;
checkUSBC.Text = "Keep GPU disabled on USB-C charger in Optimized mode";
checkUSBC.UseVisualStyleBackColor = true;
//
// checkNoOverdrive
//
@@ -262,19 +309,18 @@ namespace GHelper
checkNoOverdrive.Name = "checkNoOverdrive";
checkNoOverdrive.Size = new Size(307, 36);
checkNoOverdrive.TabIndex = 3;
checkNoOverdrive.Text = Properties.Strings.DisableOverdrive;
checkNoOverdrive.Text = Strings.DisableOverdrive;
checkNoOverdrive.UseVisualStyleBackColor = true;
//
// checkKeyboardAuto
//
checkKeyboardAuto.AutoEllipsis = true;
checkKeyboardAuto.AutoSize = true;
checkKeyboardAuto.Location = new Point(25, 51);
checkKeyboardAuto.MaximumSize = new Size(780, 0);
checkKeyboardAuto.Name = "checkKeyboardAuto";
checkKeyboardAuto.Size = new Size(712, 36);
checkKeyboardAuto.TabIndex = 2;
checkKeyboardAuto.Text = Properties.Strings.KeyboardAuto;
checkKeyboardAuto.Text = Strings.KeyboardAuto;
checkKeyboardAuto.UseVisualStyleBackColor = true;
//
// checkTopmost
@@ -284,50 +330,40 @@ namespace GHelper
checkTopmost.Name = "checkTopmost";
checkTopmost.Size = new Size(390, 36);
checkTopmost.TabIndex = 1;
checkTopmost.Text = Properties.Strings.WindowTop;
checkTopmost.Text = Strings.WindowTop;
checkTopmost.UseVisualStyleBackColor = true;
//
// pictureHelp
//
pictureHelp.BackgroundImageLayout = ImageLayout.Zoom;
pictureHelp.Cursor = Cursors.Hand;
pictureHelp.BackgroundImage = Properties.Resources.icons8_help_64;
pictureHelp.Location = new Point(744, 57);
pictureHelp.Name = "pictureHelp";
pictureHelp.Size = new Size(32, 32);
pictureHelp.TabIndex = 9;
pictureHelp.TabStop = false;
//
// Keyboard
// Extra
//
AutoScaleDimensions = new SizeF(13F, 32F);
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(830, 858);
ClientSize = new Size(864, 953);
Controls.Add(groupOther);
Controls.Add(groupLight);
Controls.Add(groupBox1);
Controls.Add(groupBindings);
FormBorderStyle = FormBorderStyle.FixedSingle;
MaximizeBox = false;
MdiChildrenMinimizedAnchorBottom = false;
MinimizeBox = false;
Name = "Keyboard";
Name = "Extra";
Padding = new Padding(10);
ShowIcon = false;
ShowInTaskbar = false;
Text = Properties.Strings.ExtraSettings;
groupBox1.ResumeLayout(false);
groupBox1.PerformLayout();
Text = "Extra Settings";
groupBindings.ResumeLayout(false);
groupBindings.PerformLayout();
((System.ComponentModel.ISupportInitialize)pictureHelp).EndInit();
groupLight.ResumeLayout(false);
groupLight.PerformLayout();
((System.ComponentModel.ISupportInitialize)trackBrightness).EndInit();
groupOther.ResumeLayout(false);
groupOther.PerformLayout();
((System.ComponentModel.ISupportInitialize)pictureHelp).EndInit();
ResumeLayout(false);
}
#endregion
private GroupBox groupBox1;
private GroupBox groupBindings;
private Label labelM3;
private RComboBox comboM3;
private RComboBox comboM4;
@@ -349,5 +385,8 @@ namespace GHelper
private CheckBox checkKeyboardAuto;
private CheckBox checkNoOverdrive;
private PictureBox pictureHelp;
private TrackBar trackBrightness;
private Label labelBrightness;
private CheckBox checkUSBC;
}
}

View File

@@ -3,7 +3,7 @@ using System.Diagnostics;
namespace GHelper
{
public partial class Keyboard : RForm
public partial class Extra : RForm
{
Dictionary<string, string> customActions = new Dictionary<string, string>
@@ -13,14 +13,16 @@ namespace GHelper
{"screenshot", Properties.Strings.PrintScreen},
{"play", Properties.Strings.PlayPause},
{"aura", Properties.Strings.ToggleAura},
{"ghelper", Properties.Strings.OpenGHelper},
{"performance", Properties.Strings.PerformanceMode},
{"screen", Properties.Strings.ToggleScreen},
{"miniled", Properties.Strings.ToggleMiniled},
{"custom", Properties.Strings.Custom}
};
private void SetKeyCombo(ComboBox combo, TextBox txbox, string name)
{
if (name == "m4")
customActions[""] = Properties.Strings.PerformanceMode;
customActions[""] = Properties.Strings.OpenGHelper;
if (name == "fnf4")
{
@@ -51,9 +53,29 @@ namespace GHelper
};
}
public Keyboard()
public Extra()
{
InitializeComponent();
groupBindings.Text = Properties.Strings.KeyBindings;
groupLight.Text = Properties.Strings.KeyboardBacklight;
groupOther.Text = Properties.Strings.Other;
checkAwake.Text = Properties.Strings.Awake;
checkSleep.Text = Properties.Strings.Sleep;
checkBoot.Text = Properties.Strings.Boot;
checkShutdown.Text = Properties.Strings.Shutdown;
labelSpeed.Text = Properties.Strings.AnimationSpeed;
labelBrightness.Text = Properties.Strings.Brightness;
checkKeyboardAuto.Text = Properties.Strings.KeyboardAuto;
checkNoOverdrive.Text = Properties.Strings.DisableOverdrive;
checkTopmost.Text = Properties.Strings.WindowTop;
checkUSBC.Text = Properties.Strings.OptimizedUSBC;
Text = Properties.Strings.ExtraSettings;
InitTheme();
SetKeyCombo(comboM3, textM3, "m3");
@@ -88,8 +110,26 @@ namespace GHelper
checkNoOverdrive.Checked = (Program.config.getConfig("no_overdrive") == 1);
checkNoOverdrive.CheckedChanged += CheckNoOverdrive_CheckedChanged;
pictureHelp.Click += PictureHelp_Click;
checkUSBC.Checked = (Program.config.getConfig("optimized_usbc") == 1);
checkUSBC.CheckedChanged += CheckUSBC_CheckedChanged;
int kb_brightness = Program.config.getConfig("keyboard_brightness");
trackBrightness.Value = (kb_brightness >= 0 && kb_brightness <= 3) ? kb_brightness : 3;
pictureHelp.Click += PictureHelp_Click;
trackBrightness.Scroll += TrackBrightness_Scroll;
}
private void CheckUSBC_CheckedChanged(object? sender, EventArgs e)
{
Program.config.setConfig("optimized_usbc", (checkUSBC.Checked ? 1 : 0));
}
private void TrackBrightness_Scroll(object? sender, EventArgs e)
{
Program.config.setConfig("keyboard_brightness", trackBrightness.Value);
Aura.ApplyBrightness(trackBrightness.Value);
}
private void PictureHelp_Click(object? sender, EventArgs e)

273
app/Fans.Designer.cs generated
View File

@@ -31,13 +31,14 @@ namespace GHelper
/// </summary>
private void InitializeComponent()
{
ChartArea chartArea1 = new ChartArea();
Title title1 = new Title();
ChartArea chartArea2 = new ChartArea();
Title title2 = new Title();
ChartArea chartArea3 = new ChartArea();
Title title3 = new Title();
ChartArea chartArea4 = new ChartArea();
Title title4 = new Title();
ChartArea chartArea5 = new ChartArea();
Title title5 = new Title();
ChartArea chartArea6 = new ChartArea();
Title title6 = new Title();
panelFans = new Panel();
labelFansResult = new Label();
labelTip = new Label();
labelBoost = new Label();
comboBoost = new RComboBox();
@@ -59,11 +60,20 @@ namespace GHelper
trackCPU = new TrackBar();
panelTotal = new Panel();
labelTotal = new Label();
label1 = new Label();
labelPlatform = new Label();
trackTotal = new TrackBar();
pictureFine = new PictureBox();
labelInfo = new Label();
labelFansResult = new Label();
panelGPU = new Panel();
buttonResetGPU = new RButton();
labelGPUMemory = new Label();
trackGPUMemory = new TrackBar();
labelGPUMemoryTitle = new Label();
pictureBox2 = new PictureBox();
labelGPUCore = new Label();
labelGPU = new Label();
trackGPUCore = new TrackBar();
labelGPUCoreTitle = new Label();
panelFans.SuspendLayout();
((System.ComponentModel.ISupportInitialize)picturePerf).BeginInit();
tableFanCharts.SuspendLayout();
@@ -77,6 +87,10 @@ namespace GHelper
panelTotal.SuspendLayout();
((System.ComponentModel.ISupportInitialize)trackTotal).BeginInit();
((System.ComponentModel.ISupportInitialize)pictureFine).BeginInit();
panelGPU.SuspendLayout();
((System.ComponentModel.ISupportInitialize)trackGPUMemory).BeginInit();
((System.ComponentModel.ISupportInitialize)pictureBox2).BeginInit();
((System.ComponentModel.ISupportInitialize)trackGPUCore).BeginInit();
SuspendLayout();
//
// panelFans
@@ -94,10 +108,21 @@ namespace GHelper
panelFans.Location = new Point(364, 0);
panelFans.Margin = new Padding(0);
panelFans.Name = "panelFans";
panelFans.Padding = new Padding(20);
panelFans.Size = new Size(824, 1159);
panelFans.Padding = new Padding(10);
panelFans.Size = new Size(824, 1189);
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.AutoSize = true;
@@ -117,7 +142,7 @@ namespace GHelper
labelBoost.Name = "labelBoost";
labelBoost.Size = new Size(125, 32);
labelBoost.TabIndex = 39;
labelBoost.Text = Properties.Strings.CPUBoost;
labelBoost.Text = "CPU Boost";
labelBoost.TextAlign = ContentAlignment.MiddleRight;
//
// comboBoost
@@ -154,56 +179,56 @@ namespace GHelper
tableFanCharts.Controls.Add(chartCPU, 0, 0);
tableFanCharts.Controls.Add(chartMid, 0, 2);
tableFanCharts.Location = new Point(28, 64);
tableFanCharts.Margin = new Padding(6);
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, 992);
tableFanCharts.Size = new Size(764, 1022);
tableFanCharts.TabIndex = 36;
//
// chartGPU
//
chartArea1.Name = "ChartArea1";
chartGPU.ChartAreas.Add(chartArea1);
chartArea4.Name = "ChartArea1";
chartGPU.ChartAreas.Add(chartArea4);
chartGPU.Dock = DockStyle.Fill;
chartGPU.Location = new Point(2, 340);
chartGPU.Location = new Point(2, 350);
chartGPU.Margin = new Padding(2, 10, 2, 10);
chartGPU.Name = "chartGPU";
chartGPU.Size = new Size(760, 310);
chartGPU.Size = new Size(760, 320);
chartGPU.TabIndex = 17;
chartGPU.Text = "chartGPU";
title1.Name = "Title1";
chartGPU.Titles.Add(title1);
title4.Name = "Title1";
chartGPU.Titles.Add(title4);
//
// chartCPU
//
chartArea2.Name = "ChartArea1";
chartCPU.ChartAreas.Add(chartArea2);
chartArea5.Name = "ChartArea1";
chartCPU.ChartAreas.Add(chartArea5);
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, 310);
chartCPU.Size = new Size(760, 320);
chartCPU.TabIndex = 14;
chartCPU.Text = "chartCPU";
title2.Name = "Title1";
chartCPU.Titles.Add(title2);
title5.Name = "Title1";
chartCPU.Titles.Add(title5);
//
// chartMid
//
chartArea3.Name = "ChartArea3";
chartMid.ChartAreas.Add(chartArea3);
chartArea6.Name = "ChartArea3";
chartMid.ChartAreas.Add(chartArea6);
chartMid.Dock = DockStyle.Fill;
chartMid.Location = new Point(2, 670);
chartMid.Location = new Point(2, 690);
chartMid.Margin = new Padding(2, 10, 2, 10);
chartMid.Name = "chartMid";
chartMid.Size = new Size(760, 312);
chartMid.Size = new Size(760, 322);
chartMid.TabIndex = 14;
chartMid.Text = "chartMid";
title3.Name = "Title3";
chartMid.Titles.Add(title3);
title6.Name = "Title3";
chartMid.Titles.Add(title6);
chartMid.Visible = false;
//
// labelFans
@@ -222,7 +247,7 @@ namespace GHelper
checkApplyFans.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
checkApplyFans.AutoSize = true;
checkApplyFans.BackColor = SystemColors.ControlLight;
checkApplyFans.Location = new Point(449, 1088);
checkApplyFans.Location = new Point(449, 1118);
checkApplyFans.Margin = new Padding(4, 2, 4, 2);
checkApplyFans.Name = "checkApplyFans";
checkApplyFans.Padding = new Padding(15, 5, 15, 5);
@@ -239,7 +264,7 @@ namespace GHelper
buttonReset.BorderColor = Color.Transparent;
buttonReset.BorderRadius = 2;
buttonReset.FlatStyle = FlatStyle.Flat;
buttonReset.Location = new Point(30, 1082);
buttonReset.Location = new Point(30, 1112);
buttonReset.Margin = new Padding(4, 2, 4, 2);
buttonReset.Name = "buttonReset";
buttonReset.Secondary = true;
@@ -262,7 +287,7 @@ namespace GHelper
panelPower.Margin = new Padding(10);
panelPower.Name = "panelPower";
panelPower.Padding = new Padding(10);
panelPower.Size = new Size(364, 1159);
panelPower.Size = new Size(364, 1189);
panelPower.TabIndex = 13;
//
// pictureBox1
@@ -286,14 +311,14 @@ namespace GHelper
labelPowerLimits.Name = "labelPowerLimits";
labelPowerLimits.Size = new Size(229, 32);
labelPowerLimits.TabIndex = 26;
labelPowerLimits.Text = Properties.Strings.PowerLimits;
labelPowerLimits.Text = "Power Limits (PPT)";
//
// checkApplyPower
//
checkApplyPower.Anchor = AnchorStyles.Bottom | AnchorStyles.Left;
checkApplyPower.AutoSize = true;
checkApplyPower.BackColor = SystemColors.ControlLight;
checkApplyPower.Location = new Point(20, 1088);
checkApplyPower.Location = new Point(20, 1118);
checkApplyPower.Margin = new Padding(4, 2, 4, 2);
checkApplyPower.Name = "checkApplyPower";
checkApplyPower.Padding = new Padding(15, 5, 15, 5);
@@ -351,7 +376,7 @@ namespace GHelper
// panelTotal
//
panelTotal.Controls.Add(labelTotal);
panelTotal.Controls.Add(label1);
panelTotal.Controls.Add(labelPlatform);
panelTotal.Controls.Add(trackTotal);
panelTotal.Location = new Point(16, 72);
panelTotal.Margin = new Padding(4);
@@ -370,16 +395,16 @@ namespace GHelper
labelTotal.Text = "Platform";
labelTotal.TextAlign = ContentAlignment.MiddleCenter;
//
// label1
// labelPlatform
//
label1.AutoSize = true;
label1.Location = new Point(26, 8);
label1.Margin = new Padding(4, 0, 4, 0);
label1.Name = "label1";
label1.Size = new Size(104, 32);
label1.TabIndex = 11;
label1.Text = "Platform";
label1.TextAlign = ContentAlignment.MiddleCenter;
labelPlatform.AutoSize = true;
labelPlatform.Location = new Point(26, 8);
labelPlatform.Margin = new Padding(4, 0, 4, 0);
labelPlatform.Name = "labelPlatform";
labelPlatform.Size = new Size(104, 32);
labelPlatform.TabIndex = 11;
labelPlatform.Text = "Platform";
labelPlatform.TextAlign = ContentAlignment.MiddleCenter;
//
// trackTotal
//
@@ -418,15 +443,133 @@ namespace GHelper
labelInfo.TabIndex = 19;
labelInfo.Text = "label";
//
// labelFansResult
// panelGPU
//
labelFansResult.Anchor = AnchorStyles.Top | AnchorStyles.Right;
labelFansResult.ForeColor = Color.Red;
labelFansResult.Location = new Point(30, 1070);
labelFansResult.Name = "labelFansResult";
labelFansResult.Size = new Size(760, 32);
labelFansResult.TabIndex = 41;
labelFansResult.TextAlign = ContentAlignment.TopRight;
panelGPU.Controls.Add(buttonResetGPU);
panelGPU.Controls.Add(labelGPUMemory);
panelGPU.Controls.Add(trackGPUMemory);
panelGPU.Controls.Add(labelGPUMemoryTitle);
panelGPU.Controls.Add(pictureBox2);
panelGPU.Controls.Add(labelGPUCore);
panelGPU.Controls.Add(labelGPU);
panelGPU.Controls.Add(trackGPUCore);
panelGPU.Controls.Add(labelGPUCoreTitle);
panelGPU.Dock = DockStyle.Left;
panelGPU.Location = new Point(1188, 0);
panelGPU.Name = "panelGPU";
panelGPU.Size = new Size(347, 1189);
panelGPU.TabIndex = 14;
//
// buttonResetGPU
//
buttonResetGPU.Activated = false;
buttonResetGPU.Anchor = AnchorStyles.Bottom | AnchorStyles.Left;
buttonResetGPU.BackColor = SystemColors.ControlLight;
buttonResetGPU.BorderColor = Color.Transparent;
buttonResetGPU.BorderRadius = 2;
buttonResetGPU.FlatStyle = FlatStyle.Flat;
buttonResetGPU.Location = new Point(48, 1110);
buttonResetGPU.Margin = new Padding(4, 2, 4, 2);
buttonResetGPU.Name = "buttonResetGPU";
buttonResetGPU.Secondary = true;
buttonResetGPU.Size = new Size(232, 54);
buttonResetGPU.TabIndex = 43;
buttonResetGPU.Text = "Reset Clocks";
buttonResetGPU.UseVisualStyleBackColor = false;
//
// labelGPUMemory
//
labelGPUMemory.AutoSize = true;
labelGPUMemory.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point);
labelGPUMemory.Location = new Point(184, 112);
labelGPUMemory.Name = "labelGPUMemory";
labelGPUMemory.Size = new Size(130, 32);
labelGPUMemory.TabIndex = 42;
labelGPUMemory.Text = "2000 MHz";
labelGPUMemory.TextAlign = ContentAlignment.MiddleCenter;
//
// trackGPUMemory
//
trackGPUMemory.LargeChange = 100;
trackGPUMemory.Location = new Point(216, 160);
trackGPUMemory.Margin = new Padding(4, 2, 4, 2);
trackGPUMemory.Maximum = 300;
trackGPUMemory.Name = "trackGPUMemory";
trackGPUMemory.Orientation = Orientation.Vertical;
trackGPUMemory.Size = new Size(90, 454);
trackGPUMemory.SmallChange = 10;
trackGPUMemory.TabIndex = 41;
trackGPUMemory.TickFrequency = 50;
//
// labelGPUMemoryTitle
//
labelGPUMemoryTitle.AutoSize = true;
labelGPUMemoryTitle.Location = new Point(167, 72);
labelGPUMemoryTitle.Name = "labelGPUMemoryTitle";
labelGPUMemoryTitle.Size = new Size(169, 32);
labelGPUMemoryTitle.TabIndex = 40;
labelGPUMemoryTitle.Text = "Memory Clock";
labelGPUMemoryTitle.TextAlign = ContentAlignment.MiddleCenter;
//
// pictureBox2
//
pictureBox2.BackgroundImage = Properties.Resources.icons8_video_card_48;
pictureBox2.BackgroundImageLayout = ImageLayout.Zoom;
pictureBox2.ErrorImage = null;
pictureBox2.InitialImage = null;
pictureBox2.Location = new Point(25, 17);
pictureBox2.Margin = new Padding(4, 2, 4, 2);
pictureBox2.Name = "pictureBox2";
pictureBox2.Size = new Size(36, 38);
pictureBox2.TabIndex = 39;
pictureBox2.TabStop = false;
//
// labelGPUCore
//
labelGPUCore.AutoSize = true;
labelGPUCore.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point);
labelGPUCore.Location = new Point(20, 112);
labelGPUCore.Name = "labelGPUCore";
labelGPUCore.Size = new Size(130, 32);
labelGPUCore.TabIndex = 28;
labelGPUCore.Text = "1500 MHz";
labelGPUCore.TextAlign = ContentAlignment.MiddleCenter;
//
// labelGPU
//
labelGPU.AutoSize = true;
labelGPU.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point);
labelGPU.Location = new Point(60, 19);
labelGPU.Margin = new Padding(4, 0, 4, 0);
labelGPU.Name = "labelGPU";
labelGPU.Size = new Size(162, 32);
labelGPU.TabIndex = 27;
labelGPU.Text = "GPU Settings";
//
// trackGPUCore
//
trackGPUCore.LargeChange = 100;
trackGPUCore.Location = new Point(48, 160);
trackGPUCore.Margin = new Padding(4, 2, 4, 2);
trackGPUCore.Maximum = 300;
trackGPUCore.Name = "trackGPUCore";
trackGPUCore.Orientation = Orientation.Vertical;
trackGPUCore.RightToLeft = RightToLeft.No;
trackGPUCore.Size = new Size(90, 454);
trackGPUCore.SmallChange = 10;
trackGPUCore.TabIndex = 17;
trackGPUCore.TickFrequency = 50;
trackGPUCore.TickStyle = TickStyle.TopLeft;
//
// labelGPUCoreTitle
//
labelGPUCoreTitle.AutoSize = true;
labelGPUCoreTitle.Location = new Point(22, 72);
labelGPUCoreTitle.Name = "labelGPUCoreTitle";
labelGPUCoreTitle.Size = new Size(129, 32);
labelGPUCoreTitle.TabIndex = 16;
labelGPUCoreTitle.Text = "Core Clock";
labelGPUCoreTitle.TextAlign = ContentAlignment.MiddleCenter;
//
// Fans
//
@@ -434,19 +577,20 @@ namespace GHelper
AutoScaleMode = AutoScaleMode.Dpi;
AutoSize = true;
AutoSizeMode = AutoSizeMode.GrowAndShrink;
ClientSize = new Size(1178, 1159);
ClientSize = new Size(1542, 1189);
Controls.Add(panelGPU);
Controls.Add(panelFans);
Controls.Add(panelPower);
Margin = new Padding(4, 2, 4, 2);
MaximizeBox = false;
MdiChildrenMinimizedAnchorBottom = false;
MinimizeBox = false;
MinimumSize = new Size(26, 1230);
MinimumSize = new Size(26, 1260);
Name = "Fans";
ShowIcon = false;
ShowInTaskbar = false;
StartPosition = FormStartPosition.CenterScreen;
Text = Properties.Strings.FansAndPower;
Text = "Fans and Power";
panelFans.ResumeLayout(false);
panelFans.PerformLayout();
((System.ComponentModel.ISupportInitialize)picturePerf).EndInit();
@@ -464,6 +608,11 @@ namespace GHelper
panelTotal.PerformLayout();
((System.ComponentModel.ISupportInitialize)trackTotal).EndInit();
((System.ComponentModel.ISupportInitialize)pictureFine).EndInit();
panelGPU.ResumeLayout(false);
panelGPU.PerformLayout();
((System.ComponentModel.ISupportInitialize)trackGPUMemory).EndInit();
((System.ComponentModel.ISupportInitialize)pictureBox2).EndInit();
((System.ComponentModel.ISupportInitialize)trackGPUCore).EndInit();
ResumeLayout(false);
}
@@ -479,7 +628,7 @@ namespace GHelper
private TrackBar trackCPU;
private Panel panelTotal;
private Label labelTotal;
private Label label1;
private Label labelPlatform;
private TrackBar trackTotal;
private PictureBox pictureFine;
private Label labelInfo;
@@ -495,5 +644,15 @@ namespace GHelper
private Label labelBoost;
private Label labelTip;
private Label labelFansResult;
private Panel panelGPU;
private Label labelGPUCore;
private Label labelGPU;
private TrackBar trackGPUCore;
private Label labelGPUCoreTitle;
private PictureBox pictureBox2;
private Label labelGPUMemory;
private TrackBar trackGPUMemory;
private Label labelGPUMemoryTitle;
private RButton buttonResetGPU;
}
}

View File

@@ -1,6 +1,6 @@
using System.Diagnostics;
using CustomControls;
using System.Diagnostics;
using System.Windows.Forms.DataVisualization.Charting;
using CustomControls;
namespace GHelper
{
@@ -17,13 +17,21 @@ namespace GHelper
{
InitializeComponent();
Text = Properties.Strings.FansAndPower;
labelPowerLimits.Text = Properties.Strings.PowerLimits;
labelInfo.Text = Properties.Strings.PPTExperimental;
checkApplyPower.Text = Properties.Strings.ApplyPowerLimits;
labelFans.Text = Properties.Strings.FanCurves;
labelBoost.Text = Properties.Strings.CPUBoost;
buttonReset.Text = Properties.Strings.FactoryDefaults;
checkApplyFans.Text = Properties.Strings.ApplyFanCurve;
InitTheme();
MinRPM = 18;
MaxRPM = HardwareMonitor.GetFanMax();
labelTip.Visible = false;
labelTip.BackColor = Color.Transparent;
@@ -63,8 +71,14 @@ namespace GHelper
checkApplyFans.Click += CheckApplyFans_Click;
checkApplyPower.Click += CheckApplyPower_Click;
trackGPUCore.Scroll += trackGPU_Scroll;
trackGPUMemory.Scroll += trackGPU_Scroll;
buttonResetGPU.Click += ButtonResetGPU_Click;
//labelInfo.MaximumSize = new Size(280, 0);
labelInfo.Text = Properties.Strings.PPTExperimental;
labelFansResult.Visible = false;
InitFans();
InitPower();
@@ -74,6 +88,69 @@ namespace GHelper
Shown += Fans_Shown;
InitGPUClocks();
}
private void InitGPUClocks()
{
/*
try
{
using (var _gpuControl = new NvidiaGpuControl())
{
panelGPU.Visible = _gpuControl.IsValid;
trackGPUCore.Value = Math.Min(Program.config.getConfig("GPUCore"), 300);
trackGPUMemory.Value = Math.Min(Program.config.getConfig("GPUMemory"), 300);
VisualiseGPUClocks();
}
} catch (Exception ex)
{
panelGPU.Visible=false;
}
*/
panelGPU.Visible = false;
}
private void ButtonResetGPU_Click(object? sender, EventArgs e)
{
Program.RunAsAdmin();
try
{
trackGPUCore.Value = 0;
trackGPUMemory.Value = 0;
VisualiseGPUClocks();
}
catch (Exception ex)
{
Logger.WriteLine(ex.ToString());
}
}
private void VisualiseGPUClocks()
{
labelGPUCore.Text = $"+{trackGPUCore.Value} MHz";
labelGPUMemory.Text = $"+{trackGPUMemory.Value} MHz";
}
private void trackGPU_Scroll(object? sender, EventArgs e)
{
VisualiseGPUClocks();
try
{
Program.config.setConfig("GPUCore", trackGPUCore.Value);
Program.config.setConfig("GPUMemory", trackGPUMemory.Value);
}
catch (Exception ex)
{
Logger.WriteLine(ex.ToString());
}
}
static string ChartPercToRPM(int percentage, string unit = "")
@@ -206,6 +283,7 @@ namespace GHelper
public void LabelFansResult(string text)
{
labelFansResult.Text = text;
labelFansResult.Visible = (text.Length > 0);
}
private void Fans_FormClosing(object? sender, FormClosingEventArgs e)
@@ -232,7 +310,7 @@ namespace GHelper
// Yes, that's stupid, but Total slider on 2021 model actually adjusts CPU PPT
if (!cpuBmode)
{
label1.Text = "CPU SPPT";
labelPlatform.Text = "CPU SPPT";
}
int limit_total;
@@ -531,6 +609,7 @@ namespace GHelper
}
}
}
}
}

View File

@@ -13,26 +13,26 @@
<Platforms>AnyCPU;x64</Platforms>
<SupportedOSPlatformVersion>8.0</SupportedOSPlatformVersion>
<AssemblyName>GHelper</AssemblyName>
<PlatformTarget>x64</PlatformTarget>
<PlatformTarget>AnyCPU</PlatformTarget>
<ProduceReferenceAssembly>False</ProduceReferenceAssembly>
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
<AssemblyVersion>0.53</AssemblyVersion>
<AssemblyVersion>0.57</AssemblyVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DebugType>none</DebugType>
<DebugType>embedded</DebugType>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<DebugType>none</DebugType>
<DebugType>embedded</DebugType>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<DebugType>none</DebugType>
<DebugType>embedded</DebugType>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<DebugType>none</DebugType>
<DebugType>embedded</DebugType>
</PropertyGroup>
<ItemGroup>

View File

@@ -20,8 +20,8 @@ Global
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{D6138BB1-8FDB-4835-87EF-2FE41A3DD604}.Debug|Any CPU.ActiveCfg = Debug|x64
{D6138BB1-8FDB-4835-87EF-2FE41A3DD604}.Debug|Any CPU.Build.0 = Debug|x64
{D6138BB1-8FDB-4835-87EF-2FE41A3DD604}.Debug|x64.ActiveCfg = Debug|x64
{D6138BB1-8FDB-4835-87EF-2FE41A3DD604}.Debug|x64.Build.0 = Debug|x64
{D6138BB1-8FDB-4835-87EF-2FE41A3DD604}.Debug|x64.ActiveCfg = Debug|Any CPU
{D6138BB1-8FDB-4835-87EF-2FE41A3DD604}.Debug|x64.Build.0 = Debug|Any CPU
{D6138BB1-8FDB-4835-87EF-2FE41A3DD604}.Release|Any CPU.ActiveCfg = Release|x64
{D6138BB1-8FDB-4835-87EF-2FE41A3DD604}.Release|Any CPU.Build.0 = Release|x64
{D6138BB1-8FDB-4835-87EF-2FE41A3DD604}.Release|x64.ActiveCfg = Release|x64

View File

@@ -4,12 +4,15 @@ using AmdAdl2;
namespace GHelper.Gpu;
// Reference: https://github.com/GPUOpen-LibrariesAndSDKs/display-library/blob/master/Sample-Managed/Program.cs
public class AmdGpuTemperatureProvider : IGpuTemperatureProvider {
public class AmdGpuControl : IGpuControl {
private bool _isReady;
private IntPtr _adlContextHandle;
private readonly ADLAdapterInfo _internalDiscreteAdapter;
public AmdGpuTemperatureProvider() {
public bool IsNvidia => false;
public AmdGpuControl() {
if (!Adl2.Load())
return;
@@ -104,7 +107,7 @@ public class AmdGpuTemperatureProvider : IGpuTemperatureProvider {
GC.SuppressFinalize(this);
}
~AmdGpuTemperatureProvider() {
~AmdGpuControl() {
ReleaseUnmanagedResources();
}
}

View File

@@ -1,6 +1,7 @@
namespace GHelper.Gpu;
public interface IGpuTemperatureProvider : IDisposable {
public interface IGpuControl : IDisposable {
bool IsNvidia { get; }
bool IsValid { get; }
int? GetCurrentTemperature();
int? GetGpuUse();

View File

@@ -5,17 +5,19 @@ using NvAPIWrapper.Native.Interfaces.GPU;
namespace GHelper.Gpu;
public class NvidiaGpuTemperatureProvider : IGpuTemperatureProvider
public class NvidiaGpuControl : IGpuControl
{
private readonly PhysicalGPU? _internalGpu;
public NvidiaGpuTemperatureProvider()
public NvidiaGpuControl()
{
_internalGpu = GetInternalDiscreteGpu();
}
public bool IsValid => _internalGpu != null;
public bool IsNvidia => IsValid;
public int? GetCurrentTemperature()
{
if (!IsValid)
@@ -54,14 +56,9 @@ public class NvidiaGpuTemperatureProvider : IGpuTemperatureProvider
return null;
PhysicalGPU internalGpu = _internalGpu!;
IUtilizationDomainInfo? gpuUsage = GPUApi.GetUsages(internalGpu.Handle).GPU;
if (gpuUsage == null)
return null;
return
(int)gpuUsage?.Percentage;
return (int?)gpuUsage?.Percentage;
}

View File

@@ -1,11 +1,10 @@
using GHelper;
using GHelper.Gpu;
using System.Diagnostics;
using System.Management;
public static class HardwareMonitor
{
private static IGpuTemperatureProvider? GpuTemperatureProvider;
public static IGpuControl? GpuControl;
public static float? cpuTemp = -1;
public static float? batteryDischarge = -1;
@@ -51,7 +50,7 @@ public static class HardwareMonitor
{
try
{
int? gpuUse = GpuTemperatureProvider?.GetGpuUse();
int? gpuUse = GpuControl?.GetGpuUse();
if (gpuUse is not null) return (int)gpuUse;
}
catch (Exception ex)
@@ -76,20 +75,20 @@ public static class HardwareMonitor
cpuTemp = Program.wmi.DeviceGet(ASUSWmi.Temp_CPU);
if (cpuTemp < 0) try
{
using (var ct = new PerformanceCounter("Thermal Zone Information", "Temperature", @"\_TZ.THRM", true))
{
cpuTemp = ct.NextValue() - 273;
using (var ct = new PerformanceCounter("Thermal Zone Information", "Temperature", @"\_TZ.THRM", true))
{
cpuTemp = ct.NextValue() - 273;
}
}
catch
{
Debug.WriteLine("Failed reading CPU temp");
}
}
catch
{
Debug.WriteLine("Failed reading CPU temp");
}
try
{
gpuTemp = GpuTemperatureProvider?.GetCurrentTemperature();
gpuTemp = GpuControl?.GetCurrentTemperature();
}
catch (Exception ex)
@@ -121,51 +120,53 @@ public static class HardwareMonitor
{
Thread.Sleep(1000);
return (GetGpuUse() > threshold);
}
}
return false;
}
public static void RecreateGpuTemperatureProviderWithDelay()
public static void RecreateGpuControlWithDelay(int delay = 5)
{
// Re-enabling the discrete GPU takes a bit of time,
// so a simple workaround is to refresh again after that happens
Task.Run(async () =>
{
await Task.Delay(TimeSpan.FromSeconds(5));
RecreateGpuTemperatureProvider();
await Task.Delay(TimeSpan.FromSeconds(delay));
RecreateGpuControl();
});
}
public static void RecreateGpuTemperatureProvider()
public static void RecreateGpuControl()
{
try
{
GpuTemperatureProvider?.Dispose();
GpuControl?.Dispose();
// Detect valid GPU temperature provider.
// We start with NVIDIA because there's always at least an integrated AMD GPU
IGpuTemperatureProvider gpuTemperatureProvider = new NvidiaGpuTemperatureProvider();
if (gpuTemperatureProvider.IsValid)
IGpuControl _gpuControl = new NvidiaGpuControl();
if (_gpuControl.IsValid)
{
GpuTemperatureProvider = gpuTemperatureProvider;
GpuControl = _gpuControl;
return;
}
gpuTemperatureProvider.Dispose();
gpuTemperatureProvider = new AmdGpuTemperatureProvider();
if (gpuTemperatureProvider.IsValid)
_gpuControl.Dispose();
/*
_gpuControl = new AmdGpuControl();
if (_gpuControl.IsValid)
{
GpuTemperatureProvider = gpuTemperatureProvider;
GpuControl = _gpuControl;
return;
}
_gpuControl.Dispose();
*/
gpuTemperatureProvider.Dispose();
GpuTemperatureProvider = null;
GpuControl = null;
}
catch (Exception ex)
{

View File

@@ -351,6 +351,33 @@ namespace Tools
public class NativeMethods
{
private const int WM_SYSCOMMAND = 0x0112;
private const int SC_MONITORPOWER = 0xF170;
private const int MONITOR_OFF = 2;
[DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)]
private static extern IntPtr SendMessage(IntPtr hWnd, uint Msg, IntPtr wParam, IntPtr lParam);
[DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)]
private static extern uint FormatMessage(uint dwFlags, IntPtr lpSource, uint dwMessageId, uint dwLanguageId, out string lpBuffer, uint nSize, IntPtr Arguments);
public static void TurnOffScreen(IntPtr handle)
{
IntPtr result = SendMessage(handle, WM_SYSCOMMAND, (IntPtr)SC_MONITORPOWER, (IntPtr)MONITOR_OFF);
if (result == IntPtr.Zero)
{
int error = Marshal.GetLastWin32Error();
string message = "";
uint formatFlags = 0x00001000 | 0x00000200 | 0x00000100 | 0x00000080;
uint formatResult = FormatMessage(formatFlags, IntPtr.Zero, (uint)error, 0, out message, 0, IntPtr.Zero);
if (formatResult == 0)
{
message = "Unknown error.";
}
Logger.WriteLine($"Failed to turn off screen. Error code: {error}. {message}");
}
}
// Monitor Power detection
internal const uint DEVICE_NOTIFY_WINDOW_HANDLE = 0x0;

View File

@@ -2,10 +2,44 @@ using Microsoft.Win32;
using System.Diagnostics;
using System.Globalization;
using System.Management;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Security.Principal;
using Tools;
namespace GHelper
{
class CustomContextMenu : ContextMenuStrip
{
[DllImport("dwmapi.dll", CharSet = CharSet.Unicode, SetLastError = true)]
private static extern long DwmSetWindowAttribute(IntPtr hwnd,
DWMWINDOWATTRIBUTE attribute,
ref DWM_WINDOW_CORNER_PREFERENCE pvAttribute,
uint cbAttribute);
public CustomContextMenu()
{
var preference = DWM_WINDOW_CORNER_PREFERENCE.DWMWCP_ROUNDSMALL; //change as you want
DwmSetWindowAttribute(Handle,
DWMWINDOWATTRIBUTE.DWMWA_WINDOW_CORNER_PREFERENCE,
ref preference,
sizeof(uint));
}
public enum DWMWINDOWATTRIBUTE
{
DWMWA_WINDOW_CORNER_PREFERENCE = 33
}
public enum DWM_WINDOW_CORNER_PREFERENCE
{
DWMWA_DEFAULT = 0,
DWMWCP_DONOTROUND = 1,
DWMWCP_ROUND = 2,
DWMWCP_ROUNDSMALL = 3,
}
}
static class Program
{
public static NotifyIcon trayIcon = new NotifyIcon
@@ -27,23 +61,62 @@ namespace GHelper
private static long lastTheme;
private static PowerLineStatus isPlugged = PowerLineStatus.Unknown;
static void CheckProcesses()
{
Process currentProcess = Process.GetCurrentProcess();
Process[] processes = Process.GetProcessesByName(currentProcess.ProcessName);
if (processes.Length > 1)
{
foreach (Process process in processes)
if (process.Id != currentProcess.Id)
try
{
process.Kill();
}
catch (Exception ex)
{
Logger.WriteLine(ex.ToString());
MessageBox.Show(Properties.Strings.AppAlreadyRunningText, Properties.Strings.AppAlreadyRunning, MessageBoxButtons.OK);
Application.Exit();
return;
}
}
}
static bool IsUserAdministrator()
{
WindowsIdentity identity = WindowsIdentity.GetCurrent();
WindowsPrincipal principal = new WindowsPrincipal(identity);
return principal.IsInRole(WindowsBuiltInRole.Administrator);
}
public static void RunAsAdmin()
{
// Check if the current user is an administrator
if (!IsUserAdministrator())
{
ProcessStartInfo startInfo = new ProcessStartInfo();
startInfo.UseShellExecute = true;
startInfo.WorkingDirectory = Environment.CurrentDirectory;
startInfo.FileName = Application.ExecutablePath;
startInfo.Verb = "runas";
Process.Start(startInfo);
//Application.Exit();
}
}
// The main entry point for the application
public static void Main()
{
Thread.CurrentThread.CurrentUICulture = CultureInfo.CurrentUICulture;
Debug.WriteLine(CultureInfo.CurrentUICulture);
//Thread.CurrentThread.CurrentUICulture = CultureInfo.CreateSpecificCulture("zh");
if (Process.GetProcesses().Count(p => p.ProcessName == "GHelper") > 1)
{
MessageBox.Show(Properties.Strings.AppAlreadyRunningText, Properties.Strings.AppAlreadyRunning, MessageBoxButtons.OK);
Application.Exit();
return;
}
CheckProcesses();
try
{
@@ -62,10 +135,8 @@ namespace GHelper
}
Logger.WriteLine("------------");
Logger.WriteLine("App launched: " + config.GetModel());
Logger.WriteLine("App launched: " + config.GetModel() + " :" + Assembly.GetExecutingAssembly().GetName().Version.ToString());
Application.EnableVisualStyles();
@@ -82,7 +153,7 @@ namespace GHelper
SetAutoModes();
HardwareMonitor.RecreateGpuTemperatureProvider();
HardwareMonitor.RecreateGpuControl();
// Subscribing for system power change events
SystemEvents.PowerModeChanged += SystemEvents_PowerModeChanged;
@@ -101,14 +172,12 @@ namespace GHelper
SettingsToggle();
}
Application.Run();
}
static void SystemEvents_UserPreferenceChanged(object sender, UserPreferenceChangedEventArgs e)
{
@@ -139,7 +208,7 @@ namespace GHelper
public static void SetAutoModes()
{
if (Math.Abs(DateTimeOffset.Now.ToUnixTimeMilliseconds() - lastAuto) < 2000) return;
if (Math.Abs(DateTimeOffset.Now.ToUnixTimeMilliseconds() - lastAuto) < 3000) return;
lastAuto = DateTimeOffset.Now.ToUnixTimeMilliseconds();
isPlugged = SystemInformation.PowerStatus.PowerLineStatus;
@@ -169,19 +238,18 @@ namespace GHelper
}
static void LaunchProcess(string fileName = "")
static void LaunchProcess(string command = "")
{
ProcessStartInfo start = new ProcessStartInfo();
start.FileName = fileName;
start.WindowStyle = ProcessWindowStyle.Hidden;
start.CreateNoWindow = true;
string executable = command.Split(' ')[0];
string arguments = command.Substring(executable.Length).Trim();
try
{
Process proc = Process.Start(start);
Process proc = Process.Start(executable, arguments);
}
catch
{
Logger.WriteLine("Failed to run " + fileName);
Logger.WriteLine("Failed to run " + command);
}
@@ -216,7 +284,7 @@ namespace GHelper
if (action is null || action.Length <= 1)
{
if (name == "m4")
action = "performance";
action = "ghelper";
if (name == "fnf4")
action = "aura";
}
@@ -232,6 +300,12 @@ namespace GHelper
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;
@@ -295,10 +369,11 @@ namespace GHelper
static void TrayIcon_MouseClick(object? sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Left || e.Button == MouseButtons.Right)
if (e.Button == MouseButtons.Left)
{
SettingsToggle();
}
}

View File

@@ -330,6 +330,16 @@ namespace GHelper.Properties {
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap icons8_video_48 {
get {
object obj = ResourceManager.GetObject("icons8_video_48", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>

View File

@@ -211,4 +211,7 @@
<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>
</data>
<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>
</data>
</root>

View File

@@ -294,6 +294,15 @@ namespace GHelper.Properties {
}
}
/// <summary>
/// Looks up a localized string similar to Brightness.
/// </summary>
internal static string Brightness {
get {
return ResourceManager.GetString("Brightness", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Color.
/// </summary>
@@ -690,6 +699,15 @@ namespace GHelper.Properties {
}
}
/// <summary>
/// Looks up a localized string similar to Keep GPU disabled on USB-C charger in Optimized mode.
/// </summary>
internal static string OptimizedUSBC {
get {
return ResourceManager.GetString("OptimizedUSBC", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Other.
/// </summary>
@@ -852,6 +870,24 @@ namespace GHelper.Properties {
}
}
/// <summary>
/// Looks up a localized string similar to Toggle Miniled (if supported).
/// </summary>
internal static string ToggleMiniled {
get {
return ResourceManager.GetString("ToggleMiniled", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Toggle Screen.
/// </summary>
internal static string ToggleScreen {
get {
return ResourceManager.GetString("ToggleScreen", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Turbo.
/// </summary>

View File

@@ -136,7 +136,7 @@
<value>¿Reiniciar ahora?</value>
</data>
<data name="AnimationSpeed" xml:space="preserve">
<value>Velocidad de animación</value>
<value>Velocidad</value>
</data>
<data name="AnimeMatrix" xml:space="preserve">
<value>Anime Matrix</value>
@@ -195,6 +195,9 @@
<data name="Boot" xml:space="preserve">
<value>Al arrancar</value>
</data>
<data name="Brightness" xml:space="preserve">
<value>Brillo</value>
</data>
<data name="Color" xml:space="preserve">
<value>Color</value>
</data>
@@ -327,6 +330,9 @@
<data name="OptimizedGPUTooltip" xml:space="preserve">
<value>Cambia a Eco con batería y a Estándar cuando está enchufado</value>
</data>
<data name="OptimizedUSBC" xml:space="preserve">
<value>Deshabilitar dGPU con cargador USB-C en modo Optimizado</value>
</data>
<data name="Other" xml:space="preserve">
<value>Otro</value>
</data>
@@ -381,6 +387,12 @@
<data name="ToggleAura" xml:space="preserve">
<value>Alternar Aura</value>
</data>
<data name="ToggleMiniled" xml:space="preserve">
<value>Alternar Miniled (si es compatible)</value>
</data>
<data name="ToggleScreen" xml:space="preserve">
<value>Alternar pantalla</value>
</data>
<data name="Turbo" xml:space="preserve">
<value>Turbo</value>
</data>

View File

@@ -1,5 +1,64 @@
<?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:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
@@ -136,6 +195,9 @@
<data name="Boot" xml:space="preserve">
<value>Boot</value>
</data>
<data name="Brightness" xml:space="preserve">
<value>Brightness</value>
</data>
<data name="Color" xml:space="preserve">
<value>Color</value>
</data>
@@ -268,6 +330,9 @@
<data name="OptimizedGPUTooltip" xml:space="preserve">
<value>Switch to Eco on battery and to Standard when plugged</value>
</data>
<data name="OptimizedUSBC" xml:space="preserve">
<value>Keep GPU disabled on USB-C charger in Optimized mode</value>
</data>
<data name="Other" xml:space="preserve">
<value>Other</value>
</data>
@@ -322,6 +387,12 @@
<data name="ToggleAura" xml:space="preserve">
<value>Toggle Aura</value>
</data>
<data name="ToggleMiniled" xml:space="preserve">
<value>Toggle Miniled (if supported)</value>
</data>
<data name="ToggleScreen" xml:space="preserve">
<value>Toggle Screen</value>
</data>
<data name="Turbo" xml:space="preserve">
<value>Turbo</value>
</data>

View File

@@ -195,6 +195,9 @@
<data name="Boot" xml:space="preserve">
<value>Önyükleme</value>
</data>
<data name="Brightness" xml:space="preserve">
<value>Parlaklığı</value>
</data>
<data name="Color" xml:space="preserve">
<value>Renk</value>
</data>

View File

@@ -195,6 +195,9 @@
<data name="Boot" xml:space="preserve">
<value>Старт</value>
</data>
<data name="Brightness" xml:space="preserve">
<value>Яскравість</value>
</data>
<data name="Color" xml:space="preserve">
<value>Колір</value>
</data>

View File

@@ -118,7 +118,7 @@
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="ACPIError" xml:space="preserve">
<value>无法连接到ASUS ACPI。 没有它应用程序将无法运行。 请尝试安装Asus System Control Interface驱动。</value>
<value>无法连接到ASUS ACPI。 没有它应用程序将无法运行。 请尝试安装Asus System Control Interface驱动。</value>
</data>
<data name="AlertDGPU" xml:space="preserve">
<value>看起来 GPU 正在大量耗电,是否禁用?</value>
@@ -142,7 +142,7 @@
<value>Anime Matrix 光显矩阵屏</value>
</data>
<data name="AppAlreadyRunning" xml:space="preserve">
<value>应用已经运行</value>
<value>应用已经运行</value>
</data>
<data name="AppAlreadyRunningText" xml:space="preserve">
<value>G-Helper已经在运行。 请查看系统托盘中的图标。</value>
@@ -187,7 +187,7 @@
<value>唤醒时</value>
</data>
<data name="Balanced" xml:space="preserve">
<value>平衡</value>
<value>平衡模式</value>
</data>
<data name="BatteryChargeLimit" xml:space="preserve">
<value>电池充电限制</value>
@@ -195,6 +195,9 @@
<data name="Boot" xml:space="preserve">
<value>开机时</value>
</data>
<data name="Brightness" xml:space="preserve">
<value>亮度</value>
</data>
<data name="Color" xml:space="preserve">
<value>颜色</value>
</data>
@@ -256,7 +259,7 @@
<value>切换中...</value>
</data>
<data name="GPUMode" xml:space="preserve">
<value>显模式</value>
<value>显模式</value>
</data>
<data name="GPUModeEco" xml:space="preserve">
<value>仅限核显</value>
@@ -265,7 +268,7 @@
<value>核显 + 独显</value>
</data>
<data name="GPUModeUltimate" xml:space="preserve">
<value>独显优先</value>
<value>独显直连</value>
</data>
<data name="KeyBindings" xml:space="preserve">
<value>按键绑定</value>
@@ -280,10 +283,10 @@
<value>键盘背光</value>
</data>
<data name="LaptopKeyboard" xml:space="preserve">
<value>键盘</value>
<value>笔记本键盘</value>
</data>
<data name="LaptopScreen" xml:space="preserve">
<value>屏幕显示</value>
<value>笔记本屏幕</value>
</data>
<data name="MatrixBanner" xml:space="preserve">
<value>Anime Matrix 标识</value>
@@ -325,7 +328,7 @@
<value>自动切换</value>
</data>
<data name="OptimizedGPUTooltip" xml:space="preserve">
<value>使用电池时关闭独显(集显模式),并在插上电源后重新启用独显(混合输出)</value>
<value>使用电池时切换到集显模式,并在插上电源后重新启用标准模式</value>
</data>
<data name="Other" xml:space="preserve">
<value>其他</value>
@@ -382,7 +385,7 @@
<value>切换 Aura 模式</value>
</data>
<data name="Turbo" xml:space="preserve">
<value>增强</value>
<value>增强模式</value>
</data>
<data name="TurnedOff" xml:space="preserve">
<value>已关闭</value>
@@ -394,7 +397,7 @@
<value>开启独显直连获得最佳帧率</value>
</data>
<data name="UltimateMode" xml:space="preserve">
<value>独显输出</value>
<value>独显直连</value>
</data>
<data name="VersionLabel" xml:space="preserve">
<value>版本</value>
@@ -405,4 +408,4 @@
<data name="WindowTop" xml:space="preserve">
<value>窗口置顶</value>
</data>
</root>
</root>

View File

@@ -195,6 +195,9 @@
<data name="Boot" xml:space="preserve">
<value>開機時</value>
</data>
<data name="Brightness" xml:space="preserve">
<value>亮度</value>
</data>
<data name="Color" xml:space="preserve">
<value>顏色</value>
</data>
@@ -364,7 +367,7 @@
<value>關機時</value>
</data>
<data name="Silent" xml:space="preserve">
<value>安模式</value>
<value>安模式</value>
</data>
<data name="Sleep" xml:space="preserve">
<value>睡眠時</value>
@@ -405,4 +408,4 @@
<data name="WindowTop" xml:space="preserve">
<value>視窗置頂</value>
</data>
</root>
</root>

Binary file not shown.

After

Width:  |  Height:  |  Size: 635 B

View File

@@ -68,6 +68,7 @@ namespace GHelper
buttonStandard = new RButton();
buttonOptimized = new RButton();
buttonUltimate = new RButton();
buttonXGM = new RButton();
panelScreen = new Panel();
labelMidFan = new Label();
labelTipScreen = new Label();
@@ -534,19 +535,21 @@ namespace GHelper
panelGPU.Location = new Point(10, 210);
panelGPU.Margin = new Padding(8);
panelGPU.Name = "panelGPU";
panelGPU.Padding = new Padding(0, 0, 0, 10);
panelGPU.Padding = new Padding(0, 0, 0, 45);
panelGPU.Size = new Size(810, 237);
panelGPU.TabIndex = 37;
//
// labelTipGPU
//
labelTipGPU.ForeColor = SystemColors.GrayText;
labelTipGPU.Location = new Point(24, 191);
labelTipGPU.Location = new Point(44, 191);
labelTipGPU.Margin = new Padding(4, 0, 4, 0);
labelTipGPU.Name = "labelTipGPU";
labelTipGPU.Size = new Size(760, 36);
labelTipGPU.TabIndex = 20;
labelTipGPU.Text = " ";
labelTipGPU.Text = "";
labelTipGPU.Anchor = AnchorStyles.Right | AnchorStyles.Bottom;
//
// pictureGPU
//
@@ -593,6 +596,7 @@ namespace GHelper
tableGPU.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 25F));
tableGPU.Controls.Add(buttonEco, 0, 0);
tableGPU.Controls.Add(buttonStandard, 1, 0);
tableGPU.Controls.Add(buttonXGM, 2, 0);
tableGPU.Controls.Add(buttonOptimized, 2, 0);
tableGPU.Controls.Add(buttonUltimate, 2, 0);
tableGPU.Location = new Point(16, 60);
@@ -691,6 +695,30 @@ namespace GHelper
buttonUltimate.Text = Properties.Strings.UltimateMode;
buttonUltimate.TextImageRelation = TextImageRelation.ImageAboveText;
buttonUltimate.UseVisualStyleBackColor = false;
//
// buttonXGM
//
buttonXGM.Activated = false;
buttonXGM.BackColor = SystemColors.ControlLightLight;
buttonXGM.BorderColor = Color.Transparent;
buttonXGM.BorderRadius = 5;
buttonXGM.Dock = DockStyle.Top;
buttonXGM.FlatAppearance.BorderSize = 0;
buttonXGM.FlatStyle = FlatStyle.Flat;
buttonXGM.ForeColor = SystemColors.ControlText;
buttonXGM.Image = Properties.Resources.icons8_video_48;
buttonXGM.ImageAlign = ContentAlignment.BottomCenter;
buttonXGM.Location = new Point(390, 4);
buttonXGM.Margin = new Padding(4);
buttonXGM.Name = "buttonXGM";
buttonXGM.Secondary = false;
buttonXGM.Size = new Size(185, 120);
buttonXGM.TabIndex = 2;
buttonXGM.Text = "XG Mobile";
buttonXGM.TextImageRelation = TextImageRelation.ImageAboveText;
buttonXGM.UseVisualStyleBackColor = false;
buttonXGM.Visible = false;
//
// panelScreen
//
@@ -1078,6 +1106,7 @@ namespace GHelper
private Label labelGPU;
private Label labelGPUFan;
private TableLayoutPanel tableGPU;
private RButton buttonXGM;
private RButton buttonUltimate;
private RButton buttonStandard;
private RButton buttonEco;

View File

@@ -1,11 +1,11 @@
using CustomControls;
using Starlight.AnimeMatrix;
using System;
using System.Diagnostics;
using System.Drawing.Imaging;
using System.Globalization;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Text.Json;
using System.Threading;
using System.Timers;
using Tools;
@@ -15,6 +15,9 @@ namespace GHelper
public partial class SettingsForm : RForm
{
private ContextMenuStrip contextMenuStrip = new CustomContextMenu();
private ToolStripMenuItem menuSilent, menuBalanced, menuTurbo, menuEco, menuStandard, menuUltimate, menuOptimized;
public static System.Timers.Timer aTimer = default!;
public static Point trayPoint;
@@ -25,7 +28,7 @@ namespace GHelper
public string perfName = "Balanced";
public Fans fans;
public Keyboard keyb;
public Extra keyb;
static AnimeMatrixDevice mat;
static long lastRefresh;
@@ -50,6 +53,7 @@ namespace GHelper
buttonStandard.BorderColor = colorStandard;
buttonUltimate.BorderColor = colorTurbo;
buttonOptimized.BorderColor = colorEco;
buttonXGM.BorderColor = colorTurbo;
button60Hz.BorderColor = SystemColors.ActiveBorder;
button120Hz.BorderColor = SystemColors.ActiveBorder;
@@ -112,6 +116,8 @@ namespace GHelper
buttonUltimate.MouseMove += ButtonUltimate_MouseHover;
buttonUltimate.MouseLeave += ButtonGPU_MouseLeave;
buttonXGM.Click += ButtonXGM_Click;
buttonScreenAuto.MouseMove += ButtonScreenAuto_MouseHover;
buttonScreenAuto.MouseLeave += ButtonScreen_MouseLeave;
@@ -126,6 +132,7 @@ namespace GHelper
aTimer = new System.Timers.Timer(1000);
aTimer.Elapsed += OnTimedEvent;
aTimer.Enabled = true;
SetVersionLabel(Properties.Strings.VersionLabel + ": " + Assembly.GetExecutingAssembly().GetName().Version);
@@ -135,7 +142,9 @@ namespace GHelper
labelModel.Text = model;
this.TopMost = Program.config.getConfig("topmost") == 1;
TopMost = Program.config.getConfig("topmost") == 1;
SetContextMenu();
Task.Run(async () =>
{
@@ -143,7 +152,125 @@ namespace GHelper
CheckForUpdatesAsync();
});
}
public void SetContextMenu()
{
contextMenuStrip.Items.Clear();
Padding padding = new Padding(5, 5, 5, 5);
/*
TableLayoutPanel[] tables = { tablePerf, tableGPU };
string[] titles = { Properties.Strings.PerformanceMode, Properties.Strings.GPUMode};
int index = 0;
foreach (TableLayoutPanel table in tables)
{
var title = new ToolStripMenuItem(titles[index]);
title.Margin = padding;
title.Enabled = false;
contextMenuStrip.Items.Add(title);
foreach (Control control in table.Controls)
{
var button = control as RButton;
if (button != null && !button.Secondary && button.Enabled)
{
var menu = new ToolStripMenuItem(button.Text);
menu.Margin = padding;
menu.Checked = button.Activated;
menu.Click += delegate { button.PerformClick(); };
contextMenuStrip.Items.Add(menu);
}
}
contextMenuStrip.Items.Add("-");
index++;
}*/
var title = new ToolStripMenuItem(Properties.Strings.PerformanceMode);
title.Margin = padding;
title.Enabled = false;
contextMenuStrip.Items.Add(title);
menuSilent = new ToolStripMenuItem(Properties.Strings.Silent);
menuSilent.Click += ButtonSilent_Click;
menuSilent.Margin = padding;
contextMenuStrip.Items.Add(menuSilent);
menuBalanced = new ToolStripMenuItem(Properties.Strings.Balanced);
menuBalanced.Click += ButtonBalanced_Click;
menuBalanced.Margin = padding;
contextMenuStrip.Items.Add(menuBalanced);
menuTurbo = new ToolStripMenuItem(Properties.Strings.Turbo);
menuTurbo.Click += ButtonTurbo_Click;
menuTurbo.Checked = true;
menuTurbo.Margin = padding;
contextMenuStrip.Items.Add(menuTurbo);
contextMenuStrip.Items.Add("-");
var titleGPU = new ToolStripMenuItem(Properties.Strings.GPUMode);
titleGPU.Margin = padding;
titleGPU.Enabled = false;
contextMenuStrip.Items.Add(titleGPU);
menuEco = new ToolStripMenuItem(Properties.Strings.EcoMode);
menuEco.Click += ButtonEco_Click;
menuEco.Margin = padding;
contextMenuStrip.Items.Add(menuEco);
menuStandard = new ToolStripMenuItem(Properties.Strings.StandardMode);
menuStandard.Click += ButtonStandard_Click;
menuStandard.Margin = padding;
contextMenuStrip.Items.Add(menuStandard);
menuUltimate = new ToolStripMenuItem(Properties.Strings.UltimateMode);
menuUltimate.Click += ButtonUltimate_Click;
menuUltimate.Margin = padding;
contextMenuStrip.Items.Add(menuUltimate);
menuOptimized = new ToolStripMenuItem(Properties.Strings.Optimized);
menuOptimized.Click += ButtonOptimized_Click;
menuOptimized.Margin = padding;
contextMenuStrip.Items.Add(menuOptimized);
contextMenuStrip.Items.Add("-");
var quit = new ToolStripMenuItem(Properties.Strings.Quit);
quit.Click += ButtonQuit_Click;
quit.Margin = padding;
contextMenuStrip.Items.Add(quit);
contextMenuStrip.ShowCheckMargin = true;
contextMenuStrip.RenderMode = ToolStripRenderMode.System;
if (CheckSystemDarkModeStatus())
{
contextMenuStrip.BackColor = this.BackColor;
contextMenuStrip.ForeColor = this.ForeColor;
}
Program.trayIcon.ContextMenuStrip = contextMenuStrip;
}
private void ButtonXGM_Click(object? sender, EventArgs e)
{
if (Program.wmi.DeviceGet(ASUSWmi.GPUXG) == 1)
{
Program.wmi.DeviceSet(ASUSWmi.GPUXG, 0, "GPU XGM");
}
else
{
Program.wmi.DeviceSet(ASUSWmi.GPUXG, 1, "GPU XGM");
}
InitXGM();
}
private void SliderBattery_ValueChanged(object? sender, EventArgs e)
@@ -171,10 +298,7 @@ namespace GHelper
if (gitVersion.CompareTo(appVersion) > 0)
{
BeginInvoke(delegate
{
SetVersionLabel(Properties.Strings.DownloadUpdate + ": " + tag, url);
});
SetVersionLabel(Properties.Strings.DownloadUpdate + ": " + tag, url);
}
else
{
@@ -402,11 +526,13 @@ namespace GHelper
}
StartMatrixTimer();
Logger.WriteLine("Matrix GIF " + fileName);
}
else
{
mat.GenerateFrame(image);
mat.Present();
Logger.WriteLine("Matrix " + fileName);
}
}
@@ -484,6 +610,7 @@ namespace GHelper
if (brightness == 0 || (auto && SystemInformation.PowerStatus.PowerLineStatus != PowerLineStatus.Online))
{
mat.SetDisplayState(false);
Logger.WriteLine("Matrix Off");
}
else
{
@@ -498,9 +625,11 @@ namespace GHelper
case 3:
mat.SetBuiltInAnimation(false);
StartMatrixTimer(1000);
Logger.WriteLine("Matrix Clock");
break;
default:
mat.SetBuiltInAnimation(true, animation);
Logger.WriteLine("Matrix builtin " + animation.AsByte);
break;
}
@@ -541,7 +670,7 @@ namespace GHelper
{
if (keyb == null || keyb.Text == "")
{
keyb = new Keyboard();
keyb = new Extra();
keyb.Show();
}
else
@@ -672,13 +801,18 @@ namespace GHelper
SetScreen(60, 0);
}
private void ButtonMiniled_Click(object? sender, EventArgs e)
public void ToogleMiniled()
{
int miniled = (Program.config.getConfig("miniled") == 1) ? 0 : 1;
Program.config.setConfig("miniled", miniled);
SetScreen(-1, -1, miniled);
}
private void ButtonMiniled_Click(object? sender, EventArgs e)
{
ToogleMiniled();
}
public void SetScreen(int frequency = -1, int overdrive = -1, int miniled = -1)
{
@@ -712,7 +846,6 @@ namespace GHelper
}
InitScreen();
}
public void InitScreen()
@@ -758,6 +891,11 @@ namespace GHelper
if (maxFrequency > 60)
{
button120Hz.Text = maxFrequency.ToString() + "Hz" + (overdriveSetting ? " + OD" : "");
panelScreen.Visible = true;
}
else if (maxFrequency > 0)
{
panelScreen.Visible = false;
}
if (miniled >= 0)
@@ -805,8 +943,7 @@ namespace GHelper
SetGPUMode(ASUSWmi.GPUModeEco);
}
private void RefreshSensors(bool force = false)
public void RefreshSensors(bool force = false)
{
if (!force && Math.Abs(DateTimeOffset.Now.ToUnixTimeMilliseconds() - lastRefresh) < 2000) return;
@@ -822,13 +959,14 @@ namespace GHelper
cpuTemp = ": " + Math.Round((decimal)HardwareMonitor.cpuTemp).ToString() + "°C ";
if (HardwareMonitor.batteryDischarge > 0)
battery = Properties.Strings.Discharging +": " + Math.Round((decimal)HardwareMonitor.batteryDischarge, 1).ToString() + "W";
battery = Properties.Strings.Discharging + ": " + Math.Round((decimal)HardwareMonitor.batteryDischarge, 1).ToString() + "W";
if (HardwareMonitor.gpuTemp > 0)
{
gpuTemp = $": {HardwareMonitor.gpuTemp}°C ";
}
Program.settingsForm.BeginInvoke(delegate
{
labelCPUFan.Text = "CPU" + cpuTemp + HardwareMonitor.cpuFan;
@@ -852,12 +990,14 @@ namespace GHelper
if (this.Visible)
{
InitScreen();
InitXGM();
this.Left = Screen.FromControl(this).WorkingArea.Width - 10 - this.Width;
this.Top = Screen.FromControl(this).WorkingArea.Height - 10 - this.Height;
this.Activate();
aTimer.Enabled = true;
}
else
{
@@ -868,7 +1008,7 @@ namespace GHelper
private void SetPerformanceLabel()
{
labelPerf.Text = Properties.Strings.PerformanceMode + (customFans?"+":"") + ((customPower > 0) ? " "+customPower+"W" : "");
labelPerf.Text = Properties.Strings.PerformanceMode + (customFans ? "+" : "") + ((customPower > 0) ? " " + customPower + "W" : "");
}
public void SetPower()
@@ -1013,6 +1153,10 @@ namespace GHelper
break;
}
menuSilent.Checked = buttonSilent.Activated;
menuBalanced.Checked = buttonBalanced.Activated;
menuTurbo.Checked = buttonTurbo.Activated;
int oldMode = Program.config.getConfig("performance_mode");
Program.config.setConfig("performance_" + (int)SystemInformation.PowerStatus.PowerLineStatus, PerformanceMode);
Program.config.setConfig("performance_mode", PerformanceMode);
@@ -1036,7 +1180,7 @@ namespace GHelper
if (Program.config.getConfigPerfString("scheme") is not null)
NativeMethods.SetPowerScheme(Program.config.getConfigPerfString("scheme"));
else
else
NativeMethods.SetPowerScheme(PerformanceMode);
if (Program.config.getConfigPerf("auto_boost") != -1)
@@ -1097,21 +1241,33 @@ namespace GHelper
public void AutoScreen(bool force = false)
{
if (!force && Program.config.getConfig("screen_auto") != 1) return;
if (force || Program.config.getConfig("screen_auto") == 1)
{
if (SystemInformation.PowerStatus.PowerLineStatus == PowerLineStatus.Online)
SetScreen(1000, 1);
else
SetScreen(60, 0);
} else
{
SetScreen(overdrive : Program.config.getConfig("overdrive"));
}
if (SystemInformation.PowerStatus.PowerLineStatus == PowerLineStatus.Online)
SetScreen(1000, 1);
else
SetScreen(60, 0);
}
public static bool IsPlugged()
{
bool optimizedUSBC = Program.config.getConfig("optimized_usbc") != 1;
return SystemInformation.PowerStatus.PowerLineStatus == PowerLineStatus.Online &&
(optimizedUSBC || Program.wmi.DeviceGet(ASUSWmi.ChargerMode) != ASUSWmi.ChargerUSB);
}
public bool AutoGPUMode()
{
var Plugged = SystemInformation.PowerStatus.PowerLineStatus;
bool GpuAuto = Program.config.getConfig("gpu_auto") == 1;
bool ForceGPU = Program.config.ContainsModel("503");
@@ -1126,14 +1282,17 @@ namespace GHelper
return false;
else
{
if (ReEnableGPU()) return true;
if (eco == 1)
if ((GpuAuto && Plugged == PowerLineStatus.Online) || (ForceGPU && GpuMode == ASUSWmi.GPUModeStandard))
if ((GpuAuto && IsPlugged()) || (ForceGPU && GpuMode == ASUSWmi.GPUModeStandard))
{
SetEcoGPU(0);
return true;
}
if (eco == 0)
if ((GpuAuto && Plugged != PowerLineStatus.Online) || (ForceGPU && GpuMode == ASUSWmi.GPUModeEco))
if ((GpuAuto && !IsPlugged()) || (ForceGPU && GpuMode == ASUSWmi.GPUModeEco))
{
if (HardwareMonitor.IsUsedGPU())
@@ -1151,6 +1310,20 @@ namespace GHelper
}
public bool ReEnableGPU()
{
if (Screen.AllScreens.Length <= 1) return false;
if (Program.config.getConfig("gpu_reenable") != 1) return false;
Logger.WriteLine("Re-enabling gpu for 503 model");
Thread.Sleep(1000);
SetEcoGPU(1);
Thread.Sleep(1000);
SetEcoGPU(0);
return true;
}
private void UltimateUI(bool ultimate)
{
if (!ultimate)
@@ -1159,14 +1332,23 @@ namespace GHelper
tablePerf.ColumnCount = 0;
tableGPU.ColumnCount = 0;
tableScreen.ColumnCount = 0;
menuUltimate.Visible = false;
}
//tableLayoutMatrix.ColumnCount = 0;
}
public void InitXGM()
{
int connected = Program.wmi.DeviceGet(ASUSWmi.GPUXGConnected);
int enabled = Program.wmi.DeviceGet(ASUSWmi.GPUXG);
buttonXGM.Enabled = buttonXGM.Visible = (connected == 1);
buttonXGM.Activated = (enabled == 1);
}
public int InitGPUMode()
{
@@ -1198,6 +1380,8 @@ namespace GHelper
ButtonEnabled(buttonStandard, true);
ButtonEnabled(buttonUltimate, true);
InitXGM();
VisualiseGPUMode(GpuMode);
return GpuMode;
@@ -1213,7 +1397,7 @@ namespace GHelper
ButtonEnabled(buttonStandard, false);
ButtonEnabled(buttonUltimate, false);
labelGPU.Text = Properties.Strings.GPUMode + ": "+ Properties.Strings.GPUChanging + " ...";
labelGPU.Text = Properties.Strings.GPUMode + ": " + Properties.Strings.GPUChanging + " ...";
Thread t = new Thread(() =>
{
@@ -1228,6 +1412,9 @@ namespace GHelper
Program.wmi.DeviceSet(ASUSWmi.GPUEco, eco, "GPUEco");
if (eco == 0)
HardwareMonitor.RecreateGpuControlWithDelay();
Program.settingsForm.BeginInvoke(delegate
{
Thread.Sleep(500);
@@ -1339,6 +1526,10 @@ namespace GHelper
break;
}
menuEco.Checked = buttonEco.Activated;
menuStandard.Checked = buttonStandard.Activated;
menuUltimate.Checked = buttonUltimate.Activated;
menuOptimized.Checked = buttonOptimized.Activated;
}

Binary file not shown.

View File

@@ -20,6 +20,7 @@ Control tool for ROG Zephyrus G14, G15, Flow X13, Flow X16, TUF, Strix, Scar and
## [:floppy_disk: Download App](https://github.com/seerge/g-helper/releases/latest/download/GHelper.zip)
If you like this app, please [star :star: it on Github](https://github.com/seerge/g-helper) and spread a word about it!
### [:euro: Donate EUR](https://www.paypal.com/donate/?hosted_button_id=4HMSHS4EBQWTA) | [💵 Donate USD](https://www.paypal.com/donate/?hosted_button_id=SRM6QUX6ACXDY)
_If you post about the app - please include a link. Thanks._
@@ -104,6 +105,9 @@ This function is handled by Asus Optimization Service (therefore G-helper doesn'
#### 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)
#### Can I overclock Nvidia GPU core / memory?
I don't own nvidia GPU at the moment, so can't safely add overclocking to the app. But you can use "msi afterburner" to do that and much more with your GPU, as it's much more specialized on this aspect :)
#### How do I uninstall G-helper?
G-helper is a single exe, and it doesn't install anything in the system. To remove it - you can simply delete exe :) If you have applied any custom fan profiles or PPTs - before removing I would recommend selecting your favorite performance mode (for example balanced) and clicking "Factory defaults" under Fans + Power.
@@ -111,8 +115,13 @@ G-helper is a single exe, and it doesn't install anything in the system. To remo
It's a lightweight Armoury Crate alternative for Asus laptops. A small utility that allows you to do almost everything you could do with Armoury Crate but without extra bloat and unnecessary services.
-----------------------------
----------------------------
## :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)
[![QR Code](https://user-images.githubusercontent.com/5920850/233658717-0441494d-fede-4a2c-b4f2-4b16a184a69a.png)](https://www.paypal.com/donate/?hosted_button_id=4HMSHS4EBQWTA)
----------------
### How to install
@@ -179,6 +188,14 @@ Full list of keycodes https://learn.microsoft.com/en-us/windows/win32/inputdev/v
![Screenshot 2023-04-13 172537](https://user-images.githubusercontent.com/5920850/231837470-df913847-cf8a-43e1-80b6-5eb6e9eaee4e.png)
### Workaround for [bugged bios on G15](https://github.com/seerge/g-helper/issues/253)
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 :)
To enable this custom workaround you need to add an extra line in In config.json (under ``%AppData%\GHelper``)
``gpu_reenable : 1,``
------------
**Disclaimers**
"ROG", "TUF", and "Armoury Crate" are trademarked by and belong to AsusTek Computer, Inc. I make no claims to these or any assets belonging to AsusTek Computer and use them purely for informational purposes only.

View File

@@ -5,21 +5,22 @@
语言: [English](https://github.com/seerge/g-helper#readme) | 中文
## 为ASUS笔记本打造的、Armoury Crate(奥创控制中心)的轻量化替代品
### 可作为ROG 幻14、幻15幻13、幻16飞行堡垒/天选系列ROG 枪神/魔霸系列或其他ASUS笔记本的控制工具
这是一个实用程序,可以做到几乎所有Armoury Crate(奥创控制中心)能做的事情,而且不需要任何多余的功能或安装不必要的系统服务。
这是一个ROG 幻14、幻15幻13、幻16飞行堡垒/天选系列ROG 枪神/魔霸系列或其他ASUS笔记本的控制工具。可以做到几乎所有Armoury Crate(奥创控制中心)能做的事情,而且不需要任何多余的功能或安装不必要的系统服务。
## :gift: 主要优点
1. 自动且无缝的独立显卡模式切换(不需要关闭所有应用或别的要求
2. 可以完全手动调整所有的性能模式包括自定义风扇曲线以及PPTs(CPU/GPU功耗控制)
3. 极致的轻量化几乎不消耗任何资源不需要安装系统服务。只需要下载一个exe文件就可以运行。
1. 自动且无缝的独立显卡模式切换(不需要关闭所有应用或执行其他操作
2. 可以手动调整所有的性能模式包括自定义风扇曲线以及PPTs(Platform Power Threshold,即CPU功耗,下文简称PPTs--译注))
3. 极致的轻量化,几乎不消耗任何资源,不需要安装系统服务。只需要下载一个exe文件就可以运行。
4. 简洁的界面设计,可以轻松调整所有设置。
5. 运行不需要管理员权限!
## [:floppy_disk: 下载应用](https://github.com/seerge/g-helper/releases/latest/download/GHelper.zip)
如果你喜欢这个应用,请给这个项目 [:star: 在Github上Star](https://github.com/seerge/g-helper) 或者向别人推荐它!
如果你喜欢这个应用,请[给这个项目:star:](https://github.com/seerge/g-helper) 或者向别人推荐它!
### :euro: [(通过paypal)支持和捐赠G-Helper](https://www.paypal.com/donate/?hosted_button_id=4HMSHS4EBQWTA)
_如果你在别的地方提到这个软件-请记得加上这个项目的网址。十分感谢。_
@@ -27,14 +28,14 @@ _如果你在别的地方提到这个软件-请记得加上这个项目的网址
### :zap: 主要功能
1. **性能模式**: 静音 - 平衡/性能 - 增强 内置的性能模式,附带默认的风扇曲线)
2. **显卡模式**: 集显模式 - 混合输出 - 独显输出 - 自动切换
3. 笔记本屏幕刷新率 60hz 或 120hz 自动调节(或者 144hz 等刷新率)包括屏幕Overdrive(OD,即ROG系列的屏幕快速响应/快显)功能
4. 可调节的风扇曲线、电源功耗设置(PPT)(_注:请谨慎调节!_)和CPU频选项
1. **性能模式**: 静音模式 - 平衡模式 - 增强模式 笔电bios内置的性能模式,附带默认的风扇曲线)
2. **显卡模式**: 集显模式 - 标准模式 - 独显直连 - 自动切换
3. 笔记本屏幕刷新率 60hz 或 120hz 自动调节(或者 144hz 等刷新率)包括屏幕Overdrive(OD,即ROG系列的屏幕快速响应/快显功能--译注)功能
4. 可调节的风扇曲线、电源功耗设置(PPTs)(_注:请谨慎调节!_)和CPU频选项
5. ROG Anime matrix 光显矩阵屏控制, 感谢项目 [Starlight](https://github.com/vddCore/Starlight) + 应用侧的一些调整包括动画GIF图片
6. 键盘灯光效果和颜色设置 (包括睡眠模式下的灯光效果和对飞行堡垒/天选系列的键盘支持)
7. 对 M3, M4 按键的自定义设置和 FN+F5 快捷键(性能模式切换 FN+F4快捷键(键盘灯光效果切换)
8. CPU/GPU温度、风扇转速和电池充放电功率先生
7. 对 M3, M4 按键的自定义设置和 FN+F5 快捷键(性能模式切换) FN+F4 快捷键(键盘灯光效果切换)
8. CPU/GPU温度、风扇转速和电池充放电功率显示
9. 电池充电上限设置,保护电池健康度
### :gear: 当使用电池供电或插上电源时,自动切换:
@@ -43,15 +44,15 @@ _如果你在别的地方提到这个软件-请记得加上这个项目的网址
- 自动切换屏幕刷新率 (使用电池时切换为 60hz,插入电源后切换为 120+ hz)
- 使用电池时键盘背光可自动关闭
为了保证自动切换功能和按键绑定功能的正常工作,软件需要在后台运行并显示一个托盘图标。这并不会消耗任何资源。
为了保证自动切换功能和按键绑定功能的正常工作,软件需要在后台运行并显示一个托盘图标。这并不会消耗其他资源。
### :rocket: 性能模式
性能模式与 Armoury Crate(奥创控制中心)中的 **保持一致**因为这些设置与其对应的风扇曲线都被保存在bios中
1. 静音 (风扇转速最小或完全停转, 70W 总功耗(PPT), 其中 CPU 最高 45W(PPT)) + windows电源模式设置为最长续航/省电模式
2. 平衡/性能 (平衡模式的风扇曲线设置, 100W 总功耗(PPT), 其中 CPU 最高 45W(PPT)) + windows电源模式设置为平衡
3. 增强 (激进的风扇曲线设置, 125W 总功耗(PPT), 其中 CPU 最高 80W(PPT)) + windows电源模式设置为高性能/最佳性能
1. 静音 (风扇转速最小或完全停转, 70W 总PPT, 其中 CPU 最高 45W PPT) + windows电源模式设置为最长续航/省电模式
2. 平衡/性能 (平衡模式的风扇曲线设置, 100W 总PPT, 其中 CPU 最高 45W PPT) + windows电源模式设置为平衡
3. 增强 (激进的风扇曲线设置, 125W 总PPT, 其中 CPU 最高 80W PPT) + windows电源模式设置为高性能/最佳性能
_PPTs 默认在 幻14 2022版上显示, 对于其他型号 PPTs 的显示将会有所变化因为它们在bios中的设置不同。_
@@ -60,66 +61,87 @@ _PPTs 默认在 幻14 2022版上显示, 对于其他型号 PPTs 的显示将会
### :video_game: 显卡模式
1. 集显模式 : 只启用低功耗的内置显卡, 核显连接笔电内置屏幕
2. 混合输出 (MS Hybrid) : 同时启用核显与独显, 核显连接笔电内置屏幕
3. 独显输出: 同时启用核显与独显, 但独显直连笔电屏幕 (仅在幻14 2022版等机型上支持)
2. 标准模式 (MS Hybrid) : 同时启用核显与独显, 核显连接笔电内置屏幕
3. 独显直连: 同时启用核显与独显, 但独显直连笔电屏幕 (仅在幻14 2022版等机型上支持)
4. 自动切换: 使用电池时关闭独显(集显模式),并在插上电源后重新启用独显(混合输出)
## :question: 常见问题解答(FAQ)
### 当我按下 M4 / Rog键的时候总是弹出安装Armoury Crate的弹窗提示我该如何关闭它?
删除下列文件或者把它移动(剪切+粘贴)到别的目录 ``C:\Windows\System32\ASUSACCI\ArmouryCrateKeyControl.exe``.
#### 当我按下 M4 / Rog键的时候总是弹出安装Armoury Crate的弹窗提示我该如何关闭它?
删除下列文件或者把它移动(注:剪切+粘贴)到别的目录 ``C:\Windows\System32\ASUSACCI\ArmouryCrateKeyControl.exe``.
如果还是出现弹窗 - 进入 BIOS (开机时按住 F2), 按照屏幕下方的快捷键提示进入 Advanced Settings,然后关闭 "Armoury Crate Control Interface" (把它设置为disabled)。
如果还是出现弹窗 - 进入 BIOS (开机时按住 F2), 按照屏幕下方的快捷键提示进入 Advanced Settings,然后关闭 "Armoury Crate Control Interface" (注:把它设置为disabled)。
### 为什么我的笔记本不支持独显输出?
#### 为什么我的笔记本不支持独显输出?
独显输出只在幻14 2022版上支持(也可能支持2022年以来的其他机型)。
### 我无法在幻14 2020版上设置集显模式(关闭独显)
#### 我无法在幻14 2020版上设置集显模式(关闭独显)
很不幸2020版的机型在硬件上不支持这个设置。
### 我是否应该自行调整功耗设置和风扇曲线?
#### 我是否应该自行调整功耗设置(PPTs)和风扇曲线?
你可以不那么做,这些操作是可选的。按照经验(bios)内置的性能模式工作的很好。请只在遇到问题的时候限制功耗或者手动设置风扇模式。当你在风扇与功率设置中按下“应用”时bios将会认为风扇配置文件为“自定义”! (无论你是否真的修改了风扇曲线)
### G-helper是如何控制我的风扇转速的?
#### G-helper是如何控制我的风扇转速的?
软件并不会修改风扇转速。这个设置实际上由bios控制(与Armoury Crate的情况相同)。G-helper 所能做的 - 就是将一个自定义的风扇配置(可选地)应用到正在使用的性能模式其中包括8组温度+风扇速度的百分比数值%。软件通过与Armoury Crate看起来相同的WMI endpoint来应用这一设置
### 我如何把风扇转速显示从百分比%切换到RPM(每分钟转速)?
#### 我如何把风扇转速显示从百分比%切换到RPM(每分钟转速)?
点击一下百分比即可切换。
### 我没有在G-helper中看到独显温度
#### 我没有在G-helper中看到独显温度
很可能要么你正在使用核显模式/自动切换模式这种情况下独显只是关闭了或者你的windows系统为独显设置了睡眠模式(为了省电)。这种情况下G-helper无法识别到独显也不能获得温度读数。
### 弹窗提示"G-Helper已经在运行"
#### 弹窗提示"G-Helper已经在运行"
请在系统托盘里找到 (G) 图标。windows会默认隐藏所有图标所以你可能需要点击 ^ 来看见它们。建议任务栏右键进入任务栏设置 -> 其他系统图标 -> 将 G-Helper 设置为始终在任务栏上显示。
### 应用不能启动或者崩溃了,我该怎么做?
#### 应用不能启动或者崩溃了,我该怎么做?
从开始菜单里打开“事件管理器”, 进入 Windows日志 -> 应用然后在最近的错误日志里寻找包含G-helper的日志。如果你找到一个 - 请提出一个 [新的 issue](https://github.com/seerge/g-helper/issues) ,其中包含来自这次错误的所有的详细信息。
### 我可以在用G-Helper的时候同时用myASUS吗?
#### 我可以在用G-Helper的时候同时用myASUS吗?
当然可以! 唯一的问题是myASUS可能会重置你之前在g-helper里设置的电池充电上限。在这种情况下建议你在这两个应用(myASUS和g-helper)里设置相同的充电上限(60%/80%/100%)以避免冲突。
### 我如何卸载G-helper?
#### 我如何将M3键设置为将麦克风静音?
这个功能由 Asus Optimization Service 管理(所以 G-helper 没有这项设置,也不管理这个功能)。请确认这个系统服务是否正常运行
#### 我如何设置不同的视觉风格(即 Armoury Crate 内的gamevisual功能)?
因为这个功能让颜色显示不正确,我个人(注:作者 :) )并不喜欢这些。但是如果你需要这个功能 - 你可以使用 Nvidia 控制面板/GefoeceExperirence滤镜或者AMD控制面板(Radeon Software/AMD Software: Adrenalin Edition)来修改显示颜色(因显示器和配置而异)。如果你真的非常需要这个功能,你也可以使用 [微软商店中ASUS自己的工具](https://apps.microsoft.com/store/detail/gamevisual/9P4K1LFTXSH8?hl=nl-nl&gl=nl&rtc=1)
#### 我能超频 Nvidia GPU 核心或显存吗?
我(注:作者 :) )现在并没有Nvidia的显卡所以我不能保证这个功能加入之后是安全的。但是你可以用微星小飞机(msi afterburner) 去超频GPU毕竟它是为GPU超频专门设计的 :)
#### 我该如何卸载G-helper?
G-helper是一个单文件的exe文件, 而且它不会向系统中安装任何东西。如果要“卸载”它 - 你可以直接删除exe文件 :) 如果你已经设置了自定义的风扇配置或者功耗设置(PPTs) - 在删除软件之前建议你选择你最喜欢的配置模式(比如"平衡"),然后在“风扇与电源设置”里点击“恢复默认设置”。
#### G-helper 是什么?
这是一个ASUS笔记本的控制工具。可以做到几乎所有Armoury Crate(奥创控制中心)能做的事情,而且不需要任何多余的功能或安装不必要的系统服务。
----------------------------
## :euro: [支持这个项目](https://www.paypal.com/donate/?hosted_button_id=4HMSHS4EBQWTA)
#### 如果你喜欢这个项目你可以[通过Paypal捐赠](https://www.paypal.com/donate/?hosted_button_id=4HMSHS4EBQWTA)
[![二维码](https://user-images.githubusercontent.com/5920850/233658717-0441494d-fede-4a2c-b4f2-4b16a184a69a.png)](https://www.paypal.com/donate/?hosted_button_id=4HMSHS4EBQWTA)
----------------
### 安装指南
1. 从 [**Releases Page**](https://github.com/seerge/g-helper/releases) 下载最新版本
2. 解压到你选择的文件夹
3. 运行 **GHelper.exe**
### 依赖软件及运行要求
### 运行要求(必须)
- Microsoft [.NET7](https://dotnet.microsoft.com/en-us/download)。 你可能已经安装了。 如果没有的话你可以从官方网站 [立即下载](https://dotnet.microsoft.com/en-us/download/dotnet/thank-you/sdk-7.0.202-windows-x64-installer)。
- [Asus System Control Interface](https://dlcdnets.asus.com/pub/ASUS/nb/Image/CustomComponent/ASUSSystemControlInterfaceV3/ASUSSystemControlInterfaceV3.exe)。 如果你安装了或者安装过myASUS, 那么这个"驱动"应当已经安装(即使myASUS已经卸载)。 或者你可以手动下载安装。
- 可选选项(!) 你可以通过在管理员模式下运行 [这个用于精简的.bat文件](https://raw.githubusercontent.com/seerge/g-helper/main/debloat.bat)来禁用/移除不必要的服务。如果要恢复这些服务,运行 [这个.bat文件](https://raw.githubusercontent.com/seerge/g-helper/main/bloat.bat)。
### 推荐配置(可选)
- 推荐保持 "Asus Optimization Service" 这个windows服务的运行, 它保证基本的键盘快捷键(比如屏幕或键盘亮度)能够使用。
-不建议同时运行这个应用与Armoury Crate(及其服务), 因为它们调整的设置是相同的。你可以[使用ASUS官方提供的卸载工具卸载](https://dlcdnets.asus.com/pub/ASUS/mb/14Utilities/Armoury_Crate_Uninstall_Tool.zip?model=armoury%20crate)。以防万一,你总是可以之后再安装回来
- 可选选项(!) 你可以通过在管理员模式下运行 [这个用于精简的.bat文件](https://raw.githubusercontent.com/seerge/g-helper/main/debloat.bat)来禁用/移除不必要的服务。如果要恢复这些服务,运行 [这个.bat文件](https://raw.githubusercontent.com/seerge/g-helper/main/bloat.bat)
-这个应用不建议与Armoury Crate(及其服务)同时运行, 因为它们会调整相同的设置。你可以[使用ASUS官方提供的卸载工具卸载](https://dlcdnets.asus.com/pub/ASUS/mb/14Utilities/Armoury_Crate_Uninstall_Tool.zip?model=armoury%20crate)Armoury Crate。以防万一你总是可以之后再安装回来。
-------------------------------
@@ -136,20 +158,35 @@ G-helper是一个单文件的exe文件, 而且它不会向系统中安装任何
![Helps to save your battery](https://raw.githubusercontent.com/seerge/g-helper/main/docs/screenshots/screen-5w.png)
---------
## 高级用户设置
### 为每一个模式自定义用户计划
在 config.json (位于 %appdata/GHelper) 中你可以手动添加自定义电源设置的GUID (它既可以是"真正的"可被选择的电源计划,也可以是"覆盖式(overlay)"的电源计划就像g-helper默认设置的那样)
格式 : "scheme_<mode>" : "GUID"
格式如下 : "scheme_<mode>" : "GUID"
Where mode = 0 (balanced), 1 (turbo), 2 (silent)
Where ``mode = 0 (balanced), 1 (turbo), 2 (silent)``
"scheme_0": "2ac1d0e0-17a7-44ed-8091-d88ef75a4eb0",
"scheme_1": "381b4222-f694-41f0-9685-ff5bb260df2e"
```
"scheme_0": "2ac1d0e0-17a7-44ed-8091-d88ef75a4eb0",
"scheme_1": "381b4222-f694-41f0-9685-ff5bb260df2e"
```
确保修改时保证json文件的结构 (也就是不要增减逗号等打乱配置的操作) - 否则应用会读取失败,并将重新创建一个新的配置文件来替代它。
确保修改时保证json文件的结构不被打乱 (例如不要增减或缺失逗号、括号等操作) - 否则应用会读取失败,并将重新创建一个新的配置文件来替代它。
### 自定义热键行为
软件支持为 M3, M4 和 FN+F4 热键自定义配置。如要设置,在按键旁的选项框中选择"自定义设置",然后执行下面的操作(任选其一):
1. 要想运行任意应用 - 向 "action" 文本框中粘贴应用文件exe的完整路径例如:
``C:\Program Files\EA Games\Battlefield 2042\BF2042.exe``
2. 要想模拟任意windows按键 - 向"action"文本框中粘贴相对应的 keycode例如 ``0x2C`` 为屏幕截图键。
Keycodes的完整列表: https://learn.microsoft.com/en-us/windows/win32/inputdev/virtual-key-codes
![Screenshot 2023-04-13 172537](https://user-images.githubusercontent.com/5920850/231837470-df913847-cf8a-43e1-80b6-5eb6e9eaee4e.png)
------------