mirror of
https://github.com/jkocon/g-helper.git
synced 2026-02-23 13:00:52 +01:00
Added sleep/awake/boot/shutdown control for keyboards
This commit is contained in:
@@ -249,19 +249,23 @@ public class ASUSWmi
|
||||
setting[5] = (byte)speed;
|
||||
|
||||
DeviceSet(TUF_KB, setting);
|
||||
Debug.WriteLine(BitConverter.ToString(setting));
|
||||
//Debug.WriteLine(BitConverter.ToString(setting));
|
||||
|
||||
/*
|
||||
uint flags, boot = 1, awake = 1, sleep = 1, keyboard = 1;
|
||||
}
|
||||
|
||||
public void TUFKeyboardPower(bool awake = true, bool boot = false, bool sleep = false, bool shutdown = false)
|
||||
{
|
||||
uint flags;
|
||||
uint cmd = 1;
|
||||
|
||||
flags = 0;
|
||||
if (boot != 0)
|
||||
if (boot)
|
||||
flags |= (1 << 1);
|
||||
if (awake != 0)
|
||||
if (awake)
|
||||
flags |= (1 << 3);
|
||||
if (sleep != 0)
|
||||
if (sleep)
|
||||
flags |= (1 << 5);
|
||||
if (keyboard != 0)
|
||||
if (shutdown)
|
||||
flags |= (1 << 7);
|
||||
|
||||
byte[] state = new byte[12];
|
||||
@@ -271,8 +275,6 @@ public class ASUSWmi
|
||||
|
||||
DeviceSet(TUF_KB, state);
|
||||
Debug.WriteLine(BitConverter.ToString(state));
|
||||
*/
|
||||
|
||||
}
|
||||
|
||||
public void SubscribeToEvents(Action<object, EventArrivedEventArgs> EventHandler)
|
||||
|
||||
88
app/Aura.cs
88
app/Aura.cs
@@ -1,10 +1,56 @@
|
||||
using HidLibrary;
|
||||
using Microsoft.VisualBasic.ApplicationServices;
|
||||
using System.Diagnostics;
|
||||
using static Starlight.AnimeMatrix.BuiltInAnimation;
|
||||
|
||||
namespace GHelper
|
||||
{
|
||||
|
||||
[Flags]
|
||||
public enum AuraDev19b6 : uint
|
||||
{
|
||||
BootLogo = 1,
|
||||
BootKeyb = 1 << 1,
|
||||
AwakeLogo = 1 << 2,
|
||||
AwakeKeyb = 1 << 3,
|
||||
SleepLogo = 1 << 4,
|
||||
SleepKeyb = 1 << 5,
|
||||
ShutdownLogo = 1 << 6,
|
||||
ShutdownKeyb = 1 << 7,
|
||||
BootBar = 1u << (7 + 2),
|
||||
AwakeBar = 1u << (7 + 3),
|
||||
SleepBar = 1u << (7 + 4),
|
||||
ShutdownBar = 1u << (7 + 5),
|
||||
BootLid = 1u << (15 + 1),
|
||||
AwakeLid = 1u << (15 + 2),
|
||||
SleepLid = 1u << (15 + 3),
|
||||
ShutdownLid = 1u << (15 + 4)
|
||||
}
|
||||
|
||||
public class Aura
|
||||
public static class AuraDev19b6Extensions
|
||||
{
|
||||
public static byte[] ToBytes(this AuraDev19b6[] controls)
|
||||
{
|
||||
uint a = 0;
|
||||
foreach (var n in controls)
|
||||
{
|
||||
a |= (uint)n;
|
||||
}
|
||||
return new byte[] {0x5d, 0xbd, 0x01, (byte)(a & 0xff), (byte)((a & 0xff00) >> 8), (byte)((a & 0xff0000) >> 16) };
|
||||
}
|
||||
|
||||
public static ushort BitOr(this AuraDev19b6 self, AuraDev19b6 rhs)
|
||||
{
|
||||
return (ushort)(self | rhs);
|
||||
}
|
||||
|
||||
public static ushort BitAnd(this AuraDev19b6 self, AuraDev19b6 rhs)
|
||||
{
|
||||
return (ushort)(self & rhs);
|
||||
}
|
||||
}
|
||||
|
||||
public static class Aura
|
||||
{
|
||||
|
||||
static byte[] MESSAGE_SET = { 0x5d, 0xb5, 0, 0, 0 };
|
||||
@@ -32,7 +78,8 @@ namespace GHelper
|
||||
{
|
||||
{ 0, "Static" },
|
||||
{ 1, "Breathe" },
|
||||
{ 2, "Rainbow" },
|
||||
{ 2, "Color Cycle" },
|
||||
{ 3, "Rainbow" },
|
||||
{ 10, "Strobe" },
|
||||
};
|
||||
}
|
||||
@@ -97,6 +144,35 @@ namespace GHelper
|
||||
return msg;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static void ApplyAuraPower(bool awake = true, bool boot = false, bool sleep = false, bool shutdown = false)
|
||||
{
|
||||
HidDevice[] HidDeviceList = HidDevices.Enumerate(0x0b05, 0x19b6).ToArray();
|
||||
|
||||
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);
|
||||
|
||||
byte[] msg = AuraDev19b6Extensions.ToBytes(flags.ToArray());
|
||||
|
||||
Debug.WriteLine(BitConverter.ToString(msg));
|
||||
|
||||
foreach (HidDevice device in HidDeviceList)
|
||||
if (device.IsConnected && device.Description.Contains("HID"))
|
||||
{
|
||||
device.OpenDevice();
|
||||
device.Write(msg);
|
||||
device.CloseDevice();
|
||||
}
|
||||
|
||||
Program.wmi.TUFKeyboardPower(awake, boot, sleep, shutdown);
|
||||
|
||||
}
|
||||
|
||||
public static void ApplyAura()
|
||||
{
|
||||
|
||||
@@ -121,20 +197,18 @@ namespace GHelper
|
||||
}
|
||||
|
||||
|
||||
Program.wmi.TUFKeyboardRGB(Mode, Color1, _speed);
|
||||
|
||||
byte[] msg = AuraMessage(Mode, Color1, Color2, _speed);
|
||||
foreach (HidDevice device in HidDeviceList)
|
||||
{
|
||||
if (device.IsConnected && device.Description.Contains("HID"))
|
||||
{
|
||||
device.OpenDevice();
|
||||
byte[] msg = AuraMessage(Mode, Color1, Color2, _speed);
|
||||
device.Write(msg);
|
||||
device.Write(MESSAGE_SET);
|
||||
device.Write(MESSAGE_APPLY);
|
||||
device.CloseDevice();
|
||||
}
|
||||
}
|
||||
|
||||
Program.wmi.TUFKeyboardRGB(Mode, Color1, _speed);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
143
app/Keyboard.Designer.cs
generated
143
app/Keyboard.Designer.cs
generated
@@ -31,16 +31,24 @@ namespace GHelper
|
||||
private void InitializeComponent()
|
||||
{
|
||||
groupBox1 = new GroupBox();
|
||||
textFNF4 = new TextBox();
|
||||
comboFNF4 = new RComboBox();
|
||||
labelFNF4 = new Label();
|
||||
textM4 = new TextBox();
|
||||
textM3 = new TextBox();
|
||||
comboM4 = new RComboBox();
|
||||
labelM4 = new Label();
|
||||
comboM3 = new RComboBox();
|
||||
labelM3 = new Label();
|
||||
textFNF4 = new TextBox();
|
||||
comboFNF4 = new RComboBox();
|
||||
labelFNF4 = new Label();
|
||||
groupLight = new GroupBox();
|
||||
checkAwake = new CheckBox();
|
||||
checkBoot = new CheckBox();
|
||||
checkSleep = new CheckBox();
|
||||
checkShutdown = new CheckBox();
|
||||
comboKeyboardSpeed = new RComboBox();
|
||||
labelSpeed = new Label();
|
||||
groupBox1.SuspendLayout();
|
||||
groupLight.SuspendLayout();
|
||||
SuspendLayout();
|
||||
//
|
||||
// groupBox1
|
||||
@@ -62,6 +70,31 @@ namespace GHelper
|
||||
groupBox1.TabStop = false;
|
||||
groupBox1.Text = "Key Bindings";
|
||||
//
|
||||
// textFNF4
|
||||
//
|
||||
textFNF4.Location = new Point(411, 176);
|
||||
textFNF4.Name = "textFNF4";
|
||||
textFNF4.PlaceholderText = "action";
|
||||
textFNF4.Size = new Size(320, 39);
|
||||
textFNF4.TabIndex = 8;
|
||||
//
|
||||
// comboFNF4
|
||||
//
|
||||
comboFNF4.FormattingEnabled = true;
|
||||
comboFNF4.Location = new Point(93, 175);
|
||||
comboFNF4.Name = "comboFNF4";
|
||||
comboFNF4.Size = new Size(312, 40);
|
||||
comboFNF4.TabIndex = 7;
|
||||
//
|
||||
// labelFNF4
|
||||
//
|
||||
labelFNF4.AutoSize = true;
|
||||
labelFNF4.Location = new Point(2, 178);
|
||||
labelFNF4.Name = "labelFNF4";
|
||||
labelFNF4.Size = new Size(90, 32);
|
||||
labelFNF4.TabIndex = 6;
|
||||
labelFNF4.Text = "FN+F4:";
|
||||
//
|
||||
// textM4
|
||||
//
|
||||
textM4.Location = new Point(411, 113);
|
||||
@@ -114,36 +147,93 @@ namespace GHelper
|
||||
labelM3.TabIndex = 0;
|
||||
labelM3.Text = "M3:";
|
||||
//
|
||||
// textFNF4
|
||||
// groupLight
|
||||
//
|
||||
textFNF4.Location = new Point(411, 176);
|
||||
textFNF4.Name = "textFNF4";
|
||||
textFNF4.PlaceholderText = "action";
|
||||
textFNF4.Size = new Size(320, 39);
|
||||
textFNF4.TabIndex = 8;
|
||||
groupLight.Controls.Add(labelSpeed);
|
||||
groupLight.Controls.Add(comboKeyboardSpeed);
|
||||
groupLight.Controls.Add(checkShutdown);
|
||||
groupLight.Controls.Add(checkSleep);
|
||||
groupLight.Controls.Add(checkBoot);
|
||||
groupLight.Controls.Add(checkAwake);
|
||||
groupLight.Dock = DockStyle.Top;
|
||||
groupLight.Location = new Point(10, 252);
|
||||
groupLight.Name = "groupLight";
|
||||
groupLight.Size = new Size(751, 304);
|
||||
groupLight.TabIndex = 1;
|
||||
groupLight.TabStop = false;
|
||||
groupLight.Text = "Keyboard Backlight";
|
||||
//
|
||||
// comboFNF4
|
||||
// checkAwake
|
||||
//
|
||||
comboFNF4.FormattingEnabled = true;
|
||||
comboFNF4.Location = new Point(93, 175);
|
||||
comboFNF4.Name = "comboFNF4";
|
||||
comboFNF4.Size = new Size(312, 40);
|
||||
comboFNF4.TabIndex = 7;
|
||||
checkAwake.AutoSize = true;
|
||||
checkAwake.Location = new Point(25, 59);
|
||||
checkAwake.Name = "checkAwake";
|
||||
checkAwake.Size = new Size(115, 36);
|
||||
checkAwake.TabIndex = 0;
|
||||
checkAwake.Text = "Awake";
|
||||
checkAwake.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// labelFNF4
|
||||
// checkBoot
|
||||
//
|
||||
labelFNF4.AutoSize = true;
|
||||
labelFNF4.Location = new Point(2, 178);
|
||||
labelFNF4.Name = "labelFNF4";
|
||||
labelFNF4.Size = new Size(90, 32);
|
||||
labelFNF4.TabIndex = 6;
|
||||
labelFNF4.Text = "FN+F4:";
|
||||
checkBoot.AutoSize = true;
|
||||
checkBoot.Location = new Point(25, 101);
|
||||
checkBoot.Name = "checkBoot";
|
||||
checkBoot.Size = new Size(96, 36);
|
||||
checkBoot.TabIndex = 1;
|
||||
checkBoot.Text = "Boot";
|
||||
checkBoot.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// checkSleep
|
||||
//
|
||||
checkSleep.AutoSize = true;
|
||||
checkSleep.Location = new Point(25, 143);
|
||||
checkSleep.Name = "checkSleep";
|
||||
checkSleep.Size = new Size(105, 36);
|
||||
checkSleep.TabIndex = 2;
|
||||
checkSleep.Text = "Sleep";
|
||||
checkSleep.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// checkShutdown
|
||||
//
|
||||
checkShutdown.AutoSize = true;
|
||||
checkShutdown.Location = new Point(25, 185);
|
||||
checkShutdown.Name = "checkShutdown";
|
||||
checkShutdown.Size = new Size(154, 36);
|
||||
checkShutdown.TabIndex = 3;
|
||||
checkShutdown.Text = "Shutdown";
|
||||
checkShutdown.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// comboKeyboardSpeed
|
||||
//
|
||||
comboKeyboardSpeed.BorderColor = Color.White;
|
||||
comboKeyboardSpeed.ButtonColor = SystemColors.ControlLight;
|
||||
comboKeyboardSpeed.FlatStyle = FlatStyle.Flat;
|
||||
comboKeyboardSpeed.Font = new Font("Segoe UI", 9F, FontStyle.Regular, GraphicsUnit.Point);
|
||||
comboKeyboardSpeed.FormattingEnabled = true;
|
||||
comboKeyboardSpeed.ItemHeight = 32;
|
||||
comboKeyboardSpeed.Items.AddRange(new object[] { "Slow", "Normal", "Fast" });
|
||||
comboKeyboardSpeed.Location = new Point(230, 234);
|
||||
comboKeyboardSpeed.Margin = new Padding(4, 10, 4, 8);
|
||||
comboKeyboardSpeed.Name = "comboKeyboardSpeed";
|
||||
comboKeyboardSpeed.Size = new Size(291, 40);
|
||||
comboKeyboardSpeed.TabIndex = 39;
|
||||
comboKeyboardSpeed.TabStop = false;
|
||||
//
|
||||
// labelSpeed
|
||||
//
|
||||
labelSpeed.AutoSize = true;
|
||||
labelSpeed.Location = new Point(25, 237);
|
||||
labelSpeed.Name = "labelSpeed";
|
||||
labelSpeed.Size = new Size(198, 32);
|
||||
labelSpeed.TabIndex = 40;
|
||||
labelSpeed.Text = "Animation Speed";
|
||||
//
|
||||
// Keyboard
|
||||
//
|
||||
AutoScaleDimensions = new SizeF(13F, 32F);
|
||||
AutoScaleMode = AutoScaleMode.Font;
|
||||
ClientSize = new Size(771, 858);
|
||||
Controls.Add(groupLight);
|
||||
Controls.Add(groupBox1);
|
||||
FormBorderStyle = FormBorderStyle.FixedSingle;
|
||||
MaximizeBox = false;
|
||||
@@ -156,6 +246,8 @@ namespace GHelper
|
||||
Text = "Keyboard";
|
||||
groupBox1.ResumeLayout(false);
|
||||
groupBox1.PerformLayout();
|
||||
groupLight.ResumeLayout(false);
|
||||
groupLight.PerformLayout();
|
||||
ResumeLayout(false);
|
||||
}
|
||||
|
||||
@@ -171,5 +263,12 @@ namespace GHelper
|
||||
private TextBox textFNF4;
|
||||
private RComboBox comboFNF4;
|
||||
private Label labelFNF4;
|
||||
private GroupBox groupLight;
|
||||
private CheckBox checkSleep;
|
||||
private CheckBox checkBoot;
|
||||
private CheckBox checkAwake;
|
||||
private CheckBox checkShutdown;
|
||||
private Label labelSpeed;
|
||||
private RComboBox comboKeyboardSpeed;
|
||||
}
|
||||
}
|
||||
@@ -60,6 +60,41 @@ namespace GHelper
|
||||
SetKeyCombo(comboFNF4, textFNF4, "fnf4");
|
||||
|
||||
Shown += Keyboard_Shown;
|
||||
|
||||
comboKeyboardSpeed.DropDownStyle = ComboBoxStyle.DropDownList;
|
||||
comboKeyboardSpeed.DataSource = new BindingSource(Aura.GetSpeeds(), null);
|
||||
comboKeyboardSpeed.DisplayMember = "Value";
|
||||
comboKeyboardSpeed.ValueMember = "Key";
|
||||
comboKeyboardSpeed.SelectedValue = Aura.Speed;
|
||||
comboKeyboardSpeed.SelectedValueChanged += ComboKeyboardSpeed_SelectedValueChanged;
|
||||
|
||||
checkAwake.Checked = !(Program.config.getConfig("keyboard_awake") == 0);
|
||||
checkBoot.Checked = !(Program.config.getConfig("keyboard_boot") == 0);
|
||||
checkSleep.Checked = !(Program.config.getConfig("keyboard_sleep") == 0);
|
||||
checkShutdown.Checked = !(Program.config.getConfig("keyboard_shutdown") == 0);
|
||||
|
||||
checkAwake.CheckedChanged += CheckPower_CheckedChanged;
|
||||
checkBoot.CheckedChanged += CheckPower_CheckedChanged;
|
||||
checkSleep.CheckedChanged += CheckPower_CheckedChanged;
|
||||
checkShutdown.CheckedChanged += CheckPower_CheckedChanged;
|
||||
|
||||
}
|
||||
|
||||
|
||||
private void CheckPower_CheckedChanged(object? sender, EventArgs e)
|
||||
{
|
||||
Program.config.setConfig("keyboard_awake", (checkAwake.Checked ? 1 : 0));
|
||||
Program.config.setConfig("keyboard_boot", (checkBoot.Checked ? 1 : 0));
|
||||
Program.config.setConfig("keyboard_sleep", (checkSleep.Checked ? 1 : 0));
|
||||
Program.config.setConfig("keyboard_shutdown", (checkShutdown.Checked ? 1 : 0));
|
||||
|
||||
Aura.ApplyAuraPower(checkAwake.Checked, checkBoot.Checked, checkSleep.Checked, checkShutdown.Checked);
|
||||
}
|
||||
|
||||
private void ComboKeyboardSpeed_SelectedValueChanged(object? sender, EventArgs e)
|
||||
{
|
||||
Program.config.setConfig("aura_speed", (int)comboKeyboardSpeed.SelectedValue);
|
||||
Program.settingsForm.SetAura();
|
||||
}
|
||||
|
||||
|
||||
|
||||
96
app/Settings.Designer.cs
generated
96
app/Settings.Designer.cs
generated
@@ -35,8 +35,8 @@ namespace GHelper
|
||||
checkMatrix = new CheckBox();
|
||||
tableLayoutMatrix = new TableLayoutPanel();
|
||||
comboMatrix = new RComboBox();
|
||||
buttonMatrix = new RButton();
|
||||
comboMatrixRunning = new RComboBox();
|
||||
buttonMatrix = new RButton();
|
||||
pictureMatrix = new PictureBox();
|
||||
labelMatrix = new Label();
|
||||
panelBattery = new Panel();
|
||||
@@ -80,7 +80,6 @@ namespace GHelper
|
||||
panelKeyboard = new Panel();
|
||||
tableLayoutKeyboard = new TableLayoutPanel();
|
||||
comboKeyboard = new RComboBox();
|
||||
comboKeyboardSpeed = new RComboBox();
|
||||
panelColor = new Panel();
|
||||
pictureColor2 = new PictureBox();
|
||||
pictureColor = new PictureBox();
|
||||
@@ -145,20 +144,20 @@ namespace GHelper
|
||||
tableLayoutMatrix.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
|
||||
tableLayoutMatrix.AutoSize = true;
|
||||
tableLayoutMatrix.AutoSizeMode = AutoSizeMode.GrowAndShrink;
|
||||
tableLayoutMatrix.ColumnCount = 4;
|
||||
tableLayoutMatrix.ColumnCount = 3;
|
||||
tableLayoutMatrix.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 25F));
|
||||
tableLayoutMatrix.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 25F));
|
||||
tableLayoutMatrix.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 25F));
|
||||
tableLayoutMatrix.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 25F));
|
||||
tableLayoutMatrix.Controls.Add(comboMatrix, 0, 0);
|
||||
tableLayoutMatrix.Controls.Add(buttonMatrix, 2, 0);
|
||||
tableLayoutMatrix.Controls.Add(comboMatrixRunning, 1, 0);
|
||||
tableLayoutMatrix.Controls.Add(buttonMatrix, 2, 0);
|
||||
tableLayoutMatrix.Location = new Point(16, 52);
|
||||
tableLayoutMatrix.Margin = new Padding(8);
|
||||
tableLayoutMatrix.Name = "tableLayoutMatrix";
|
||||
tableLayoutMatrix.RowCount = 1;
|
||||
tableLayoutMatrix.RowStyles.Add(new RowStyle(SizeType.Percent, 100F));
|
||||
tableLayoutMatrix.Size = new Size(772, 60);
|
||||
tableLayoutMatrix.Size = new Size(771, 60);
|
||||
tableLayoutMatrix.TabIndex = 43;
|
||||
//
|
||||
// comboMatrix
|
||||
@@ -173,28 +172,10 @@ namespace GHelper
|
||||
comboMatrix.Location = new Point(4, 10);
|
||||
comboMatrix.Margin = new Padding(4, 10, 4, 8);
|
||||
comboMatrix.Name = "comboMatrix";
|
||||
comboMatrix.Size = new Size(185, 40);
|
||||
comboMatrix.Size = new Size(249, 40);
|
||||
comboMatrix.TabIndex = 41;
|
||||
comboMatrix.TabStop = false;
|
||||
//
|
||||
// buttonMatrix
|
||||
//
|
||||
buttonMatrix.Activated = false;
|
||||
buttonMatrix.BackColor = Color.FromArgb(230, 230, 230);
|
||||
buttonMatrix.BorderColor = Color.Transparent;
|
||||
buttonMatrix.BorderRadius = 2;
|
||||
buttonMatrix.Dock = DockStyle.Top;
|
||||
buttonMatrix.FlatAppearance.BorderSize = 0;
|
||||
buttonMatrix.FlatStyle = FlatStyle.Flat;
|
||||
buttonMatrix.Location = new Point(390, 8);
|
||||
buttonMatrix.Margin = new Padding(4, 8, 4, 8);
|
||||
buttonMatrix.Name = "buttonMatrix";
|
||||
buttonMatrix.Secondary = true;
|
||||
buttonMatrix.Size = new Size(185, 44);
|
||||
buttonMatrix.TabIndex = 43;
|
||||
buttonMatrix.Text = "Picture / Gif";
|
||||
buttonMatrix.UseVisualStyleBackColor = false;
|
||||
//
|
||||
// comboMatrixRunning
|
||||
//
|
||||
comboMatrixRunning.BorderColor = Color.White;
|
||||
@@ -204,13 +185,31 @@ namespace GHelper
|
||||
comboMatrixRunning.FormattingEnabled = true;
|
||||
comboMatrixRunning.ItemHeight = 32;
|
||||
comboMatrixRunning.Items.AddRange(new object[] { "Binary Banner", "Rog Logo", "Picture", "Clock" });
|
||||
comboMatrixRunning.Location = new Point(197, 10);
|
||||
comboMatrixRunning.Location = new Point(261, 10);
|
||||
comboMatrixRunning.Margin = new Padding(4, 10, 4, 8);
|
||||
comboMatrixRunning.Name = "comboMatrixRunning";
|
||||
comboMatrixRunning.Size = new Size(185, 40);
|
||||
comboMatrixRunning.Size = new Size(249, 40);
|
||||
comboMatrixRunning.TabIndex = 42;
|
||||
comboMatrixRunning.TabStop = false;
|
||||
//
|
||||
// buttonMatrix
|
||||
//
|
||||
buttonMatrix.Activated = false;
|
||||
buttonMatrix.BackColor = Color.FromArgb(230, 230, 230);
|
||||
buttonMatrix.BorderColor = Color.Transparent;
|
||||
buttonMatrix.BorderRadius = 2;
|
||||
buttonMatrix.Dock = DockStyle.Top;
|
||||
buttonMatrix.FlatAppearance.BorderSize = 0;
|
||||
buttonMatrix.FlatStyle = FlatStyle.Flat;
|
||||
buttonMatrix.Location = new Point(518, 8);
|
||||
buttonMatrix.Margin = new Padding(4, 8, 4, 8);
|
||||
buttonMatrix.Name = "buttonMatrix";
|
||||
buttonMatrix.Secondary = true;
|
||||
buttonMatrix.Size = new Size(249, 44);
|
||||
buttonMatrix.TabIndex = 43;
|
||||
buttonMatrix.Text = "Picture / Gif";
|
||||
buttonMatrix.UseVisualStyleBackColor = false;
|
||||
//
|
||||
// pictureMatrix
|
||||
//
|
||||
pictureMatrix.BackgroundImage = Properties.Resources.icons8_matrix_desktop_48;
|
||||
@@ -864,21 +863,20 @@ namespace GHelper
|
||||
tableLayoutKeyboard.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
|
||||
tableLayoutKeyboard.AutoSize = true;
|
||||
tableLayoutKeyboard.AutoSizeMode = AutoSizeMode.GrowAndShrink;
|
||||
tableLayoutKeyboard.ColumnCount = 4;
|
||||
tableLayoutKeyboard.ColumnCount = 3;
|
||||
tableLayoutKeyboard.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 25F));
|
||||
tableLayoutKeyboard.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 25F));
|
||||
tableLayoutKeyboard.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 25F));
|
||||
tableLayoutKeyboard.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 25F));
|
||||
tableLayoutKeyboard.Controls.Add(comboKeyboard, 0, 0);
|
||||
tableLayoutKeyboard.Controls.Add(comboKeyboardSpeed, 1, 0);
|
||||
tableLayoutKeyboard.Controls.Add(panelColor, 2, 0);
|
||||
tableLayoutKeyboard.Controls.Add(buttonKeyboard, 3, 0);
|
||||
tableLayoutKeyboard.Controls.Add(panelColor, 1, 0);
|
||||
tableLayoutKeyboard.Controls.Add(buttonKeyboard, 2, 0);
|
||||
tableLayoutKeyboard.Location = new Point(16, 50);
|
||||
tableLayoutKeyboard.Margin = new Padding(8);
|
||||
tableLayoutKeyboard.Name = "tableLayoutKeyboard";
|
||||
tableLayoutKeyboard.RowCount = 1;
|
||||
tableLayoutKeyboard.RowStyles.Add(new RowStyle(SizeType.Percent, 100F));
|
||||
tableLayoutKeyboard.Size = new Size(772, 60);
|
||||
tableLayoutKeyboard.Size = new Size(771, 60);
|
||||
tableLayoutKeyboard.TabIndex = 39;
|
||||
//
|
||||
// comboKeyboard
|
||||
@@ -894,27 +892,10 @@ namespace GHelper
|
||||
comboKeyboard.Location = new Point(4, 10);
|
||||
comboKeyboard.Margin = new Padding(4, 10, 4, 8);
|
||||
comboKeyboard.Name = "comboKeyboard";
|
||||
comboKeyboard.Size = new Size(185, 40);
|
||||
comboKeyboard.Size = new Size(249, 40);
|
||||
comboKeyboard.TabIndex = 35;
|
||||
comboKeyboard.TabStop = false;
|
||||
//
|
||||
// comboKeyboardSpeed
|
||||
//
|
||||
comboKeyboardSpeed.BorderColor = Color.White;
|
||||
comboKeyboardSpeed.ButtonColor = SystemColors.ControlLight;
|
||||
comboKeyboardSpeed.Dock = DockStyle.Top;
|
||||
comboKeyboardSpeed.FlatStyle = FlatStyle.Flat;
|
||||
comboKeyboardSpeed.Font = new Font("Segoe UI", 9F, FontStyle.Regular, GraphicsUnit.Point);
|
||||
comboKeyboardSpeed.FormattingEnabled = true;
|
||||
comboKeyboardSpeed.ItemHeight = 32;
|
||||
comboKeyboardSpeed.Items.AddRange(new object[] { "Slow", "Normal", "Fast" });
|
||||
comboKeyboardSpeed.Location = new Point(197, 10);
|
||||
comboKeyboardSpeed.Margin = new Padding(4, 10, 4, 8);
|
||||
comboKeyboardSpeed.Name = "comboKeyboardSpeed";
|
||||
comboKeyboardSpeed.Size = new Size(185, 40);
|
||||
comboKeyboardSpeed.TabIndex = 38;
|
||||
comboKeyboardSpeed.TabStop = false;
|
||||
//
|
||||
// panelColor
|
||||
//
|
||||
panelColor.AutoSize = true;
|
||||
@@ -922,16 +903,16 @@ namespace GHelper
|
||||
panelColor.Controls.Add(pictureColor);
|
||||
panelColor.Controls.Add(buttonKeyboardColor);
|
||||
panelColor.Dock = DockStyle.Fill;
|
||||
panelColor.Location = new Point(390, 8);
|
||||
panelColor.Location = new Point(261, 8);
|
||||
panelColor.Margin = new Padding(4, 8, 4, 8);
|
||||
panelColor.Name = "panelColor";
|
||||
panelColor.Size = new Size(185, 44);
|
||||
panelColor.Size = new Size(249, 44);
|
||||
panelColor.TabIndex = 36;
|
||||
//
|
||||
// pictureColor2
|
||||
//
|
||||
pictureColor2.Anchor = AnchorStyles.Top | AnchorStyles.Right;
|
||||
pictureColor2.Location = new Point(126, 12);
|
||||
pictureColor2.Location = new Point(188, 12);
|
||||
pictureColor2.Margin = new Padding(8);
|
||||
pictureColor2.Name = "pictureColor2";
|
||||
pictureColor2.Size = new Size(20, 20);
|
||||
@@ -941,7 +922,7 @@ namespace GHelper
|
||||
// pictureColor
|
||||
//
|
||||
pictureColor.Anchor = AnchorStyles.Top | AnchorStyles.Right;
|
||||
pictureColor.Location = new Point(151, 12);
|
||||
pictureColor.Location = new Point(215, 12);
|
||||
pictureColor.Margin = new Padding(8);
|
||||
pictureColor.Name = "pictureColor";
|
||||
pictureColor.Size = new Size(20, 20);
|
||||
@@ -961,9 +942,9 @@ namespace GHelper
|
||||
buttonKeyboardColor.Margin = new Padding(4, 8, 4, 8);
|
||||
buttonKeyboardColor.Name = "buttonKeyboardColor";
|
||||
buttonKeyboardColor.Secondary = false;
|
||||
buttonKeyboardColor.Size = new Size(185, 44);
|
||||
buttonKeyboardColor.Size = new Size(249, 44);
|
||||
buttonKeyboardColor.TabIndex = 39;
|
||||
buttonKeyboardColor.Text = " Color .";
|
||||
buttonKeyboardColor.Text = "Color";
|
||||
buttonKeyboardColor.UseVisualStyleBackColor = false;
|
||||
//
|
||||
// buttonKeyboard
|
||||
@@ -975,11 +956,11 @@ namespace GHelper
|
||||
buttonKeyboard.Dock = DockStyle.Top;
|
||||
buttonKeyboard.FlatAppearance.BorderSize = 0;
|
||||
buttonKeyboard.FlatStyle = FlatStyle.Flat;
|
||||
buttonKeyboard.Location = new Point(583, 8);
|
||||
buttonKeyboard.Location = new Point(518, 8);
|
||||
buttonKeyboard.Margin = new Padding(4, 8, 4, 8);
|
||||
buttonKeyboard.Name = "buttonKeyboard";
|
||||
buttonKeyboard.Secondary = true;
|
||||
buttonKeyboard.Size = new Size(185, 44);
|
||||
buttonKeyboard.Size = new Size(249, 44);
|
||||
buttonKeyboard.TabIndex = 37;
|
||||
buttonKeyboard.Text = "Extra";
|
||||
buttonKeyboard.UseVisualStyleBackColor = false;
|
||||
@@ -1122,6 +1103,5 @@ namespace GHelper
|
||||
private RButton buttonKeyboardColor;
|
||||
private RButton buttonFans;
|
||||
private Label labelMidFan;
|
||||
private RComboBox comboKeyboardSpeed;
|
||||
}
|
||||
}
|
||||
@@ -589,14 +589,6 @@ namespace GHelper
|
||||
comboKeyboard.SelectedValue = Aura.Mode;
|
||||
comboKeyboard.SelectedValueChanged += ComboKeyboard_SelectedValueChanged;
|
||||
|
||||
comboKeyboardSpeed.DropDownStyle = ComboBoxStyle.DropDownList;
|
||||
comboKeyboardSpeed.DataSource = new BindingSource(Aura.GetSpeeds(), null);
|
||||
comboKeyboardSpeed.DisplayMember = "Value";
|
||||
comboKeyboardSpeed.ValueMember = "Key";
|
||||
comboKeyboardSpeed.SelectedValue = Aura.Speed;
|
||||
comboKeyboardSpeed.SelectedValueChanged += ComboKeyboardSpeed_SelectedValueChanged;
|
||||
|
||||
|
||||
pictureColor.BackColor = Aura.Color1;
|
||||
pictureColor2.BackColor = Aura.Color2;
|
||||
pictureColor2.Visible = Aura.HasSecondColor();
|
||||
@@ -646,7 +638,7 @@ namespace GHelper
|
||||
|
||||
public void CycleAuraMode()
|
||||
{
|
||||
if (comboKeyboard.SelectedIndex < comboKeyboard.Items.Count-1)
|
||||
if (comboKeyboard.SelectedIndex < comboKeyboard.Items.Count - 1)
|
||||
comboKeyboard.SelectedIndex += 1;
|
||||
else
|
||||
comboKeyboard.SelectedIndex = 0;
|
||||
@@ -658,12 +650,6 @@ namespace GHelper
|
||||
SetAura();
|
||||
}
|
||||
|
||||
private void ComboKeyboardSpeed_SelectedValueChanged(object? sender, EventArgs e)
|
||||
{
|
||||
Program.config.setConfig("aura_speed", (int)comboKeyboardSpeed.SelectedValue);
|
||||
SetAura();
|
||||
}
|
||||
|
||||
|
||||
private void Button120Hz_Click(object? sender, EventArgs e)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user