Added more actions for m3/m4, fixed scaling

This commit is contained in:
seerge
2023-03-05 18:23:38 +01:00
parent b40eb50e90
commit c8f4c4b0d4
11 changed files with 291 additions and 241 deletions

View File

@@ -5,7 +5,6 @@ using Starlight.Communication;
namespace Starlight.AnimeMatrix namespace Starlight.AnimeMatrix
{ {
public class BuiltInAnimation public class BuiltInAnimation
{ {
public enum Startup public enum Startup
@@ -138,7 +137,6 @@ namespace Starlight.AnimeMatrix
public void SetLedPlanar(int x, int y, byte value) public void SetLedPlanar(int x, int y, byte value)
{ {
EnsureRowInRange(y); EnsureRowInRange(y);
var ledsInRow = Columns(y);
var start = RowToLinearAddress(y) - EmptyColumns(y); var start = RowToLinearAddress(y) - EmptyColumns(y);
if (x > EmptyColumns(y)) if (x > EmptyColumns(y))

View File

@@ -1,6 +1,5 @@
// Source thanks to https://github.com/vddCore/Starlight :) // Source thanks to https://github.com/vddCore/Starlight :)
using Starlight.Communication.Platform; using Starlight.Communication.Platform;
namespace Starlight.Communication namespace Starlight.Communication

View File

@@ -1,8 +1,5 @@
// Source thanks to https://github.com/vddCore/Starlight :) // Source thanks to https://github.com/vddCore/Starlight :)
using System.ComponentModel;
using HidSharp;
namespace Starlight.Communication namespace Starlight.Communication
{ {
public abstract class Packet public abstract class Packet
@@ -20,7 +17,7 @@ namespace Starlight.Communication
"Packet length must be at least 1." "Packet length must be at least 1."
); );
} }
Data = new byte[packetLength]; Data = new byte[packetLength];
Data[0] = reportId; Data[0] = reportId;
@@ -33,7 +30,7 @@ namespace Starlight.Communication
"Your packet length does not allow for initial data to be appended." "Your packet length does not allow for initial data to be appended."
); );
} }
AppendData(data); AppendData(data);
} }
} }

87
Fans.Designer.cs generated
View File

@@ -58,26 +58,29 @@
// //
chartArea1.Name = "ChartArea1"; chartArea1.Name = "ChartArea1";
chartCPU.ChartAreas.Add(chartArea1); chartCPU.ChartAreas.Add(chartArea1);
chartCPU.Location = new Point(362, 30); chartCPU.Location = new Point(195, 14);
chartCPU.Margin = new Padding(2, 1, 2, 1);
chartCPU.Name = "chartCPU"; chartCPU.Name = "chartCPU";
chartCPU.Size = new Size(772, 464); chartCPU.Size = new Size(416, 218);
chartCPU.TabIndex = 0; chartCPU.TabIndex = 0;
chartCPU.Text = "chartCPU"; chartCPU.Text = "chartCPU";
// //
// buttonApply // buttonApply
// //
buttonApply.Location = new Point(879, 1016); buttonApply.Location = new Point(473, 476);
buttonApply.Margin = new Padding(2, 1, 2, 1);
buttonApply.Name = "buttonApply"; buttonApply.Name = "buttonApply";
buttonApply.Size = new Size(254, 46); buttonApply.Size = new Size(137, 22);
buttonApply.TabIndex = 1; buttonApply.TabIndex = 1;
buttonApply.Text = "Apply Fan Curve"; buttonApply.Text = "Apply Fan Curve";
buttonApply.UseVisualStyleBackColor = true; buttonApply.UseVisualStyleBackColor = true;
// //
// buttonReset // buttonReset
// //
buttonReset.Location = new Point(362, 1016); buttonReset.Location = new Point(195, 476);
buttonReset.Margin = new Padding(2, 1, 2, 1);
buttonReset.Name = "buttonReset"; buttonReset.Name = "buttonReset";
buttonReset.Size = new Size(254, 46); buttonReset.Size = new Size(137, 22);
buttonReset.TabIndex = 2; buttonReset.TabIndex = 2;
buttonReset.Text = "Factory Defaults"; buttonReset.Text = "Factory Defaults";
buttonReset.UseVisualStyleBackColor = true; buttonReset.UseVisualStyleBackColor = true;
@@ -86,9 +89,10 @@
// //
chartArea2.Name = "ChartArea1"; chartArea2.Name = "ChartArea1";
chartGPU.ChartAreas.Add(chartArea2); chartGPU.ChartAreas.Add(chartArea2);
chartGPU.Location = new Point(362, 511); chartGPU.Location = new Point(195, 240);
chartGPU.Margin = new Padding(2, 1, 2, 1);
chartGPU.Name = "chartGPU"; chartGPU.Name = "chartGPU";
chartGPU.Size = new Size(772, 480); chartGPU.Size = new Size(416, 225);
chartGPU.TabIndex = 3; chartGPU.TabIndex = 3;
chartGPU.Text = "chart1"; chartGPU.Text = "chart1";
// //
@@ -103,10 +107,11 @@
groupBox1.Controls.Add(label1); groupBox1.Controls.Add(label1);
groupBox1.Controls.Add(trackCPU); groupBox1.Controls.Add(trackCPU);
groupBox1.Controls.Add(trackTotal); groupBox1.Controls.Add(trackTotal);
groupBox1.Location = new Point(12, 12); groupBox1.Location = new Point(6, 6);
groupBox1.Margin = new Padding(2, 1, 2, 1);
groupBox1.Name = "groupBox1"; groupBox1.Name = "groupBox1";
groupBox1.Padding = new Padding(5); groupBox1.Padding = new Padding(3, 2, 3, 2);
groupBox1.Size = new Size(330, 979); groupBox1.Size = new Size(178, 459);
groupBox1.TabIndex = 4; groupBox1.TabIndex = 4;
groupBox1.TabStop = false; groupBox1.TabStop = false;
groupBox1.Text = "Power Limits (PPT)"; groupBox1.Text = "Power Limits (PPT)";
@@ -115,9 +120,10 @@
// //
labelApplied.AutoSize = true; labelApplied.AutoSize = true;
labelApplied.ForeColor = Color.Tomato; labelApplied.ForeColor = Color.Tomato;
labelApplied.Location = new Point(14, 39); labelApplied.Location = new Point(8, 18);
labelApplied.Margin = new Padding(2, 0, 2, 0);
labelApplied.Name = "labelApplied"; labelApplied.Name = "labelApplied";
labelApplied.Size = new Size(143, 32); labelApplied.Size = new Size(71, 15);
labelApplied.TabIndex = 13; labelApplied.TabIndex = 13;
labelApplied.Text = "Not Applied"; labelApplied.Text = "Not Applied";
// //
@@ -126,9 +132,10 @@
pictureFine.Anchor = AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right; pictureFine.Anchor = AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
pictureFine.BackgroundImage = Properties.Resources.everything_is_fine_itsfine; pictureFine.BackgroundImage = Properties.Resources.everything_is_fine_itsfine;
pictureFine.BackgroundImageLayout = ImageLayout.Zoom; pictureFine.BackgroundImageLayout = ImageLayout.Zoom;
pictureFine.Location = new Point(9, 731); pictureFine.Location = new Point(5, 343);
pictureFine.Margin = new Padding(2, 1, 2, 1);
pictureFine.Name = "pictureFine"; pictureFine.Name = "pictureFine";
pictureFine.Size = new Size(311, 240); pictureFine.Size = new Size(167, 112);
pictureFine.TabIndex = 12; pictureFine.TabIndex = 12;
pictureFine.TabStop = false; pictureFine.TabStop = false;
pictureFine.Visible = false; pictureFine.Visible = false;
@@ -137,9 +144,10 @@
// //
labelInfo.AutoSize = true; labelInfo.AutoSize = true;
labelInfo.Dock = DockStyle.Bottom; labelInfo.Dock = DockStyle.Bottom;
labelInfo.Location = new Point(5, 942); labelInfo.Location = new Point(3, 442);
labelInfo.Margin = new Padding(2, 0, 2, 0);
labelInfo.Name = "labelInfo"; labelInfo.Name = "labelInfo";
labelInfo.Size = new Size(65, 32); labelInfo.Size = new Size(32, 15);
labelInfo.TabIndex = 11; labelInfo.TabIndex = 11;
labelInfo.Text = "label"; labelInfo.Text = "label";
// //
@@ -147,9 +155,10 @@
// //
labelCPU.AutoSize = true; labelCPU.AutoSize = true;
labelCPU.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point); labelCPU.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point);
labelCPU.Location = new Point(197, 125); labelCPU.Location = new Point(106, 59);
labelCPU.Margin = new Padding(2, 0, 2, 0);
labelCPU.Name = "labelCPU"; labelCPU.Name = "labelCPU";
labelCPU.Size = new Size(61, 32); labelCPU.Size = new Size(30, 15);
labelCPU.TabIndex = 10; labelCPU.TabIndex = 10;
labelCPU.Text = "CPU"; labelCPU.Text = "CPU";
labelCPU.TextAlign = ContentAlignment.MiddleCenter; labelCPU.TextAlign = ContentAlignment.MiddleCenter;
@@ -158,9 +167,10 @@
// //
labelTotal.AutoSize = true; labelTotal.AutoSize = true;
labelTotal.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point); labelTotal.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point);
labelTotal.Location = new Point(39, 125); labelTotal.Location = new Point(21, 59);
labelTotal.Margin = new Padding(2, 0, 2, 0);
labelTotal.Name = "labelTotal"; labelTotal.Name = "labelTotal";
labelTotal.Size = new Size(70, 32); labelTotal.Size = new Size(34, 15);
labelTotal.TabIndex = 9; labelTotal.TabIndex = 9;
labelTotal.Text = "Total"; labelTotal.Text = "Total";
labelTotal.TextAlign = ContentAlignment.MiddleCenter; labelTotal.TextAlign = ContentAlignment.MiddleCenter;
@@ -168,9 +178,10 @@
// label2 // label2
// //
label2.AutoSize = true; label2.AutoSize = true;
label2.Location = new Point(200, 91); label2.Location = new Point(108, 43);
label2.Margin = new Padding(2, 0, 2, 0);
label2.Name = "label2"; label2.Name = "label2";
label2.Size = new Size(58, 32); label2.Size = new Size(30, 15);
label2.TabIndex = 8; label2.TabIndex = 8;
label2.Text = "CPU"; label2.Text = "CPU";
label2.TextAlign = ContentAlignment.MiddleCenter; label2.TextAlign = ContentAlignment.MiddleCenter;
@@ -178,33 +189,36 @@
// label1 // label1
// //
label1.AutoSize = true; label1.AutoSize = true;
label1.Location = new Point(41, 91); label1.Location = new Point(22, 43);
label1.Margin = new Padding(2, 0, 2, 0);
label1.Name = "label1"; label1.Name = "label1";
label1.Size = new Size(65, 32); label1.Size = new Size(32, 15);
label1.TabIndex = 7; label1.TabIndex = 7;
label1.Text = "Total"; label1.Text = "Total";
label1.TextAlign = ContentAlignment.MiddleCenter; label1.TextAlign = ContentAlignment.MiddleCenter;
// //
// trackCPU // trackCPU
// //
trackCPU.Location = new Point(203, 178); trackCPU.Location = new Point(109, 83);
trackCPU.Margin = new Padding(2, 1, 2, 1);
trackCPU.Maximum = 85; trackCPU.Maximum = 85;
trackCPU.Minimum = 15; trackCPU.Minimum = 15;
trackCPU.Name = "trackCPU"; trackCPU.Name = "trackCPU";
trackCPU.Orientation = Orientation.Vertical; trackCPU.Orientation = Orientation.Vertical;
trackCPU.Size = new Size(90, 444); trackCPU.Size = new Size(45, 208);
trackCPU.TabIndex = 6; trackCPU.TabIndex = 6;
trackCPU.TickFrequency = 5; trackCPU.TickFrequency = 5;
trackCPU.Value = 80; trackCPU.Value = 80;
// //
// trackTotal // trackTotal
// //
trackTotal.Location = new Point(42, 178); trackTotal.Location = new Point(23, 83);
trackTotal.Margin = new Padding(2, 1, 2, 1);
trackTotal.Maximum = 150; trackTotal.Maximum = 150;
trackTotal.Minimum = 15; trackTotal.Minimum = 15;
trackTotal.Name = "trackTotal"; trackTotal.Name = "trackTotal";
trackTotal.Orientation = Orientation.Vertical; trackTotal.Orientation = Orientation.Vertical;
trackTotal.Size = new Size(90, 444); trackTotal.Size = new Size(45, 208);
trackTotal.TabIndex = 5; trackTotal.TabIndex = 5;
trackTotal.TickFrequency = 5; trackTotal.TickFrequency = 5;
trackTotal.TickStyle = TickStyle.TopLeft; trackTotal.TickStyle = TickStyle.TopLeft;
@@ -212,9 +226,10 @@
// //
// buttonApplyPower // buttonApplyPower
// //
buttonApplyPower.Location = new Point(15, 1016); buttonApplyPower.Location = new Point(8, 476);
buttonApplyPower.Margin = new Padding(2, 1, 2, 1);
buttonApplyPower.Name = "buttonApplyPower"; buttonApplyPower.Name = "buttonApplyPower";
buttonApplyPower.Size = new Size(327, 46); buttonApplyPower.Size = new Size(176, 22);
buttonApplyPower.TabIndex = 11; buttonApplyPower.TabIndex = 11;
buttonApplyPower.Text = "Apply Power Limits"; buttonApplyPower.Text = "Apply Power Limits";
buttonApplyPower.UseVisualStyleBackColor = true; buttonApplyPower.UseVisualStyleBackColor = true;
@@ -222,18 +237,19 @@
// checkAuto // checkAuto
// //
checkAuto.AutoSize = true; checkAuto.AutoSize = true;
checkAuto.Location = new Point(708, 1022); checkAuto.Location = new Point(381, 479);
checkAuto.Margin = new Padding(2, 1, 2, 1);
checkAuto.Name = "checkAuto"; checkAuto.Name = "checkAuto";
checkAuto.Size = new Size(165, 36); checkAuto.Size = new Size(86, 19);
checkAuto.TabIndex = 12; checkAuto.TabIndex = 12;
checkAuto.Text = "Auto Apply"; checkAuto.Text = "Auto Apply";
checkAuto.UseVisualStyleBackColor = true; checkAuto.UseVisualStyleBackColor = true;
// //
// Fans // Fans
// //
AutoScaleDimensions = new SizeF(13F, 32F); AutoScaleDimensions = new SizeF(7F, 15F);
AutoScaleMode = AutoScaleMode.Font; AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(1154, 1089); ClientSize = new Size(621, 510);
Controls.Add(checkAuto); Controls.Add(checkAuto);
Controls.Add(buttonApplyPower); Controls.Add(buttonApplyPower);
Controls.Add(groupBox1); Controls.Add(groupBox1);
@@ -242,6 +258,7 @@
Controls.Add(buttonApply); Controls.Add(buttonApply);
Controls.Add(chartCPU); Controls.Add(chartCPU);
FormBorderStyle = FormBorderStyle.FixedSingle; FormBorderStyle = FormBorderStyle.FixedSingle;
Margin = new Padding(2, 1, 2, 1);
MaximizeBox = false; MaximizeBox = false;
MdiChildrenMinimizedAnchorBottom = false; MdiChildrenMinimizedAnchorBottom = false;
MinimizeBox = false; MinimizeBox = false;

View File

@@ -15,7 +15,7 @@
<AssemblyName>GHelper</AssemblyName> <AssemblyName>GHelper</AssemblyName>
<PlatformTarget>x64</PlatformTarget> <PlatformTarget>x64</PlatformTarget>
<ProduceReferenceAssembly>False</ProduceReferenceAssembly> <ProduceReferenceAssembly>False</ProduceReferenceAssembly>
<AssemblyVersion>0.15</AssemblyVersion> <AssemblyVersion>0.15.1</AssemblyVersion>
<AllowUnsafeBlocks>True</AllowUnsafeBlocks> <AllowUnsafeBlocks>True</AllowUnsafeBlocks>
</PropertyGroup> </PropertyGroup>

2
Keyboard.Designer.cs generated
View File

@@ -91,7 +91,7 @@
// comboM3 // comboM3
// //
comboM3.FormattingEnabled = true; comboM3.FormattingEnabled = true;
comboM3.Items.AddRange(new object[] { "Volume Mute", "Play / Pause", "Toggle Aura", "Custom" }); comboM3.Items.AddRange(new object[] { "Default", "Volume Mute", "Play / Pause", "PrintScreen", "Toggle Aura", "Custom" });
comboM3.Location = new Point(93, 54); comboM3.Location = new Point(93, 54);
comboM3.Name = "comboM3"; comboM3.Name = "comboM3";
comboM3.Size = new Size(312, 40); comboM3.Size = new Size(312, 40);

View File

@@ -1,16 +1,36 @@
namespace GHelper using System.Diagnostics.Metrics;
namespace GHelper
{ {
public partial class Keyboard : Form public partial class Keyboard : Form
{ {
Dictionary<string, string> customActions = new Dictionary<string, string>
{
{"","--------------" },
{"mute", "Volume Mute"},
{"screenshot", "Screenshot"},
{"play", "Play/Pause"},
{"aura", "Aura"},
{"custom", "Custom"}
};
public Keyboard() public Keyboard()
{ {
InitializeComponent(); InitializeComponent();
comboM3.DropDownStyle = ComboBoxStyle.DropDownList; comboM3.DropDownStyle = ComboBoxStyle.DropDownList;
comboM3.SelectedIndex = 0; comboM3.DataSource = new BindingSource(customActions, null);
comboM3.DisplayMember = "Value";
comboM3.ValueMember = "Key";
customActions[""] = "Performance";
comboM4.DropDownStyle = ComboBoxStyle.DropDownList; comboM4.DropDownStyle = ComboBoxStyle.DropDownList;
comboM4.SelectedIndex = 0; comboM4.DataSource = new BindingSource(customActions, null);
comboM4.DisplayMember = "Value";
comboM4.ValueMember = "Key";
comboM3.SelectedValueChanged += ComboM3_SelectedValueChanged; comboM3.SelectedValueChanged += ComboM3_SelectedValueChanged;
comboM4.SelectedValueChanged += ComboM4_SelectedValueChanged; comboM4.SelectedValueChanged += ComboM4_SelectedValueChanged;
@@ -35,18 +55,23 @@
Program.config.setConfig("m4_custom", tb.Text); Program.config.setConfig("m4_custom", tb.Text);
} }
private void ComboM4_SelectedValueChanged(object? sender, EventArgs e) private void ComboKeyChanged(object? sender, string name = "m3")
{ {
if (sender is null) return; if (sender is null) return;
ComboBox cmb = (ComboBox)sender; ComboBox cmb = (ComboBox)sender;
Program.config.setConfig("m4", cmb.SelectedIndex);
if (cmb.SelectedValue is not null)
Program.config.setConfig(name, cmb.SelectedValue.ToString());
}
private void ComboM4_SelectedValueChanged(object? sender, EventArgs e)
{
ComboKeyChanged(sender, "m4");
} }
private void ComboM3_SelectedValueChanged(object? sender, EventArgs e) private void ComboM3_SelectedValueChanged(object? sender, EventArgs e)
{ {
if (sender is null) return; ComboKeyChanged(sender, "m3");
ComboBox cmb = (ComboBox)sender;
Program.config.setConfig("m3", cmb.SelectedIndex);
} }
private void Keyboard_Shown(object? sender, EventArgs e) private void Keyboard_Shown(object? sender, EventArgs e)
@@ -55,14 +80,14 @@
Top = Program.settingsForm.Top; Top = Program.settingsForm.Top;
Left = Program.settingsForm.Left - Width - 5; Left = Program.settingsForm.Left - Width - 5;
int m3 = Program.config.getConfig("m3"); string m3 = Program.config.getConfigString("m3");
int m4 = Program.config.getConfig("m4"); string m4 = Program.config.getConfigString("m4");
if (m3 != -1) comboM3.SelectedValue = (m3 is not null) ? m3 : "";
comboM3.SelectedIndex = m3; comboM4.SelectedValue = (m4 is not null) ? m4 : "";
if (m4 != -1) if (comboM3.SelectedValue is null) comboM3.SelectedValue = "";
comboM4.SelectedIndex = m4; if (comboM4.SelectedValue is null) comboM4.SelectedValue = "";
textM3.Text = Program.config.getConfigString("m3_custom"); textM3.Text = Program.config.getConfigString("m3_custom");
textM4.Text = Program.config.getConfigString("m4_custom"); textM4.Text = Program.config.getConfigString("m4_custom");

View File

@@ -11,6 +11,7 @@ public class NativeMethods
public const int VK_MEDIA_PLAY_PAUSE = 0xB3; public const int VK_MEDIA_PLAY_PAUSE = 0xB3;
public const int VK_MEDIA_PREV_TRACK = 0xB1; public const int VK_MEDIA_PREV_TRACK = 0xB1;
public const int VK_VOLUME_MUTE = 0xAD; public const int VK_VOLUME_MUTE = 0xAD;
public const int VK_SNAPSHOT = 0x2C;
[DllImport("user32.dll", SetLastError = true)] [DllImport("user32.dll", SetLastError = true)]
public static extern void keybd_event(byte virtualKey, byte scanCode, uint flags, IntPtr extraInfo); public static extern void keybd_event(byte virtualKey, byte scanCode, uint flags, IntPtr extraInfo);

View File

@@ -109,6 +109,63 @@ namespace GHelper
} }
static void CustomKey(string configKey = "m3")
{
string command = config.getConfigString(configKey + "_custom");
int intKey;
try
{
intKey = Convert.ToInt32(command, 16);
} catch
{
intKey = -1;
}
if (intKey > 0)
NativeMethods.KeyPress(intKey);
else
LaunchProcess(command);
}
static void KeyProcess(string name = "m3")
{
string action = config.getConfigString(name);
if (action.Length == 0)
{
if (name == "m4")
action = "performance";
}
switch (action)
{
case "mute":
NativeMethods.KeyPress(NativeMethods.VK_VOLUME_MUTE);
break;
case "play":
NativeMethods.KeyPress(NativeMethods.VK_MEDIA_PLAY_PAUSE);
break;
case "screenshot":
NativeMethods.KeyPress(NativeMethods.VK_SNAPSHOT);
break;
case "aura":
settingsForm.BeginInvoke(settingsForm.CycleAuraMode);
break;
case "performance":
settingsForm.BeginInvoke(settingsForm.CyclePerformanceMode);
break;
case "custom":
CustomKey(name);
break;
default:
break;
}
}
static void WatcherEventArrived(object sender, EventArrivedEventArgs e) static void WatcherEventArrived(object sender, EventArrivedEventArgs e)
{ {
var collection = (ManagementEventWatcher)sender; var collection = (ManagementEventWatcher)sender;
@@ -122,64 +179,17 @@ namespace GHelper
switch (EventID) switch (EventID)
{ {
case 124: // M3 case 124: // M3
switch (config.getConfig("m3")) KeyProcess("m3");
{
case 1:
NativeMethods.KeyPress(NativeMethods.VK_MEDIA_PLAY_PAUSE);
break;
case 2:
settingsForm.BeginInvoke(settingsForm.CycleAuraMode);
break;
case 3:
LaunchProcess(config.getConfigString("m3_custom"));
break;
default:
NativeMethods.KeyPress(NativeMethods.VK_VOLUME_MUTE);
break;
}
return; return;
case 56: // M4 / Rog button case 56: // M4 / Rog button
switch (config.getConfig("m4")) KeyProcess("m4");
{
case 1:
settingsForm.BeginInvoke(SettingsToggle);
break;
case 2:
LaunchProcess(config.getConfigString("m4_custom"));
break;
default:
settingsForm.BeginInvoke(settingsForm.CyclePerformanceMode);
break;
}
return; return;
case 174: // FN+F5 case 174: // FN+F5
settingsForm.BeginInvoke(settingsForm.CyclePerformanceMode); settingsForm.BeginInvoke(settingsForm.CyclePerformanceMode);
return; return;
case 179: // FN+F4 case 179: // FN+F4
settingsForm.BeginInvoke(delegate settingsForm.BeginInvoke(settingsForm.CycleAuraMode);
{
settingsForm.CycleAuraMode();
});
return; return;
case 87: // Battery
/*
settingsForm.BeginInvoke(delegate
{
settingsForm.AutoGPUMode(0);
settingsForm.AutoScreen(0);
});
*/
return;
case 88: // Plugged
/*
settingsForm.BeginInvoke(delegate
{
settingsForm.AutoScreen(1);
settingsForm.AutoGPUMode(1);
});
*/
return;
} }

261
Settings.Designer.cs generated
View File

@@ -88,10 +88,10 @@
// checkStartup // checkStartup
// //
checkStartup.AutoSize = true; checkStartup.AutoSize = true;
checkStartup.Location = new Point(35, 1138); checkStartup.Location = new Point(18, 569);
checkStartup.Margin = new Padding(4, 2, 4, 2); checkStartup.Margin = new Padding(2, 1, 2, 1);
checkStartup.Name = "checkStartup"; checkStartup.Name = "checkStartup";
checkStartup.Size = new Size(206, 36); checkStartup.Size = new Size(105, 19);
checkStartup.TabIndex = 2; checkStartup.TabIndex = 2;
checkStartup.Text = "Run on Startup"; checkStartup.Text = "Run on Startup";
checkStartup.UseVisualStyleBackColor = true; checkStartup.UseVisualStyleBackColor = true;
@@ -101,12 +101,12 @@
// //
trackBattery.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right; trackBattery.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
trackBattery.LargeChange = 20; trackBattery.LargeChange = 20;
trackBattery.Location = new Point(22, 1030); trackBattery.Location = new Point(11, 515);
trackBattery.Margin = new Padding(4, 2, 4, 2); trackBattery.Margin = new Padding(2, 1, 2, 1);
trackBattery.Maximum = 100; trackBattery.Maximum = 100;
trackBattery.Minimum = 50; trackBattery.Minimum = 50;
trackBattery.Name = "trackBattery"; trackBattery.Name = "trackBattery";
trackBattery.Size = new Size(682, 90); trackBattery.Size = new Size(341, 45);
trackBattery.SmallChange = 10; trackBattery.SmallChange = 10;
trackBattery.TabIndex = 3; trackBattery.TabIndex = 3;
trackBattery.TickFrequency = 10; trackBattery.TickFrequency = 10;
@@ -117,10 +117,10 @@
// //
labelBatteryTitle.AutoSize = true; labelBatteryTitle.AutoSize = true;
labelBatteryTitle.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point); labelBatteryTitle.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point);
labelBatteryTitle.Location = new Point(80, 992); labelBatteryTitle.Location = new Point(40, 496);
labelBatteryTitle.Margin = new Padding(4, 0, 4, 0); labelBatteryTitle.Margin = new Padding(2, 0, 2, 0);
labelBatteryTitle.Name = "labelBatteryTitle"; labelBatteryTitle.Name = "labelBatteryTitle";
labelBatteryTitle.Size = new Size(248, 32); labelBatteryTitle.Size = new Size(122, 15);
labelBatteryTitle.TabIndex = 4; labelBatteryTitle.TabIndex = 4;
labelBatteryTitle.Text = "Battery Charge Limit"; labelBatteryTitle.Text = "Battery Charge Limit";
// //
@@ -128,20 +128,20 @@
// //
pictureBattery.BackgroundImage = (Image)resources.GetObject("pictureBattery.BackgroundImage"); pictureBattery.BackgroundImage = (Image)resources.GetObject("pictureBattery.BackgroundImage");
pictureBattery.BackgroundImageLayout = ImageLayout.Zoom; pictureBattery.BackgroundImageLayout = ImageLayout.Zoom;
pictureBattery.Location = new Point(38, 990); pictureBattery.Location = new Point(19, 495);
pictureBattery.Margin = new Padding(4, 2, 4, 2); pictureBattery.Margin = new Padding(2, 1, 2, 1);
pictureBattery.Name = "pictureBattery"; pictureBattery.Name = "pictureBattery";
pictureBattery.Size = new Size(36, 38); pictureBattery.Size = new Size(18, 19);
pictureBattery.TabIndex = 6; pictureBattery.TabIndex = 6;
pictureBattery.TabStop = false; pictureBattery.TabStop = false;
// //
// labelGPUFan // labelGPUFan
// //
labelGPUFan.Anchor = AnchorStyles.Top | AnchorStyles.Right; labelGPUFan.Anchor = AnchorStyles.Top | AnchorStyles.Right;
labelGPUFan.Location = new Point(344, 262); labelGPUFan.Location = new Point(172, 131);
labelGPUFan.Margin = new Padding(4, 0, 4, 0); labelGPUFan.Margin = new Padding(2, 0, 2, 0);
labelGPUFan.Name = "labelGPUFan"; labelGPUFan.Name = "labelGPUFan";
labelGPUFan.Size = new Size(348, 32); labelGPUFan.Size = new Size(174, 16);
labelGPUFan.TabIndex = 8; labelGPUFan.TabIndex = 8;
labelGPUFan.Text = " "; labelGPUFan.Text = " ";
labelGPUFan.TextAlign = ContentAlignment.TopRight; labelGPUFan.TextAlign = ContentAlignment.TopRight;
@@ -156,12 +156,12 @@
tableGPU.Controls.Add(buttonUltimate, 2, 0); tableGPU.Controls.Add(buttonUltimate, 2, 0);
tableGPU.Controls.Add(buttonStandard, 1, 0); tableGPU.Controls.Add(buttonStandard, 1, 0);
tableGPU.Controls.Add(buttonEco, 0, 0); tableGPU.Controls.Add(buttonEco, 0, 0);
tableGPU.Location = new Point(22, 304); tableGPU.Location = new Point(11, 152);
tableGPU.Margin = new Padding(4, 2, 4, 2); tableGPU.Margin = new Padding(2, 1, 2, 1);
tableGPU.Name = "tableGPU"; tableGPU.Name = "tableGPU";
tableGPU.RowCount = 1; tableGPU.RowCount = 1;
tableGPU.RowStyles.Add(new RowStyle(SizeType.Absolute, 108F)); tableGPU.RowStyles.Add(new RowStyle(SizeType.Absolute, 54F));
tableGPU.Size = new Size(682, 108); tableGPU.Size = new Size(341, 54);
tableGPU.TabIndex = 7; tableGPU.TabIndex = 7;
// //
// buttonUltimate // buttonUltimate
@@ -170,10 +170,10 @@
buttonUltimate.Dock = DockStyle.Fill; buttonUltimate.Dock = DockStyle.Fill;
buttonUltimate.FlatAppearance.BorderSize = 0; buttonUltimate.FlatAppearance.BorderSize = 0;
buttonUltimate.FlatStyle = FlatStyle.Flat; buttonUltimate.FlatStyle = FlatStyle.Flat;
buttonUltimate.Location = new Point(462, 12); buttonUltimate.Location = new Point(230, 6);
buttonUltimate.Margin = new Padding(8, 12, 8, 12); buttonUltimate.Margin = new Padding(4, 6, 4, 6);
buttonUltimate.Name = "buttonUltimate"; buttonUltimate.Name = "buttonUltimate";
buttonUltimate.Size = new Size(212, 84); buttonUltimate.Size = new Size(107, 42);
buttonUltimate.TabIndex = 2; buttonUltimate.TabIndex = 2;
buttonUltimate.Text = "Ultimate"; buttonUltimate.Text = "Ultimate";
buttonUltimate.UseVisualStyleBackColor = false; buttonUltimate.UseVisualStyleBackColor = false;
@@ -184,10 +184,10 @@
buttonStandard.Dock = DockStyle.Fill; buttonStandard.Dock = DockStyle.Fill;
buttonStandard.FlatAppearance.BorderSize = 0; buttonStandard.FlatAppearance.BorderSize = 0;
buttonStandard.FlatStyle = FlatStyle.Flat; buttonStandard.FlatStyle = FlatStyle.Flat;
buttonStandard.Location = new Point(235, 12); buttonStandard.Location = new Point(117, 6);
buttonStandard.Margin = new Padding(8, 12, 8, 12); buttonStandard.Margin = new Padding(4, 6, 4, 6);
buttonStandard.Name = "buttonStandard"; buttonStandard.Name = "buttonStandard";
buttonStandard.Size = new Size(211, 84); buttonStandard.Size = new Size(105, 42);
buttonStandard.TabIndex = 1; buttonStandard.TabIndex = 1;
buttonStandard.Text = "Standard"; buttonStandard.Text = "Standard";
buttonStandard.UseVisualStyleBackColor = false; buttonStandard.UseVisualStyleBackColor = false;
@@ -199,10 +199,10 @@
buttonEco.Dock = DockStyle.Fill; buttonEco.Dock = DockStyle.Fill;
buttonEco.FlatAppearance.BorderSize = 0; buttonEco.FlatAppearance.BorderSize = 0;
buttonEco.FlatStyle = FlatStyle.Flat; buttonEco.FlatStyle = FlatStyle.Flat;
buttonEco.Location = new Point(8, 12); buttonEco.Location = new Point(4, 6);
buttonEco.Margin = new Padding(8, 12, 8, 12); buttonEco.Margin = new Padding(4, 6, 4, 6);
buttonEco.Name = "buttonEco"; buttonEco.Name = "buttonEco";
buttonEco.Size = new Size(211, 84); buttonEco.Size = new Size(105, 42);
buttonEco.TabIndex = 0; buttonEco.TabIndex = 0;
buttonEco.Text = "Eco"; buttonEco.Text = "Eco";
buttonEco.UseVisualStyleBackColor = false; buttonEco.UseVisualStyleBackColor = false;
@@ -211,10 +211,10 @@
// //
labelGPU.AutoSize = true; labelGPU.AutoSize = true;
labelGPU.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point); labelGPU.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point);
labelGPU.Location = new Point(78, 264); labelGPU.Location = new Point(39, 132);
labelGPU.Margin = new Padding(4, 0, 4, 0); labelGPU.Margin = new Padding(2, 0, 2, 0);
labelGPU.Name = "labelGPU"; labelGPU.Name = "labelGPU";
labelGPU.Size = new Size(136, 32); labelGPU.Size = new Size(67, 15);
labelGPU.TabIndex = 9; labelGPU.TabIndex = 9;
labelGPU.Text = "GPU Mode"; labelGPU.Text = "GPU Mode";
// //
@@ -222,20 +222,20 @@
// //
pictureGPU.BackgroundImage = (Image)resources.GetObject("pictureGPU.BackgroundImage"); pictureGPU.BackgroundImage = (Image)resources.GetObject("pictureGPU.BackgroundImage");
pictureGPU.BackgroundImageLayout = ImageLayout.Zoom; pictureGPU.BackgroundImageLayout = ImageLayout.Zoom;
pictureGPU.Location = new Point(36, 262); pictureGPU.Location = new Point(18, 131);
pictureGPU.Margin = new Padding(4, 2, 4, 2); pictureGPU.Margin = new Padding(2, 1, 2, 1);
pictureGPU.Name = "pictureGPU"; pictureGPU.Name = "pictureGPU";
pictureGPU.Size = new Size(36, 38); pictureGPU.Size = new Size(18, 19);
pictureGPU.TabIndex = 10; pictureGPU.TabIndex = 10;
pictureGPU.TabStop = false; pictureGPU.TabStop = false;
// //
// labelCPUFan // labelCPUFan
// //
labelCPUFan.Anchor = AnchorStyles.Top | AnchorStyles.Right; labelCPUFan.Anchor = AnchorStyles.Top | AnchorStyles.Right;
labelCPUFan.Location = new Point(326, 38); labelCPUFan.Location = new Point(163, 19);
labelCPUFan.Margin = new Padding(4, 0, 4, 0); labelCPUFan.Margin = new Padding(2, 0, 2, 0);
labelCPUFan.Name = "labelCPUFan"; labelCPUFan.Name = "labelCPUFan";
labelCPUFan.Size = new Size(366, 32); labelCPUFan.Size = new Size(183, 16);
labelCPUFan.TabIndex = 12; labelCPUFan.TabIndex = 12;
labelCPUFan.Text = " "; labelCPUFan.Text = " ";
labelCPUFan.TextAlign = ContentAlignment.TopRight; labelCPUFan.TextAlign = ContentAlignment.TopRight;
@@ -250,12 +250,12 @@
tablePerf.Controls.Add(buttonTurbo, 2, 0); tablePerf.Controls.Add(buttonTurbo, 2, 0);
tablePerf.Controls.Add(buttonBalanced, 1, 0); tablePerf.Controls.Add(buttonBalanced, 1, 0);
tablePerf.Controls.Add(buttonSilent, 0, 0); tablePerf.Controls.Add(buttonSilent, 0, 0);
tablePerf.Location = new Point(22, 76); tablePerf.Location = new Point(11, 38);
tablePerf.Margin = new Padding(4, 2, 4, 2); tablePerf.Margin = new Padding(2, 1, 2, 1);
tablePerf.Name = "tablePerf"; tablePerf.Name = "tablePerf";
tablePerf.RowCount = 1; tablePerf.RowCount = 1;
tablePerf.RowStyles.Add(new RowStyle(SizeType.Absolute, 108F)); tablePerf.RowStyles.Add(new RowStyle(SizeType.Absolute, 54F));
tablePerf.Size = new Size(682, 108); tablePerf.Size = new Size(341, 54);
tablePerf.TabIndex = 11; tablePerf.TabIndex = 11;
// //
// buttonTurbo // buttonTurbo
@@ -265,10 +265,10 @@
buttonTurbo.FlatAppearance.BorderColor = Color.FromArgb(192, 0, 0); buttonTurbo.FlatAppearance.BorderColor = Color.FromArgb(192, 0, 0);
buttonTurbo.FlatAppearance.BorderSize = 0; buttonTurbo.FlatAppearance.BorderSize = 0;
buttonTurbo.FlatStyle = FlatStyle.Flat; buttonTurbo.FlatStyle = FlatStyle.Flat;
buttonTurbo.Location = new Point(462, 12); buttonTurbo.Location = new Point(230, 6);
buttonTurbo.Margin = new Padding(8, 12, 8, 12); buttonTurbo.Margin = new Padding(4, 6, 4, 6);
buttonTurbo.Name = "buttonTurbo"; buttonTurbo.Name = "buttonTurbo";
buttonTurbo.Size = new Size(212, 84); buttonTurbo.Size = new Size(107, 42);
buttonTurbo.TabIndex = 2; buttonTurbo.TabIndex = 2;
buttonTurbo.Text = "Turbo"; buttonTurbo.Text = "Turbo";
buttonTurbo.UseVisualStyleBackColor = false; buttonTurbo.UseVisualStyleBackColor = false;
@@ -280,10 +280,10 @@
buttonBalanced.FlatAppearance.BorderColor = Color.FromArgb(0, 0, 192); buttonBalanced.FlatAppearance.BorderColor = Color.FromArgb(0, 0, 192);
buttonBalanced.FlatAppearance.BorderSize = 0; buttonBalanced.FlatAppearance.BorderSize = 0;
buttonBalanced.FlatStyle = FlatStyle.Flat; buttonBalanced.FlatStyle = FlatStyle.Flat;
buttonBalanced.Location = new Point(235, 12); buttonBalanced.Location = new Point(117, 6);
buttonBalanced.Margin = new Padding(8, 12, 8, 12); buttonBalanced.Margin = new Padding(4, 6, 4, 6);
buttonBalanced.Name = "buttonBalanced"; buttonBalanced.Name = "buttonBalanced";
buttonBalanced.Size = new Size(211, 84); buttonBalanced.Size = new Size(105, 42);
buttonBalanced.TabIndex = 1; buttonBalanced.TabIndex = 1;
buttonBalanced.Text = "Balanced"; buttonBalanced.Text = "Balanced";
buttonBalanced.UseVisualStyleBackColor = false; buttonBalanced.UseVisualStyleBackColor = false;
@@ -296,10 +296,10 @@
buttonSilent.FlatAppearance.BorderColor = Color.FromArgb(0, 192, 192); buttonSilent.FlatAppearance.BorderColor = Color.FromArgb(0, 192, 192);
buttonSilent.FlatAppearance.BorderSize = 0; buttonSilent.FlatAppearance.BorderSize = 0;
buttonSilent.FlatStyle = FlatStyle.Flat; buttonSilent.FlatStyle = FlatStyle.Flat;
buttonSilent.Location = new Point(8, 12); buttonSilent.Location = new Point(4, 6);
buttonSilent.Margin = new Padding(8, 12, 8, 12); buttonSilent.Margin = new Padding(4, 6, 4, 6);
buttonSilent.Name = "buttonSilent"; buttonSilent.Name = "buttonSilent";
buttonSilent.Size = new Size(211, 84); buttonSilent.Size = new Size(105, 42);
buttonSilent.TabIndex = 0; buttonSilent.TabIndex = 0;
buttonSilent.Text = "Silent"; buttonSilent.Text = "Silent";
buttonSilent.UseVisualStyleBackColor = false; buttonSilent.UseVisualStyleBackColor = false;
@@ -309,10 +309,10 @@
picturePerf.BackgroundImage = (Image)resources.GetObject("picturePerf.BackgroundImage"); picturePerf.BackgroundImage = (Image)resources.GetObject("picturePerf.BackgroundImage");
picturePerf.BackgroundImageLayout = ImageLayout.Zoom; picturePerf.BackgroundImageLayout = ImageLayout.Zoom;
picturePerf.InitialImage = null; picturePerf.InitialImage = null;
picturePerf.Location = new Point(36, 36); picturePerf.Location = new Point(18, 18);
picturePerf.Margin = new Padding(4, 2, 4, 2); picturePerf.Margin = new Padding(2, 1, 2, 1);
picturePerf.Name = "picturePerf"; picturePerf.Name = "picturePerf";
picturePerf.Size = new Size(36, 38); picturePerf.Size = new Size(18, 19);
picturePerf.TabIndex = 14; picturePerf.TabIndex = 14;
picturePerf.TabStop = false; picturePerf.TabStop = false;
// //
@@ -320,10 +320,10 @@
// //
labelPerf.AutoSize = true; labelPerf.AutoSize = true;
labelPerf.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point); labelPerf.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point);
labelPerf.Location = new Point(78, 38); labelPerf.Location = new Point(39, 19);
labelPerf.Margin = new Padding(4, 0, 4, 0); labelPerf.Margin = new Padding(2, 0, 2, 0);
labelPerf.Name = "labelPerf"; labelPerf.Name = "labelPerf";
labelPerf.Size = new Size(234, 32); labelPerf.Size = new Size(115, 15);
labelPerf.TabIndex = 13; labelPerf.TabIndex = 13;
labelPerf.Text = "Performance Mode"; labelPerf.Text = "Performance Mode";
// //
@@ -331,10 +331,10 @@
// //
checkGPU.AutoSize = true; checkGPU.AutoSize = true;
checkGPU.ForeColor = SystemColors.GrayText; checkGPU.ForeColor = SystemColors.GrayText;
checkGPU.Location = new Point(32, 412); checkGPU.Location = new Point(16, 206);
checkGPU.Margin = new Padding(4, 2, 4, 2); checkGPU.Margin = new Padding(2, 1, 2, 1);
checkGPU.Name = "checkGPU"; checkGPU.Name = "checkGPU";
checkGPU.Size = new Size(550, 36); checkGPU.Size = new Size(273, 19);
checkGPU.TabIndex = 15; checkGPU.TabIndex = 15;
checkGPU.Text = "Set Eco on battery and Standard when plugged"; checkGPU.Text = "Set Eco on battery and Standard when plugged";
checkGPU.UseVisualStyleBackColor = true; checkGPU.UseVisualStyleBackColor = true;
@@ -344,10 +344,10 @@
// //
buttonQuit.Anchor = AnchorStyles.Top | AnchorStyles.Right; buttonQuit.Anchor = AnchorStyles.Top | AnchorStyles.Right;
buttonQuit.BackColor = SystemColors.ButtonFace; buttonQuit.BackColor = SystemColors.ButtonFace;
buttonQuit.Location = new Point(584, 1130); buttonQuit.Location = new Point(292, 565);
buttonQuit.Margin = new Padding(4, 2, 4, 2); buttonQuit.Margin = new Padding(2, 1, 2, 1);
buttonQuit.Name = "buttonQuit"; buttonQuit.Name = "buttonQuit";
buttonQuit.Size = new Size(120, 48); buttonQuit.Size = new Size(60, 24);
buttonQuit.TabIndex = 16; buttonQuit.TabIndex = 16;
buttonQuit.Text = "Quit"; buttonQuit.Text = "Quit";
buttonQuit.UseVisualStyleBackColor = false; buttonQuit.UseVisualStyleBackColor = false;
@@ -356,10 +356,10 @@
// //
pictureScreen.BackgroundImage = (Image)resources.GetObject("pictureScreen.BackgroundImage"); pictureScreen.BackgroundImage = (Image)resources.GetObject("pictureScreen.BackgroundImage");
pictureScreen.BackgroundImageLayout = ImageLayout.Zoom; pictureScreen.BackgroundImageLayout = ImageLayout.Zoom;
pictureScreen.Location = new Point(36, 496); pictureScreen.Location = new Point(18, 248);
pictureScreen.Margin = new Padding(4, 2, 4, 2); pictureScreen.Margin = new Padding(2, 1, 2, 1);
pictureScreen.Name = "pictureScreen"; pictureScreen.Name = "pictureScreen";
pictureScreen.Size = new Size(36, 38); pictureScreen.Size = new Size(18, 19);
pictureScreen.TabIndex = 18; pictureScreen.TabIndex = 18;
pictureScreen.TabStop = false; pictureScreen.TabStop = false;
// //
@@ -367,10 +367,10 @@
// //
labelSreen.AutoSize = true; labelSreen.AutoSize = true;
labelSreen.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point); labelSreen.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point);
labelSreen.Location = new Point(78, 496); labelSreen.Location = new Point(39, 248);
labelSreen.Margin = new Padding(4, 0, 4, 0); labelSreen.Margin = new Padding(2, 0, 2, 0);
labelSreen.Name = "labelSreen"; labelSreen.Name = "labelSreen";
labelSreen.Size = new Size(176, 32); labelSreen.Size = new Size(87, 15);
labelSreen.TabIndex = 17; labelSreen.TabIndex = 17;
labelSreen.Text = "Laptop Screen"; labelSreen.Text = "Laptop Screen";
// //
@@ -383,12 +383,12 @@
tableScreen.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 33.33333F)); tableScreen.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 33.33333F));
tableScreen.Controls.Add(button120Hz, 1, 0); tableScreen.Controls.Add(button120Hz, 1, 0);
tableScreen.Controls.Add(button60Hz, 0, 0); tableScreen.Controls.Add(button60Hz, 0, 0);
tableScreen.Location = new Point(22, 536); tableScreen.Location = new Point(11, 268);
tableScreen.Margin = new Padding(4, 2, 4, 2); tableScreen.Margin = new Padding(2, 1, 2, 1);
tableScreen.Name = "tableScreen"; tableScreen.Name = "tableScreen";
tableScreen.RowCount = 1; tableScreen.RowCount = 1;
tableScreen.RowStyles.Add(new RowStyle(SizeType.Absolute, 108F)); tableScreen.RowStyles.Add(new RowStyle(SizeType.Absolute, 54F));
tableScreen.Size = new Size(682, 108); tableScreen.Size = new Size(341, 54);
tableScreen.TabIndex = 19; tableScreen.TabIndex = 19;
// //
// button120Hz // button120Hz
@@ -398,10 +398,10 @@
button120Hz.FlatAppearance.BorderColor = SystemColors.ActiveBorder; button120Hz.FlatAppearance.BorderColor = SystemColors.ActiveBorder;
button120Hz.FlatAppearance.BorderSize = 0; button120Hz.FlatAppearance.BorderSize = 0;
button120Hz.FlatStyle = FlatStyle.Flat; button120Hz.FlatStyle = FlatStyle.Flat;
button120Hz.Location = new Point(235, 12); button120Hz.Location = new Point(117, 6);
button120Hz.Margin = new Padding(8, 12, 8, 12); button120Hz.Margin = new Padding(4, 6, 4, 6);
button120Hz.Name = "button120Hz"; button120Hz.Name = "button120Hz";
button120Hz.Size = new Size(211, 84); button120Hz.Size = new Size(105, 42);
button120Hz.TabIndex = 1; button120Hz.TabIndex = 1;
button120Hz.Text = "120Hz + OD"; button120Hz.Text = "120Hz + OD";
button120Hz.UseVisualStyleBackColor = false; button120Hz.UseVisualStyleBackColor = false;
@@ -415,10 +415,10 @@
button60Hz.FlatAppearance.BorderSize = 0; button60Hz.FlatAppearance.BorderSize = 0;
button60Hz.FlatStyle = FlatStyle.Flat; button60Hz.FlatStyle = FlatStyle.Flat;
button60Hz.ForeColor = SystemColors.ControlText; button60Hz.ForeColor = SystemColors.ControlText;
button60Hz.Location = new Point(8, 12); button60Hz.Location = new Point(4, 6);
button60Hz.Margin = new Padding(8, 12, 8, 12); button60Hz.Margin = new Padding(4, 6, 4, 6);
button60Hz.Name = "button60Hz"; button60Hz.Name = "button60Hz";
button60Hz.Size = new Size(211, 84); button60Hz.Size = new Size(105, 42);
button60Hz.TabIndex = 0; button60Hz.TabIndex = 0;
button60Hz.Text = "60Hz"; button60Hz.Text = "60Hz";
button60Hz.UseVisualStyleBackColor = false; button60Hz.UseVisualStyleBackColor = false;
@@ -427,10 +427,10 @@
// //
checkScreen.AutoSize = true; checkScreen.AutoSize = true;
checkScreen.ForeColor = SystemColors.GrayText; checkScreen.ForeColor = SystemColors.GrayText;
checkScreen.Location = new Point(32, 644); checkScreen.Location = new Point(16, 322);
checkScreen.Margin = new Padding(4, 2, 4, 2); checkScreen.Margin = new Padding(2, 1, 2, 1);
checkScreen.Name = "checkScreen"; checkScreen.Name = "checkScreen";
checkScreen.Size = new Size(527, 36); checkScreen.Size = new Size(261, 19);
checkScreen.TabIndex = 20; checkScreen.TabIndex = 20;
checkScreen.Text = "Set 60Hz on battery, and back when plugged"; checkScreen.Text = "Set 60Hz on battery, and back when plugged";
checkScreen.UseVisualStyleBackColor = true; checkScreen.UseVisualStyleBackColor = true;
@@ -439,10 +439,10 @@
// //
checkBoost.AutoSize = true; checkBoost.AutoSize = true;
checkBoost.ForeColor = SystemColors.GrayText; checkBoost.ForeColor = SystemColors.GrayText;
checkBoost.Location = new Point(32, 184); checkBoost.Location = new Point(16, 92);
checkBoost.Margin = new Padding(4, 2, 4, 2); checkBoost.Margin = new Padding(2, 1, 2, 1);
checkBoost.Name = "checkBoost"; checkBoost.Name = "checkBoost";
checkBoost.Size = new Size(320, 36); checkBoost.Size = new Size(161, 19);
checkBoost.TabIndex = 21; checkBoost.TabIndex = 21;
checkBoost.Text = "CPU Turbo Boost enabled"; checkBoost.Text = "CPU Turbo Boost enabled";
checkBoost.UseVisualStyleBackColor = true; checkBoost.UseVisualStyleBackColor = true;
@@ -451,10 +451,10 @@
// //
pictureKeyboard.BackgroundImage = Properties.Resources.icons8_keyboard_48; pictureKeyboard.BackgroundImage = Properties.Resources.icons8_keyboard_48;
pictureKeyboard.BackgroundImageLayout = ImageLayout.Zoom; pictureKeyboard.BackgroundImageLayout = ImageLayout.Zoom;
pictureKeyboard.Location = new Point(36, 724); pictureKeyboard.Location = new Point(18, 362);
pictureKeyboard.Margin = new Padding(4, 2, 4, 2); pictureKeyboard.Margin = new Padding(2, 1, 2, 1);
pictureKeyboard.Name = "pictureKeyboard"; pictureKeyboard.Name = "pictureKeyboard";
pictureKeyboard.Size = new Size(36, 36); pictureKeyboard.Size = new Size(18, 18);
pictureKeyboard.TabIndex = 23; pictureKeyboard.TabIndex = 23;
pictureKeyboard.TabStop = false; pictureKeyboard.TabStop = false;
// //
@@ -462,10 +462,10 @@
// //
label1.AutoSize = true; label1.AutoSize = true;
label1.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point); label1.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point);
label1.Location = new Point(78, 724); label1.Location = new Point(39, 362);
label1.Margin = new Padding(4, 0, 4, 0); label1.Margin = new Padding(2, 0, 2, 0);
label1.Name = "label1"; label1.Name = "label1";
label1.Size = new Size(210, 32); label1.Size = new Size(101, 15);
label1.TabIndex = 22; label1.TabIndex = 22;
label1.Text = "Laptop Keyboard"; label1.Text = "Laptop Keyboard";
// //
@@ -473,12 +473,12 @@
// //
comboKeyboard.Font = new Font("Segoe UI", 9F, FontStyle.Regular, GraphicsUnit.Point); comboKeyboard.Font = new Font("Segoe UI", 9F, FontStyle.Regular, GraphicsUnit.Point);
comboKeyboard.FormattingEnabled = true; comboKeyboard.FormattingEnabled = true;
comboKeyboard.ItemHeight = 32; comboKeyboard.ItemHeight = 15;
comboKeyboard.Items.AddRange(new object[] { "Static", "Breathe", "Strobe", "Rainbow", "Dingding" }); comboKeyboard.Items.AddRange(new object[] { "Static", "Breathe", "Strobe", "Rainbow", "Dingding" });
comboKeyboard.Location = new Point(30, 770); comboKeyboard.Location = new Point(15, 385);
comboKeyboard.Margin = new Padding(0); comboKeyboard.Margin = new Padding(0);
comboKeyboard.Name = "comboKeyboard"; comboKeyboard.Name = "comboKeyboard";
comboKeyboard.Size = new Size(211, 40); comboKeyboard.Size = new Size(108, 23);
comboKeyboard.TabIndex = 24; comboKeyboard.TabIndex = 24;
comboKeyboard.TabStop = false; comboKeyboard.TabStop = false;
// //
@@ -489,10 +489,10 @@
buttonKeyboardColor.FlatAppearance.BorderColor = Color.Red; buttonKeyboardColor.FlatAppearance.BorderColor = Color.Red;
buttonKeyboardColor.FlatAppearance.BorderSize = 2; buttonKeyboardColor.FlatAppearance.BorderSize = 2;
buttonKeyboardColor.ForeColor = SystemColors.ControlText; buttonKeyboardColor.ForeColor = SystemColors.ControlText;
buttonKeyboardColor.Location = new Point(257, 766); buttonKeyboardColor.Location = new Point(128, 383);
buttonKeyboardColor.Margin = new Padding(0); buttonKeyboardColor.Margin = new Padding(0);
buttonKeyboardColor.Name = "buttonKeyboardColor"; buttonKeyboardColor.Name = "buttonKeyboardColor";
buttonKeyboardColor.Size = new Size(211, 48); buttonKeyboardColor.Size = new Size(106, 25);
buttonKeyboardColor.TabIndex = 25; buttonKeyboardColor.TabIndex = 25;
buttonKeyboardColor.Text = "Color "; buttonKeyboardColor.Text = "Color ";
buttonKeyboardColor.UseVisualStyleBackColor = false; buttonKeyboardColor.UseVisualStyleBackColor = false;
@@ -500,10 +500,10 @@
// labelBattery // labelBattery
// //
labelBattery.Anchor = AnchorStyles.Top | AnchorStyles.Right; labelBattery.Anchor = AnchorStyles.Top | AnchorStyles.Right;
labelBattery.Location = new Point(420, 991); labelBattery.Location = new Point(210, 496);
labelBattery.Margin = new Padding(4, 0, 4, 0); labelBattery.Margin = new Padding(2, 0, 2, 0);
labelBattery.Name = "labelBattery"; labelBattery.Name = "labelBattery";
labelBattery.Size = new Size(276, 32); labelBattery.Size = new Size(138, 16);
labelBattery.TabIndex = 27; labelBattery.TabIndex = 27;
labelBattery.Text = " "; labelBattery.Text = " ";
labelBattery.TextAlign = ContentAlignment.TopRight; labelBattery.TextAlign = ContentAlignment.TopRight;
@@ -513,10 +513,10 @@
buttonFans.Anchor = AnchorStyles.Top | AnchorStyles.Right; buttonFans.Anchor = AnchorStyles.Top | AnchorStyles.Right;
buttonFans.BackColor = SystemColors.ButtonFace; buttonFans.BackColor = SystemColors.ButtonFace;
buttonFans.FlatAppearance.BorderSize = 0; buttonFans.FlatAppearance.BorderSize = 0;
buttonFans.Location = new Point(486, 186); buttonFans.Location = new Point(243, 93);
buttonFans.Margin = new Padding(4, 2, 4, 2); buttonFans.Margin = new Padding(2, 1, 2, 1);
buttonFans.Name = "buttonFans"; buttonFans.Name = "buttonFans";
buttonFans.Size = new Size(210, 48); buttonFans.Size = new Size(105, 24);
buttonFans.TabIndex = 28; buttonFans.TabIndex = 28;
buttonFans.Text = "Fans and Power"; buttonFans.Text = "Fans and Power";
buttonFans.UseVisualStyleBackColor = false; buttonFans.UseVisualStyleBackColor = false;
@@ -526,27 +526,29 @@
buttonKeyboard.Anchor = AnchorStyles.Top | AnchorStyles.Right; buttonKeyboard.Anchor = AnchorStyles.Top | AnchorStyles.Right;
buttonKeyboard.BackColor = SystemColors.ButtonFace; buttonKeyboard.BackColor = SystemColors.ButtonFace;
buttonKeyboard.FlatAppearance.BorderSize = 0; buttonKeyboard.FlatAppearance.BorderSize = 0;
buttonKeyboard.Location = new Point(486, 765); buttonKeyboard.Location = new Point(243, 382);
buttonKeyboard.Margin = new Padding(4, 2, 4, 2); buttonKeyboard.Margin = new Padding(2, 1, 2, 1);
buttonKeyboard.Name = "buttonKeyboard"; buttonKeyboard.Name = "buttonKeyboard";
buttonKeyboard.Size = new Size(209, 48); buttonKeyboard.Size = new Size(104, 24);
buttonKeyboard.TabIndex = 29; buttonKeyboard.TabIndex = 29;
buttonKeyboard.Text = "Extra"; buttonKeyboard.Text = "Extra";
buttonKeyboard.UseVisualStyleBackColor = false; buttonKeyboard.UseVisualStyleBackColor = false;
// //
// pictureColor // pictureColor
// //
pictureColor.Location = new Point(431, 781); pictureColor.Location = new Point(216, 390);
pictureColor.Margin = new Padding(2, 2, 2, 2);
pictureColor.Name = "pictureColor"; pictureColor.Name = "pictureColor";
pictureColor.Size = new Size(20, 20); pictureColor.Size = new Size(10, 10);
pictureColor.TabIndex = 30; pictureColor.TabIndex = 30;
pictureColor.TabStop = false; pictureColor.TabStop = false;
// //
// pictureColor2 // pictureColor2
// //
pictureColor2.Location = new Point(405, 781); pictureColor2.Location = new Point(202, 390);
pictureColor2.Margin = new Padding(2, 2, 2, 2);
pictureColor2.Name = "pictureColor2"; pictureColor2.Name = "pictureColor2";
pictureColor2.Size = new Size(20, 20); pictureColor2.Size = new Size(10, 10);
pictureColor2.TabIndex = 31; pictureColor2.TabIndex = 31;
pictureColor2.TabStop = false; pictureColor2.TabStop = false;
// //
@@ -555,9 +557,10 @@
labelVersion.AutoSize = true; labelVersion.AutoSize = true;
labelVersion.Font = new Font("Segoe UI", 9F, FontStyle.Underline, GraphicsUnit.Point); labelVersion.Font = new Font("Segoe UI", 9F, FontStyle.Underline, GraphicsUnit.Point);
labelVersion.ForeColor = SystemColors.ControlDark; labelVersion.ForeColor = SystemColors.ControlDark;
labelVersion.Location = new Point(36, 1088); labelVersion.Location = new Point(18, 544);
labelVersion.Margin = new Padding(2, 0, 2, 0);
labelVersion.Name = "labelVersion"; labelVersion.Name = "labelVersion";
labelVersion.Size = new Size(44, 32); labelVersion.Size = new Size(22, 15);
labelVersion.TabIndex = 32; labelVersion.TabIndex = 32;
labelVersion.Text = "v.0"; labelVersion.Text = "v.0";
// //
@@ -565,10 +568,10 @@
// //
pictureMatrix.BackgroundImage = Properties.Resources.icons8_matrix_desktop_48; pictureMatrix.BackgroundImage = Properties.Resources.icons8_matrix_desktop_48;
pictureMatrix.BackgroundImageLayout = ImageLayout.Zoom; pictureMatrix.BackgroundImageLayout = ImageLayout.Zoom;
pictureMatrix.Location = new Point(36, 858); pictureMatrix.Location = new Point(18, 429);
pictureMatrix.Margin = new Padding(4, 2, 4, 2); pictureMatrix.Margin = new Padding(2, 1, 2, 1);
pictureMatrix.Name = "pictureMatrix"; pictureMatrix.Name = "pictureMatrix";
pictureMatrix.Size = new Size(36, 36); pictureMatrix.Size = new Size(18, 18);
pictureMatrix.TabIndex = 34; pictureMatrix.TabIndex = 34;
pictureMatrix.TabStop = false; pictureMatrix.TabStop = false;
// //
@@ -576,10 +579,10 @@
// //
labelMatrix.AutoSize = true; labelMatrix.AutoSize = true;
labelMatrix.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point); labelMatrix.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point);
labelMatrix.Location = new Point(78, 858); labelMatrix.Location = new Point(39, 429);
labelMatrix.Margin = new Padding(4, 0, 4, 0); labelMatrix.Margin = new Padding(2, 0, 2, 0);
labelMatrix.Name = "labelMatrix"; labelMatrix.Name = "labelMatrix";
labelMatrix.Size = new Size(170, 32); labelMatrix.Size = new Size(83, 15);
labelMatrix.TabIndex = 33; labelMatrix.TabIndex = 33;
labelMatrix.Text = "Anime Matrix"; labelMatrix.Text = "Anime Matrix";
// //
@@ -587,12 +590,12 @@
// //
comboMatrix.Font = new Font("Segoe UI", 9F, FontStyle.Regular, GraphicsUnit.Point); comboMatrix.Font = new Font("Segoe UI", 9F, FontStyle.Regular, GraphicsUnit.Point);
comboMatrix.FormattingEnabled = true; comboMatrix.FormattingEnabled = true;
comboMatrix.ItemHeight = 32; comboMatrix.ItemHeight = 15;
comboMatrix.Items.AddRange(new object[] { "Off", "Dim", "Medium", "Bright" }); comboMatrix.Items.AddRange(new object[] { "Off", "Dim", "Medium", "Bright" });
comboMatrix.Location = new Point(30, 910); comboMatrix.Location = new Point(15, 455);
comboMatrix.Margin = new Padding(0); comboMatrix.Margin = new Padding(0);
comboMatrix.Name = "comboMatrix"; comboMatrix.Name = "comboMatrix";
comboMatrix.Size = new Size(211, 40); comboMatrix.Size = new Size(108, 23);
comboMatrix.TabIndex = 35; comboMatrix.TabIndex = 35;
comboMatrix.TabStop = false; comboMatrix.TabStop = false;
// //
@@ -600,12 +603,12 @@
// //
comboMatrixRunning.Font = new Font("Segoe UI", 9F, FontStyle.Regular, GraphicsUnit.Point); comboMatrixRunning.Font = new Font("Segoe UI", 9F, FontStyle.Regular, GraphicsUnit.Point);
comboMatrixRunning.FormattingEnabled = true; comboMatrixRunning.FormattingEnabled = true;
comboMatrixRunning.ItemHeight = 32; comboMatrixRunning.ItemHeight = 15;
comboMatrixRunning.Items.AddRange(new object[] { "Binary Banner", "Rog Logo", "Picture" }); comboMatrixRunning.Items.AddRange(new object[] { "Binary Banner", "Rog Logo", "Picture" });
comboMatrixRunning.Location = new Point(257, 910); comboMatrixRunning.Location = new Point(128, 455);
comboMatrixRunning.Margin = new Padding(0); comboMatrixRunning.Margin = new Padding(0);
comboMatrixRunning.Name = "comboMatrixRunning"; comboMatrixRunning.Name = "comboMatrixRunning";
comboMatrixRunning.Size = new Size(211, 40); comboMatrixRunning.Size = new Size(108, 23);
comboMatrixRunning.TabIndex = 36; comboMatrixRunning.TabIndex = 36;
comboMatrixRunning.TabStop = false; comboMatrixRunning.TabStop = false;
// //
@@ -614,19 +617,19 @@
buttonMatrix.Anchor = AnchorStyles.Top | AnchorStyles.Right; buttonMatrix.Anchor = AnchorStyles.Top | AnchorStyles.Right;
buttonMatrix.BackColor = SystemColors.ButtonFace; buttonMatrix.BackColor = SystemColors.ButtonFace;
buttonMatrix.FlatAppearance.BorderSize = 0; buttonMatrix.FlatAppearance.BorderSize = 0;
buttonMatrix.Location = new Point(486, 905); buttonMatrix.Location = new Point(243, 452);
buttonMatrix.Margin = new Padding(4, 2, 4, 2); buttonMatrix.Margin = new Padding(2, 1, 2, 1);
buttonMatrix.Name = "buttonMatrix"; buttonMatrix.Name = "buttonMatrix";
buttonMatrix.Size = new Size(209, 48); buttonMatrix.Size = new Size(104, 24);
buttonMatrix.TabIndex = 37; buttonMatrix.TabIndex = 37;
buttonMatrix.Text = "Picture"; buttonMatrix.Text = "Picture";
buttonMatrix.UseVisualStyleBackColor = false; buttonMatrix.UseVisualStyleBackColor = false;
// //
// SettingsForm // SettingsForm
// //
AutoScaleDimensions = new SizeF(192F, 192F); AutoScaleDimensions = new SizeF(96F, 96F);
AutoScaleMode = AutoScaleMode.Dpi; AutoScaleMode = AutoScaleMode.Dpi;
ClientSize = new Size(736, 1203); ClientSize = new Size(368, 602);
Controls.Add(buttonMatrix); Controls.Add(buttonMatrix);
Controls.Add(comboMatrixRunning); Controls.Add(comboMatrixRunning);
Controls.Add(comboMatrix); Controls.Add(comboMatrix);
@@ -662,12 +665,12 @@
Controls.Add(trackBattery); Controls.Add(trackBattery);
Controls.Add(checkStartup); Controls.Add(checkStartup);
FormBorderStyle = FormBorderStyle.FixedSingle; FormBorderStyle = FormBorderStyle.FixedSingle;
Margin = new Padding(4, 2, 4, 2); Margin = new Padding(2, 1, 2, 1);
MaximizeBox = false; MaximizeBox = false;
MdiChildrenMinimizedAnchorBottom = false; MdiChildrenMinimizedAnchorBottom = false;
MinimizeBox = false; MinimizeBox = false;
Name = "SettingsForm"; Name = "SettingsForm";
Padding = new Padding(8, 12, 8, 12); Padding = new Padding(4, 6, 4, 6);
ShowIcon = false; ShowIcon = false;
StartPosition = FormStartPosition.CenterScreen; StartPosition = FormStartPosition.CenterScreen;
Text = "G-Helper"; Text = "G-Helper";

View File

@@ -572,7 +572,7 @@ namespace GHelper
if (Program.config.getConfig("fan_rpm") == 1) if (Program.config.getConfig("fan_rpm") == 1)
return " Fan: " + (fan * 100).ToString() + "RPM"; return " Fan: " + (fan * 100).ToString() + "RPM";
else else
return " Fan: " + Math.Round(fan / 0.6).ToString() + "%"; // relatively to 6000 rpm return " Fan: " + Math.Min(Math.Round(fan / 0.6), 100).ToString() + "%"; // relatively to 6000 rpm
} }
private static void RefreshSensors() private static void RefreshSensors()
@@ -604,7 +604,7 @@ namespace GHelper
private static void OnTimedEvent(Object? source, ElapsedEventArgs? e) private static void OnTimedEvent(Object? source, ElapsedEventArgs? e)
{ {
RefreshSensors(); RefreshSensors();
aTimer.Interval = 1000; aTimer.Interval = 2000;
} }
private void SettingsForm_VisibleChanged(object? sender, EventArgs e) private void SettingsForm_VisibleChanged(object? sender, EventArgs e)
@@ -617,7 +617,7 @@ namespace GHelper
this.Top = Screen.FromControl(this).WorkingArea.Height - 10 - this.Height; this.Top = Screen.FromControl(this).WorkingArea.Height - 10 - this.Height;
this.Activate(); this.Activate();
aTimer.Interval = 100; aTimer.Interval = 300;
aTimer.Enabled = true; aTimer.Enabled = true;
} }