diff --git a/Inno Setup LogiLockLED/Setup LogiLockLED.iss b/Inno Setup LogiLockLED/Setup LogiLockLED.iss index 9094691..c6be52b 100644 --- a/Inno Setup LogiLockLED/Setup LogiLockLED.iss +++ b/Inno Setup LogiLockLED/Setup LogiLockLED.iss @@ -7,7 +7,7 @@ ; (To generate a new GUID, click Tools | Generate GUID inside the IDE.) AppId={{37738065-07D8-4618-9F70-62F502D902BB} AppName=LogiLockLED -AppVersion=1.4 +AppVersion=1.5 ;AppVerName=LogiLockLED 1.0 AppPublisherURL=https://github.com/infra223/LogiLockLED AppSupportURL=https://github.com/infra223/LogiLockLED diff --git a/LogiLockLED/App.config b/LogiLockLED/App.config index fcc04f4..d9f9f90 100644 --- a/LogiLockLED/App.config +++ b/LogiLockLED/App.config @@ -109,6 +109,18 @@ OpenRGB + + Red + + + White + + + False + + + Mute + diff --git a/LogiLockLED/ConfigurationForm.Designer.cs b/LogiLockLED/ConfigurationForm.Designer.cs index baea7dc..ff2f9c2 100644 --- a/LogiLockLED/ConfigurationForm.Designer.cs +++ b/LogiLockLED/ConfigurationForm.Designer.cs @@ -79,6 +79,14 @@ private void InitializeComponent() this.cbTrayShowScroll = new System.Windows.Forms.CheckBox(); this.tabControl1 = new System.Windows.Forms.TabControl(); this.tabPage1 = new System.Windows.Forms.TabPage(); + this.groupBox10 = new System.Windows.Forms.GroupBox(); + this.cbEnableMute = new System.Windows.Forms.CheckBox(); + this.btnMuteOffColour = new System.Windows.Forms.Button(); + this.label16 = new System.Windows.Forms.Label(); + this.btnMuteOnColour = new System.Windows.Forms.Button(); + this.label17 = new System.Windows.Forms.Label(); + this.groupBox9 = new System.Windows.Forms.GroupBox(); + this.cbLedController = new System.Windows.Forms.ComboBox(); this.tabPage2 = new System.Windows.Forms.TabPage(); this.groupBox8 = new System.Windows.Forms.GroupBox(); this.cbOSDShowNum = new System.Windows.Forms.CheckBox(); @@ -101,8 +109,8 @@ private void InitializeComponent() this.btnTrayOnColor = new System.Windows.Forms.Button(); this.label15 = new System.Windows.Forms.Label(); this.toolTip = new System.Windows.Forms.ToolTip(this.components); - this.groupBox9 = new System.Windows.Forms.GroupBox(); - this.cbLedController = new System.Windows.Forms.ComboBox(); + this.cbMuteIndicatorKey = new System.Windows.Forms.ComboBox(); + this.label19 = new System.Windows.Forms.Label(); this.groupBox1.SuspendLayout(); this.groupBox2.SuspendLayout(); this.groupBox3.SuspendLayout(); @@ -113,13 +121,14 @@ private void InitializeComponent() ((System.ComponentModel.ISupportInitialize)(this.cbOsdPadding)).BeginInit(); this.tabControl1.SuspendLayout(); this.tabPage1.SuspendLayout(); + this.groupBox10.SuspendLayout(); + this.groupBox9.SuspendLayout(); this.tabPage2.SuspendLayout(); this.groupBox8.SuspendLayout(); this.tabPage3.SuspendLayout(); this.groupBox7.SuspendLayout(); this.groupBox6.SuspendLayout(); this.groupBox5.SuspendLayout(); - this.groupBox9.SuspendLayout(); this.SuspendLayout(); // // groupBox1 @@ -129,11 +138,11 @@ private void InitializeComponent() this.groupBox1.Controls.Add(this.label2); this.groupBox1.Controls.Add(this.btnCapsOnColour); this.groupBox1.Controls.Add(this.label1); - this.groupBox1.Location = new System.Drawing.Point(19, 208); - this.groupBox1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.groupBox1.Location = new System.Drawing.Point(21, 176); + this.groupBox1.Margin = new System.Windows.Forms.Padding(4); this.groupBox1.Name = "groupBox1"; - this.groupBox1.Padding = new System.Windows.Forms.Padding(4, 4, 4, 4); - this.groupBox1.Size = new System.Drawing.Size(361, 100); + this.groupBox1.Padding = new System.Windows.Forms.Padding(4); + this.groupBox1.Size = new System.Drawing.Size(361, 88); this.groupBox1.TabIndex = 2; this.groupBox1.TabStop = false; this.groupBox1.Text = "Caps Lock"; @@ -142,7 +151,7 @@ private void InitializeComponent() // this.cbEnableCaps.AutoSize = true; this.cbEnableCaps.Location = new System.Drawing.Point(12, 25); - this.cbEnableCaps.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.cbEnableCaps.Margin = new System.Windows.Forms.Padding(4); this.cbEnableCaps.Name = "cbEnableCaps"; this.cbEnableCaps.Size = new System.Drawing.Size(74, 21); this.cbEnableCaps.TabIndex = 4; @@ -151,8 +160,8 @@ private void InitializeComponent() // // btnCapsOffColour // - this.btnCapsOffColour.Location = new System.Drawing.Point(263, 53); - this.btnCapsOffColour.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.btnCapsOffColour.Location = new System.Drawing.Point(273, 53); + this.btnCapsOffColour.Margin = new System.Windows.Forms.Padding(4); this.btnCapsOffColour.Name = "btnCapsOffColour"; this.btnCapsOffColour.Size = new System.Drawing.Size(59, 28); this.btnCapsOffColour.TabIndex = 3; @@ -162,7 +171,7 @@ private void InitializeComponent() // label2 // this.label2.AutoSize = true; - this.label2.Location = new System.Drawing.Point(179, 59); + this.label2.Location = new System.Drawing.Point(189, 59); this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(76, 17); @@ -171,8 +180,8 @@ private void InitializeComponent() // // btnCapsOnColour // - this.btnCapsOnColour.Location = new System.Drawing.Point(92, 53); - this.btnCapsOnColour.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.btnCapsOnColour.Location = new System.Drawing.Point(102, 53); + this.btnCapsOnColour.Margin = new System.Windows.Forms.Padding(4); this.btnCapsOnColour.Name = "btnCapsOnColour"; this.btnCapsOnColour.Size = new System.Drawing.Size(59, 28); this.btnCapsOnColour.TabIndex = 1; @@ -182,7 +191,7 @@ private void InitializeComponent() // label1 // this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(8, 59); + this.label1.Location = new System.Drawing.Point(18, 59); this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(76, 17); @@ -192,8 +201,8 @@ private void InitializeComponent() // btnClose // this.btnClose.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.btnClose.Location = new System.Drawing.Point(293, 598); - this.btnClose.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.btnClose.Location = new System.Drawing.Point(293, 612); + this.btnClose.Margin = new System.Windows.Forms.Padding(4); this.btnClose.Name = "btnClose"; this.btnClose.Size = new System.Drawing.Size(137, 28); this.btnClose.TabIndex = 3; @@ -208,11 +217,11 @@ private void InitializeComponent() this.groupBox2.Controls.Add(this.label3); this.groupBox2.Controls.Add(this.btnNumOnColour); this.groupBox2.Controls.Add(this.label4); - this.groupBox2.Location = new System.Drawing.Point(19, 101); - this.groupBox2.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.groupBox2.Location = new System.Drawing.Point(19, 80); + this.groupBox2.Margin = new System.Windows.Forms.Padding(4); this.groupBox2.Name = "groupBox2"; - this.groupBox2.Padding = new System.Windows.Forms.Padding(4, 4, 4, 4); - this.groupBox2.Size = new System.Drawing.Size(361, 100); + this.groupBox2.Padding = new System.Windows.Forms.Padding(4); + this.groupBox2.Size = new System.Drawing.Size(361, 88); this.groupBox2.TabIndex = 5; this.groupBox2.TabStop = false; this.groupBox2.Text = "Num Lock"; @@ -221,7 +230,7 @@ private void InitializeComponent() // this.cbEnableNum.AutoSize = true; this.cbEnableNum.Location = new System.Drawing.Point(12, 25); - this.cbEnableNum.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.cbEnableNum.Margin = new System.Windows.Forms.Padding(4); this.cbEnableNum.Name = "cbEnableNum"; this.cbEnableNum.Size = new System.Drawing.Size(74, 21); this.cbEnableNum.TabIndex = 4; @@ -230,8 +239,8 @@ private void InitializeComponent() // // btnNumOffColour // - this.btnNumOffColour.Location = new System.Drawing.Point(263, 53); - this.btnNumOffColour.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.btnNumOffColour.Location = new System.Drawing.Point(275, 53); + this.btnNumOffColour.Margin = new System.Windows.Forms.Padding(4); this.btnNumOffColour.Name = "btnNumOffColour"; this.btnNumOffColour.Size = new System.Drawing.Size(59, 28); this.btnNumOffColour.TabIndex = 3; @@ -241,7 +250,7 @@ private void InitializeComponent() // label3 // this.label3.AutoSize = true; - this.label3.Location = new System.Drawing.Point(179, 59); + this.label3.Location = new System.Drawing.Point(191, 59); this.label3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(76, 17); @@ -250,8 +259,8 @@ private void InitializeComponent() // // btnNumOnColour // - this.btnNumOnColour.Location = new System.Drawing.Point(92, 53); - this.btnNumOnColour.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.btnNumOnColour.Location = new System.Drawing.Point(104, 53); + this.btnNumOnColour.Margin = new System.Windows.Forms.Padding(4); this.btnNumOnColour.Name = "btnNumOnColour"; this.btnNumOnColour.Size = new System.Drawing.Size(59, 28); this.btnNumOnColour.TabIndex = 1; @@ -261,7 +270,7 @@ private void InitializeComponent() // label4 // this.label4.AutoSize = true; - this.label4.Location = new System.Drawing.Point(8, 59); + this.label4.Location = new System.Drawing.Point(20, 59); this.label4.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label4.Name = "label4"; this.label4.Size = new System.Drawing.Size(76, 17); @@ -275,11 +284,11 @@ private void InitializeComponent() this.groupBox3.Controls.Add(this.label5); this.groupBox3.Controls.Add(this.btnScrollOnColour); this.groupBox3.Controls.Add(this.label6); - this.groupBox3.Location = new System.Drawing.Point(18, 315); - this.groupBox3.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.groupBox3.Location = new System.Drawing.Point(21, 272); + this.groupBox3.Margin = new System.Windows.Forms.Padding(4); this.groupBox3.Name = "groupBox3"; - this.groupBox3.Padding = new System.Windows.Forms.Padding(4, 4, 4, 4); - this.groupBox3.Size = new System.Drawing.Size(363, 97); + this.groupBox3.Padding = new System.Windows.Forms.Padding(4); + this.groupBox3.Size = new System.Drawing.Size(363, 88); this.groupBox3.TabIndex = 6; this.groupBox3.TabStop = false; this.groupBox3.Text = "Scroll Lock"; @@ -288,7 +297,7 @@ private void InitializeComponent() // this.cbEnableScroll.AutoSize = true; this.cbEnableScroll.Location = new System.Drawing.Point(12, 25); - this.cbEnableScroll.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.cbEnableScroll.Margin = new System.Windows.Forms.Padding(4); this.cbEnableScroll.Name = "cbEnableScroll"; this.cbEnableScroll.Size = new System.Drawing.Size(74, 21); this.cbEnableScroll.TabIndex = 4; @@ -297,8 +306,8 @@ private void InitializeComponent() // // btnScrollOffColour // - this.btnScrollOffColour.Location = new System.Drawing.Point(263, 53); - this.btnScrollOffColour.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.btnScrollOffColour.Location = new System.Drawing.Point(273, 53); + this.btnScrollOffColour.Margin = new System.Windows.Forms.Padding(4); this.btnScrollOffColour.Name = "btnScrollOffColour"; this.btnScrollOffColour.Size = new System.Drawing.Size(59, 28); this.btnScrollOffColour.TabIndex = 3; @@ -308,7 +317,7 @@ private void InitializeComponent() // label5 // this.label5.AutoSize = true; - this.label5.Location = new System.Drawing.Point(179, 59); + this.label5.Location = new System.Drawing.Point(189, 59); this.label5.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label5.Name = "label5"; this.label5.Size = new System.Drawing.Size(76, 17); @@ -317,8 +326,8 @@ private void InitializeComponent() // // btnScrollOnColour // - this.btnScrollOnColour.Location = new System.Drawing.Point(92, 53); - this.btnScrollOnColour.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.btnScrollOnColour.Location = new System.Drawing.Point(102, 53); + this.btnScrollOnColour.Margin = new System.Windows.Forms.Padding(4); this.btnScrollOnColour.Name = "btnScrollOnColour"; this.btnScrollOnColour.Size = new System.Drawing.Size(59, 28); this.btnScrollOnColour.TabIndex = 1; @@ -328,7 +337,7 @@ private void InitializeComponent() // label6 // this.label6.AutoSize = true; - this.label6.Location = new System.Drawing.Point(8, 59); + this.label6.Location = new System.Drawing.Point(18, 59); this.label6.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label6.Name = "label6"; this.label6.Size = new System.Drawing.Size(76, 17); @@ -339,11 +348,11 @@ private void InitializeComponent() // this.groupBox4.Controls.Add(this.cbEnable); this.groupBox4.Controls.Add(this.cbAutoStartApp); - this.groupBox4.Location = new System.Drawing.Point(17, 16); - this.groupBox4.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.groupBox4.Location = new System.Drawing.Point(17, 13); + this.groupBox4.Margin = new System.Windows.Forms.Padding(4); this.groupBox4.Name = "groupBox4"; - this.groupBox4.Padding = new System.Windows.Forms.Padding(4, 4, 4, 4); - this.groupBox4.Size = new System.Drawing.Size(363, 89); + this.groupBox4.Padding = new System.Windows.Forms.Padding(4); + this.groupBox4.Size = new System.Drawing.Size(363, 77); this.groupBox4.TabIndex = 7; this.groupBox4.TabStop = false; this.groupBox4.Text = "General Settings"; @@ -352,7 +361,7 @@ private void InitializeComponent() // this.cbEnable.AutoSize = true; this.cbEnable.Location = new System.Drawing.Point(11, 52); - this.cbEnable.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.cbEnable.Margin = new System.Windows.Forms.Padding(4); this.cbEnable.Name = "cbEnable"; this.cbEnable.Size = new System.Drawing.Size(174, 21); this.cbEnable.TabIndex = 1; @@ -363,7 +372,7 @@ private void InitializeComponent() // this.cbAutoStartApp.AutoSize = true; this.cbAutoStartApp.Location = new System.Drawing.Point(11, 23); - this.cbAutoStartApp.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.cbAutoStartApp.Margin = new System.Windows.Forms.Padding(4); this.cbAutoStartApp.Name = "cbAutoStartApp"; this.cbAutoStartApp.Size = new System.Drawing.Size(166, 21); this.cbAutoStartApp.TabIndex = 0; @@ -373,8 +382,8 @@ private void InitializeComponent() // btnCancel // this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.btnCancel.Location = new System.Drawing.Point(16, 598); - this.btnCancel.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.btnCancel.Location = new System.Drawing.Point(16, 612); + this.btnCancel.Margin = new System.Windows.Forms.Padding(4); this.btnCancel.Name = "btnCancel"; this.btnCancel.Size = new System.Drawing.Size(112, 28); this.btnCancel.TabIndex = 8; @@ -385,8 +394,8 @@ private void InitializeComponent() // btnApply // this.btnApply.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.btnApply.Location = new System.Drawing.Point(161, 598); - this.btnApply.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.btnApply.Location = new System.Drawing.Point(161, 612); + this.btnApply.Margin = new System.Windows.Forms.Padding(4); this.btnApply.Name = "btnApply"; this.btnApply.Size = new System.Drawing.Size(124, 28); this.btnApply.TabIndex = 9; @@ -397,7 +406,7 @@ private void InitializeComponent() // cbOsdDurtation // this.cbOsdDurtation.Location = new System.Drawing.Point(93, 315); - this.cbOsdDurtation.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.cbOsdDurtation.Margin = new System.Windows.Forms.Padding(4); this.cbOsdDurtation.Maximum = new decimal(new int[] { 10000, 0, @@ -430,7 +439,7 @@ private void InitializeComponent() // cbOsdOpacity // this.cbOsdOpacity.Location = new System.Drawing.Point(93, 283); - this.cbOsdOpacity.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.cbOsdOpacity.Margin = new System.Windows.Forms.Padding(4); this.cbOsdOpacity.Name = "cbOsdOpacity"; this.cbOsdOpacity.Size = new System.Drawing.Size(159, 22); this.cbOsdOpacity.TabIndex = 14; @@ -438,7 +447,7 @@ private void InitializeComponent() // btnOsdBkColour // this.btnOsdBkColour.Location = new System.Drawing.Point(144, 247); - this.btnOsdBkColour.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.btnOsdBkColour.Margin = new System.Windows.Forms.Padding(4); this.btnOsdBkColour.Name = "btnOsdBkColour"; this.btnOsdBkColour.Size = new System.Drawing.Size(59, 28); this.btnOsdBkColour.TabIndex = 13; @@ -458,7 +467,7 @@ private void InitializeComponent() // btnOsdTxtColour // this.btnOsdTxtColour.Location = new System.Drawing.Point(144, 212); - this.btnOsdTxtColour.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.btnOsdTxtColour.Margin = new System.Windows.Forms.Padding(4); this.btnOsdTxtColour.Name = "btnOsdTxtColour"; this.btnOsdTxtColour.Size = new System.Drawing.Size(59, 28); this.btnOsdTxtColour.TabIndex = 11; @@ -479,7 +488,7 @@ private void InitializeComponent() // this.cbOsdRoundedCorners.AutoSize = true; this.cbOsdRoundedCorners.Location = new System.Drawing.Point(23, 148); - this.cbOsdRoundedCorners.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.cbOsdRoundedCorners.Margin = new System.Windows.Forms.Padding(4); this.cbOsdRoundedCorners.Name = "cbOsdRoundedCorners"; this.cbOsdRoundedCorners.Size = new System.Drawing.Size(142, 21); this.cbOsdRoundedCorners.TabIndex = 9; @@ -499,7 +508,7 @@ private void InitializeComponent() // cbOsdMargin // this.cbOsdMargin.Location = new System.Drawing.Point(93, 112); - this.cbOsdMargin.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.cbOsdMargin.Margin = new System.Windows.Forms.Padding(4); this.cbOsdMargin.Maximum = new decimal(new int[] { -727379969, 232, @@ -527,7 +536,7 @@ private void InitializeComponent() // cbOsdPadding // this.cbOsdPadding.Location = new System.Drawing.Point(93, 80); - this.cbOsdPadding.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.cbOsdPadding.Margin = new System.Windows.Forms.Padding(4); this.cbOsdPadding.Maximum = new decimal(new int[] { -727379969, 232, @@ -545,7 +554,7 @@ private void InitializeComponent() // btnOsdFont // this.btnOsdFont.Location = new System.Drawing.Point(93, 176); - this.btnOsdFont.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.btnOsdFont.Margin = new System.Windows.Forms.Padding(4); this.btnOsdFont.Name = "btnOsdFont"; this.btnOsdFont.Size = new System.Drawing.Size(281, 28); this.btnOsdFont.TabIndex = 4; @@ -574,7 +583,7 @@ private void InitializeComponent() "Bottom Left", "Bottom Right"}); this.cbOSDPosition.Location = new System.Drawing.Point(93, 47); - this.cbOSDPosition.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.cbOSDPosition.Margin = new System.Windows.Forms.Padding(4); this.cbOSDPosition.Name = "cbOSDPosition"; this.cbOSDPosition.Size = new System.Drawing.Size(160, 24); this.cbOSDPosition.TabIndex = 2; @@ -593,7 +602,7 @@ private void InitializeComponent() // this.cbOsdEnabled.AutoSize = true; this.cbOsdEnabled.Location = new System.Drawing.Point(23, 22); - this.cbOsdEnabled.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.cbOsdEnabled.Margin = new System.Windows.Forms.Padding(4); this.cbOsdEnabled.Name = "cbOsdEnabled"; this.cbOsdEnabled.Size = new System.Drawing.Size(108, 21); this.cbOsdEnabled.TabIndex = 0; @@ -604,7 +613,7 @@ private void InitializeComponent() // this.cbTrayShowNum.AutoSize = true; this.cbTrayShowNum.Location = new System.Drawing.Point(12, 23); - this.cbTrayShowNum.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.cbTrayShowNum.Margin = new System.Windows.Forms.Padding(4); this.cbTrayShowNum.Name = "cbTrayShowNum"; this.cbTrayShowNum.Size = new System.Drawing.Size(93, 21); this.cbTrayShowNum.TabIndex = 0; @@ -615,7 +624,7 @@ private void InitializeComponent() // this.cbTrayShowCaps.AutoSize = true; this.cbTrayShowCaps.Location = new System.Drawing.Point(120, 23); - this.cbTrayShowCaps.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.cbTrayShowCaps.Margin = new System.Windows.Forms.Padding(4); this.cbTrayShowCaps.Name = "cbTrayShowCaps"; this.cbTrayShowCaps.Size = new System.Drawing.Size(96, 21); this.cbTrayShowCaps.TabIndex = 1; @@ -626,7 +635,7 @@ private void InitializeComponent() // this.cbTrayShowScroll.AutoSize = true; this.cbTrayShowScroll.Location = new System.Drawing.Point(231, 23); - this.cbTrayShowScroll.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.cbTrayShowScroll.Margin = new System.Windows.Forms.Padding(4); this.cbTrayShowScroll.Name = "cbTrayShowScroll"; this.cbTrayShowScroll.Size = new System.Drawing.Size(99, 21); this.cbTrayShowScroll.TabIndex = 2; @@ -641,29 +650,122 @@ private void InitializeComponent() this.tabControl1.Controls.Add(this.tabPage1); this.tabControl1.Controls.Add(this.tabPage2); this.tabControl1.Controls.Add(this.tabPage3); - this.tabControl1.Location = new System.Drawing.Point(16, 112); - this.tabControl1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.tabControl1.Location = new System.Drawing.Point(16, 94); + this.tabControl1.Margin = new System.Windows.Forms.Padding(4); this.tabControl1.Multiline = true; this.tabControl1.Name = "tabControl1"; this.tabControl1.SelectedIndex = 0; - this.tabControl1.Size = new System.Drawing.Size(415, 465); + this.tabControl1.Size = new System.Drawing.Size(415, 503); this.tabControl1.TabIndex = 12; // // tabPage1 // + this.tabPage1.Controls.Add(this.groupBox10); this.tabPage1.Controls.Add(this.groupBox9); this.tabPage1.Controls.Add(this.groupBox2); this.tabPage1.Controls.Add(this.groupBox1); this.tabPage1.Controls.Add(this.groupBox3); this.tabPage1.Location = new System.Drawing.Point(4, 25); - this.tabPage1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.tabPage1.Margin = new System.Windows.Forms.Padding(4); this.tabPage1.Name = "tabPage1"; - this.tabPage1.Padding = new System.Windows.Forms.Padding(4, 4, 4, 4); - this.tabPage1.Size = new System.Drawing.Size(407, 436); + this.tabPage1.Padding = new System.Windows.Forms.Padding(4); + this.tabPage1.Size = new System.Drawing.Size(407, 474); this.tabPage1.TabIndex = 0; this.tabPage1.Text = "Key Backlight"; this.tabPage1.UseVisualStyleBackColor = true; // + // groupBox10 + // + this.groupBox10.Controls.Add(this.label19); + this.groupBox10.Controls.Add(this.cbMuteIndicatorKey); + this.groupBox10.Controls.Add(this.cbEnableMute); + this.groupBox10.Controls.Add(this.btnMuteOffColour); + this.groupBox10.Controls.Add(this.label16); + this.groupBox10.Controls.Add(this.btnMuteOnColour); + this.groupBox10.Controls.Add(this.label17); + this.groupBox10.Location = new System.Drawing.Point(21, 368); + this.groupBox10.Margin = new System.Windows.Forms.Padding(4); + this.groupBox10.Name = "groupBox10"; + this.groupBox10.Padding = new System.Windows.Forms.Padding(4); + this.groupBox10.Size = new System.Drawing.Size(363, 95); + this.groupBox10.TabIndex = 8; + this.groupBox10.TabStop = false; + this.groupBox10.Text = "Mute"; + // + // cbEnableMute + // + this.cbEnableMute.AutoSize = true; + this.cbEnableMute.Location = new System.Drawing.Point(12, 25); + this.cbEnableMute.Margin = new System.Windows.Forms.Padding(4); + this.cbEnableMute.Name = "cbEnableMute"; + this.cbEnableMute.Size = new System.Drawing.Size(74, 21); + this.cbEnableMute.TabIndex = 4; + this.cbEnableMute.Text = "Enable"; + this.cbEnableMute.UseVisualStyleBackColor = true; + // + // btnMuteOffColour + // + this.btnMuteOffColour.Location = new System.Drawing.Point(273, 53); + this.btnMuteOffColour.Margin = new System.Windows.Forms.Padding(4); + this.btnMuteOffColour.Name = "btnMuteOffColour"; + this.btnMuteOffColour.Size = new System.Drawing.Size(59, 28); + this.btnMuteOffColour.TabIndex = 3; + this.btnMuteOffColour.UseVisualStyleBackColor = true; + this.btnMuteOffColour.Click += new System.EventHandler(this.btnColour_Click); + // + // label16 + // + this.label16.AutoSize = true; + this.label16.Location = new System.Drawing.Point(189, 59); + this.label16.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.label16.Name = "label16"; + this.label16.Size = new System.Drawing.Size(76, 17); + this.label16.TabIndex = 2; + this.label16.Text = "Off Colour:"; + // + // btnMuteOnColour + // + this.btnMuteOnColour.Location = new System.Drawing.Point(102, 53); + this.btnMuteOnColour.Margin = new System.Windows.Forms.Padding(4); + this.btnMuteOnColour.Name = "btnMuteOnColour"; + this.btnMuteOnColour.Size = new System.Drawing.Size(59, 28); + this.btnMuteOnColour.TabIndex = 1; + this.btnMuteOnColour.UseVisualStyleBackColor = true; + this.btnMuteOnColour.Click += new System.EventHandler(this.btnColour_Click); + // + // label17 + // + this.label17.AutoSize = true; + this.label17.Location = new System.Drawing.Point(18, 59); + this.label17.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.label17.Name = "label17"; + this.label17.Size = new System.Drawing.Size(76, 17); + this.label17.TabIndex = 0; + this.label17.Text = "On Colour:"; + // + // groupBox9 + // + this.groupBox9.Controls.Add(this.cbLedController); + this.groupBox9.Location = new System.Drawing.Point(19, 7); + this.groupBox9.Name = "groupBox9"; + this.groupBox9.Size = new System.Drawing.Size(361, 66); + this.groupBox9.TabIndex = 7; + this.groupBox9.TabStop = false; + this.groupBox9.Text = "LED Controller"; + // + // cbLedController + // + this.cbLedController.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.cbLedController.FormattingEnabled = true; + this.cbLedController.Items.AddRange(new object[] { + "OpenRGB", + "Logitech G HUB", + "Disable"}); + this.cbLedController.Location = new System.Drawing.Point(12, 30); + this.cbLedController.Name = "cbLedController"; + this.cbLedController.Size = new System.Drawing.Size(329, 24); + this.cbLedController.TabIndex = 0; + // // tabPage2 // this.tabPage2.Controls.Add(this.groupBox8); @@ -685,11 +787,11 @@ private void InitializeComponent() this.tabPage2.Controls.Add(this.cbOsdRoundedCorners); this.tabPage2.Controls.Add(this.cbOsdMargin); this.tabPage2.Controls.Add(this.label10); - this.tabPage2.Location = new System.Drawing.Point(4, 46); - this.tabPage2.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.tabPage2.Location = new System.Drawing.Point(4, 25); + this.tabPage2.Margin = new System.Windows.Forms.Padding(4); this.tabPage2.Name = "tabPage2"; - this.tabPage2.Padding = new System.Windows.Forms.Padding(4, 4, 4, 4); - this.tabPage2.Size = new System.Drawing.Size(407, 415); + this.tabPage2.Padding = new System.Windows.Forms.Padding(4); + this.tabPage2.Size = new System.Drawing.Size(407, 463); this.tabPage2.TabIndex = 1; this.tabPage2.Text = "On-Screen Display"; this.tabPage2.UseVisualStyleBackColor = true; @@ -700,9 +802,9 @@ private void InitializeComponent() this.groupBox8.Controls.Add(this.cbOSDShowCaps); this.groupBox8.Controls.Add(this.cbOSDShowScroll); this.groupBox8.Location = new System.Drawing.Point(23, 359); - this.groupBox8.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.groupBox8.Margin = new System.Windows.Forms.Padding(4); this.groupBox8.Name = "groupBox8"; - this.groupBox8.Padding = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.groupBox8.Padding = new System.Windows.Forms.Padding(4); this.groupBox8.Size = new System.Drawing.Size(352, 66); this.groupBox8.TabIndex = 18; this.groupBox8.TabStop = false; @@ -712,7 +814,7 @@ private void InitializeComponent() // this.cbOSDShowNum.AutoSize = true; this.cbOSDShowNum.Location = new System.Drawing.Point(12, 23); - this.cbOSDShowNum.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.cbOSDShowNum.Margin = new System.Windows.Forms.Padding(4); this.cbOSDShowNum.Name = "cbOSDShowNum"; this.cbOSDShowNum.Size = new System.Drawing.Size(93, 21); this.cbOSDShowNum.TabIndex = 0; @@ -723,7 +825,7 @@ private void InitializeComponent() // this.cbOSDShowCaps.AutoSize = true; this.cbOSDShowCaps.Location = new System.Drawing.Point(120, 23); - this.cbOSDShowCaps.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.cbOSDShowCaps.Margin = new System.Windows.Forms.Padding(4); this.cbOSDShowCaps.Name = "cbOSDShowCaps"; this.cbOSDShowCaps.Size = new System.Drawing.Size(96, 21); this.cbOSDShowCaps.TabIndex = 1; @@ -734,7 +836,7 @@ private void InitializeComponent() // this.cbOSDShowScroll.AutoSize = true; this.cbOSDShowScroll.Location = new System.Drawing.Point(231, 23); - this.cbOSDShowScroll.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.cbOSDShowScroll.Margin = new System.Windows.Forms.Padding(4); this.cbOSDShowScroll.Name = "cbOSDShowScroll"; this.cbOSDShowScroll.Size = new System.Drawing.Size(99, 21); this.cbOSDShowScroll.TabIndex = 2; @@ -746,11 +848,11 @@ private void InitializeComponent() this.tabPage3.Controls.Add(this.groupBox7); this.tabPage3.Controls.Add(this.groupBox6); this.tabPage3.Controls.Add(this.groupBox5); - this.tabPage3.Location = new System.Drawing.Point(4, 46); - this.tabPage3.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.tabPage3.Location = new System.Drawing.Point(4, 25); + this.tabPage3.Margin = new System.Windows.Forms.Padding(4); this.tabPage3.Name = "tabPage3"; - this.tabPage3.Padding = new System.Windows.Forms.Padding(4, 4, 4, 4); - this.tabPage3.Size = new System.Drawing.Size(407, 415); + this.tabPage3.Padding = new System.Windows.Forms.Padding(4); + this.tabPage3.Size = new System.Drawing.Size(407, 463); this.tabPage3.TabIndex = 2; this.tabPage3.Text = "System Tray Indicators"; this.tabPage3.UseVisualStyleBackColor = true; @@ -761,9 +863,9 @@ private void InitializeComponent() this.groupBox7.Controls.Add(this.cbTrayShowCaps); this.groupBox7.Controls.Add(this.cbTrayShowScroll); this.groupBox7.Location = new System.Drawing.Point(25, 21); - this.groupBox7.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.groupBox7.Margin = new System.Windows.Forms.Padding(4); this.groupBox7.Name = "groupBox7"; - this.groupBox7.Padding = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.groupBox7.Padding = new System.Windows.Forms.Padding(4); this.groupBox7.Size = new System.Drawing.Size(352, 66); this.groupBox7.TabIndex = 9; this.groupBox7.TabStop = false; @@ -778,9 +880,9 @@ private void InitializeComponent() this.groupBox6.Controls.Add(this.btnTrayOffColor); this.groupBox6.Controls.Add(this.label18); this.groupBox6.Location = new System.Drawing.Point(25, 214); - this.groupBox6.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.groupBox6.Margin = new System.Windows.Forms.Padding(4); this.groupBox6.Name = "groupBox6"; - this.groupBox6.Padding = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.groupBox6.Padding = new System.Windows.Forms.Padding(4); this.groupBox6.Size = new System.Drawing.Size(352, 112); this.groupBox6.TabIndex = 8; this.groupBox6.TabStop = false; @@ -790,7 +892,7 @@ private void InitializeComponent() // this.cbTrayOffTransparent.AutoSize = true; this.cbTrayOffTransparent.Location = new System.Drawing.Point(193, 68); - this.cbTrayOffTransparent.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.cbTrayOffTransparent.Margin = new System.Windows.Forms.Padding(4); this.cbTrayOffTransparent.Name = "cbTrayOffTransparent"; this.cbTrayOffTransparent.Size = new System.Drawing.Size(108, 21); this.cbTrayOffTransparent.TabIndex = 7; @@ -802,7 +904,7 @@ private void InitializeComponent() // this.cbTrayOffBorder.AutoSize = true; this.cbTrayOffBorder.Location = new System.Drawing.Point(193, 32); - this.cbTrayOffBorder.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.cbTrayOffBorder.Margin = new System.Windows.Forms.Padding(4); this.cbTrayOffBorder.Name = "cbTrayOffBorder"; this.cbTrayOffBorder.Size = new System.Drawing.Size(109, 21); this.cbTrayOffBorder.TabIndex = 6; @@ -812,7 +914,7 @@ private void InitializeComponent() // btnTrayOffBgColor // this.btnTrayOffBgColor.Location = new System.Drawing.Point(107, 63); - this.btnTrayOffBgColor.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.btnTrayOffBgColor.Margin = new System.Windows.Forms.Padding(4); this.btnTrayOffBgColor.Name = "btnTrayOffBgColor"; this.btnTrayOffBgColor.Size = new System.Drawing.Size(59, 28); this.btnTrayOffBgColor.TabIndex = 5; @@ -832,7 +934,7 @@ private void InitializeComponent() // btnTrayOffColor // this.btnTrayOffColor.Location = new System.Drawing.Point(107, 27); - this.btnTrayOffColor.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.btnTrayOffColor.Margin = new System.Windows.Forms.Padding(4); this.btnTrayOffColor.Name = "btnTrayOffColor"; this.btnTrayOffColor.Size = new System.Drawing.Size(59, 28); this.btnTrayOffColor.TabIndex = 3; @@ -858,9 +960,9 @@ private void InitializeComponent() this.groupBox5.Controls.Add(this.btnTrayOnColor); this.groupBox5.Controls.Add(this.label15); this.groupBox5.Location = new System.Drawing.Point(25, 95); - this.groupBox5.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.groupBox5.Margin = new System.Windows.Forms.Padding(4); this.groupBox5.Name = "groupBox5"; - this.groupBox5.Padding = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.groupBox5.Padding = new System.Windows.Forms.Padding(4); this.groupBox5.Size = new System.Drawing.Size(352, 112); this.groupBox5.TabIndex = 3; this.groupBox5.TabStop = false; @@ -870,7 +972,7 @@ private void InitializeComponent() // this.cbTrayOnTransparent.AutoSize = true; this.cbTrayOnTransparent.Location = new System.Drawing.Point(193, 68); - this.cbTrayOnTransparent.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.cbTrayOnTransparent.Margin = new System.Windows.Forms.Padding(4); this.cbTrayOnTransparent.Name = "cbTrayOnTransparent"; this.cbTrayOnTransparent.Size = new System.Drawing.Size(108, 21); this.cbTrayOnTransparent.TabIndex = 7; @@ -882,7 +984,7 @@ private void InitializeComponent() // this.cbTrayOnBorder.AutoSize = true; this.cbTrayOnBorder.Location = new System.Drawing.Point(193, 32); - this.cbTrayOnBorder.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.cbTrayOnBorder.Margin = new System.Windows.Forms.Padding(4); this.cbTrayOnBorder.Name = "cbTrayOnBorder"; this.cbTrayOnBorder.Size = new System.Drawing.Size(109, 21); this.cbTrayOnBorder.TabIndex = 6; @@ -892,7 +994,7 @@ private void InitializeComponent() // btnTrayOnBgColor // this.btnTrayOnBgColor.Location = new System.Drawing.Point(107, 63); - this.btnTrayOnBgColor.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.btnTrayOnBgColor.Margin = new System.Windows.Forms.Padding(4); this.btnTrayOnBgColor.Name = "btnTrayOnBgColor"; this.btnTrayOnBgColor.Size = new System.Drawing.Size(59, 28); this.btnTrayOnBgColor.TabIndex = 5; @@ -912,7 +1014,7 @@ private void InitializeComponent() // btnTrayOnColor // this.btnTrayOnColor.Location = new System.Drawing.Point(107, 27); - this.btnTrayOnColor.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.btnTrayOnColor.Margin = new System.Windows.Forms.Padding(4); this.btnTrayOnColor.Name = "btnTrayOnColor"; this.btnTrayOnColor.Size = new System.Drawing.Size(59, 28); this.btnTrayOnColor.TabIndex = 3; @@ -929,34 +1031,35 @@ private void InitializeComponent() this.label15.TabIndex = 2; this.label15.Text = "Colour:"; // - // groupBox9 - // - this.groupBox9.Controls.Add(this.cbLedController); - this.groupBox9.Location = new System.Drawing.Point(19, 17); - this.groupBox9.Name = "groupBox9"; - this.groupBox9.Size = new System.Drawing.Size(361, 77); - this.groupBox9.TabIndex = 7; - this.groupBox9.TabStop = false; - this.groupBox9.Text = "LED Controller"; - // - // cbLedController - // - this.cbLedController.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.cbLedController.FormattingEnabled = true; - this.cbLedController.Items.AddRange(new object[] { - "OpenRGB", - "Logitech G HUB", - "Disable"}); - this.cbLedController.Location = new System.Drawing.Point(12, 30); - this.cbLedController.Name = "cbLedController"; - this.cbLedController.Size = new System.Drawing.Size(329, 24); - this.cbLedController.TabIndex = 0; + // cbMuteIndicatorKey + // + this.cbMuteIndicatorKey.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.cbMuteIndicatorKey.FormattingEnabled = true; + this.cbMuteIndicatorKey.Items.AddRange(new object[] { + "Mute (OpenRGB)", + "PRTSC", + "F12", + "NUM Astrix"}); + this.cbMuteIndicatorKey.Location = new System.Drawing.Point(172, 22); + this.cbMuteIndicatorKey.Name = "cbMuteIndicatorKey"; + this.cbMuteIndicatorKey.Size = new System.Drawing.Size(160, 24); + this.cbMuteIndicatorKey.TabIndex = 5; + // + // label19 + // + this.label19.AutoSize = true; + this.label19.Location = new System.Drawing.Point(99, 26); + this.label19.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.label19.Name = "label19"; + this.label19.Size = new System.Drawing.Size(66, 17); + this.label19.TabIndex = 6; + this.label19.Text = "Indicator:"; // // ConfigurationForm // this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(440, 634); + this.ClientSize = new System.Drawing.Size(440, 648); this.Controls.Add(this.tabControl1); this.Controls.Add(this.btnApply); this.Controls.Add(this.btnCancel); @@ -964,7 +1067,7 @@ private void InitializeComponent() this.Controls.Add(this.btnClose); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); - this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.Margin = new System.Windows.Forms.Padding(4); this.Name = "ConfigurationForm"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Text = "LogiLockLED Configuration"; @@ -982,6 +1085,9 @@ private void InitializeComponent() ((System.ComponentModel.ISupportInitialize)(this.cbOsdPadding)).EndInit(); this.tabControl1.ResumeLayout(false); this.tabPage1.ResumeLayout(false); + this.groupBox10.ResumeLayout(false); + this.groupBox10.PerformLayout(); + this.groupBox9.ResumeLayout(false); this.tabPage2.ResumeLayout(false); this.tabPage2.PerformLayout(); this.groupBox8.ResumeLayout(false); @@ -993,7 +1099,6 @@ private void InitializeComponent() this.groupBox6.PerformLayout(); this.groupBox5.ResumeLayout(false); this.groupBox5.PerformLayout(); - this.groupBox9.ResumeLayout(false); this.ResumeLayout(false); } @@ -1073,6 +1178,14 @@ private void InitializeComponent() private System.Windows.Forms.ToolTip toolTip; private System.Windows.Forms.GroupBox groupBox9; private System.Windows.Forms.ComboBox cbLedController; + private System.Windows.Forms.GroupBox groupBox10; + private System.Windows.Forms.CheckBox cbEnableMute; + private System.Windows.Forms.Button btnMuteOffColour; + private System.Windows.Forms.Label label16; + private System.Windows.Forms.Button btnMuteOnColour; + private System.Windows.Forms.Label label17; + private System.Windows.Forms.Label label19; + private System.Windows.Forms.ComboBox cbMuteIndicatorKey; } } diff --git a/LogiLockLED/ConfigurationForm.cs b/LogiLockLED/ConfigurationForm.cs index ecd8be5..3504d43 100644 --- a/LogiLockLED/ConfigurationForm.cs +++ b/LogiLockLED/ConfigurationForm.cs @@ -19,6 +19,13 @@ public ConfigurationForm(ref LedSettings settings) cbOSDPosition.DataSource = Enum.GetValues(typeof(OSDPosition)); cbOSDPosition.SelectedIndex = 0; + cbMuteIndicatorKey.Items.Clear(); + cbMuteIndicatorKey.Items.Add(LockKey.Mute); + cbMuteIndicatorKey.Items.Add(LockKey.PrtSc); + cbMuteIndicatorKey.Items.Add(LockKey.F12); + cbMuteIndicatorKey.Items.Add(LockKey.Num_Asterisk); + cbMuteIndicatorKey.SelectedIndex = 0; + PopulateSettingsToUI(); } @@ -49,6 +56,11 @@ private void PopulateSettingsToUI() btnScrollOffColour.BackColor = ledSettings.ScrollOffColor; btnScrollOnColour.BackColor = ledSettings.ScrollOnColor; + cbEnableMute.Checked = ledSettings.EnableMute; + btnMuteOffColour.BackColor = ledSettings.MuteOffColor; + btnMuteOnColour.BackColor = ledSettings.MuteOnColor; + cbMuteIndicatorKey.SelectedItem = ledSettings.MuteIndicatorKey; + cbAutoStartApp.Checked = ledSettings.AutoStartApp; cbOsdEnabled.Checked = ledSettings.OsdEnabled; @@ -90,7 +102,9 @@ private void ApplySettings() ledSettings.EnableCaps = cbEnableCaps.Checked; ledSettings.EnableNum = cbEnableNum.Checked; ledSettings.EnableScroll = cbEnableScroll.Checked; - + ledSettings.EnableMute = cbEnableMute.Checked; + + ledSettings.MuteIndicatorKey = (LockKey)cbMuteIndicatorKey.SelectedItem; ledSettings.OsdEnabled = cbOsdEnabled.Checked; ledSettings.OsdPosition = (OSDPosition)cbOSDPosition.SelectedItem; @@ -103,6 +117,8 @@ private void ApplySettings() ledSettings.CapsOnColor = btnCapsOnColour.BackColor; ledSettings.NumOffColor = btnNumOffColour.BackColor; ledSettings.NumOnColor = btnNumOnColour.BackColor; + ledSettings.MuteOffColor = btnMuteOffColour.BackColor; + ledSettings.MuteOnColor = btnMuteOnColour.BackColor; ledSettings.ScrollOffColor = btnScrollOffColour.BackColor; ledSettings.ScrollOnColor = btnScrollOnColour.BackColor; ledSettings.OsdTextColor = btnOsdTxtColour.BackColor == Color.Black ? Color.FromArgb(3, 3, 3) : btnOsdTxtColour.BackColor; diff --git a/LogiLockLED/IndicatorPopup.cs b/LogiLockLED/IndicatorPopup.cs index 13a25b4..679b76b 100644 --- a/LogiLockLED/IndicatorPopup.cs +++ b/LogiLockLED/IndicatorPopup.cs @@ -37,9 +37,9 @@ private void hideTimer_Tick(object sender, EventArgs e) if (this.Visible) { lblLockText.Text = " "; - this.Hide(); - hideTimer.Stop(); + this.Hide(); } + hideTimer.Stop(); } public void ShowLockState(LockKey lockKey, bool state) diff --git a/LogiLockLED/LedController/ILedController.cs b/LogiLockLED/LedController/ILedController.cs index 84fe283..98110a6 100644 --- a/LogiLockLED/LedController/ILedController.cs +++ b/LogiLockLED/LedController/ILedController.cs @@ -6,7 +6,7 @@ namespace LogiLockLED { - public enum LockKey { Caps, Num, Scroll }; + public enum LockKey { Caps, Num, Scroll, Mute, PrtSc, F12, Num_Asterisk}; interface ILedController { diff --git a/LogiLockLED/LedController/LogitechSDKController.cs b/LogiLockLED/LedController/LogitechSDKController.cs index 3dd1028..bde06a6 100644 --- a/LogiLockLED/LedController/LogitechSDKController.cs +++ b/LogiLockLED/LedController/LogitechSDKController.cs @@ -42,12 +42,28 @@ public bool SetLockKeyColor(LockKey key, System.Drawing.Color color) keyCode = keyboardNames.SCROLL_LOCK; break; + case LockKey.Mute: + keyCode = keyboardNames.NUM_ASTERISK; + break; + + case LockKey.PrtSc: + keyCode = keyboardNames.PRINT_SCREEN; + break; + + case LockKey.F12: + keyCode = keyboardNames.F12; + break; + + case LockKey.Num_Asterisk: + keyCode = keyboardNames.NUM_ASTERISK; + break; + default: return false; } return LogitechGSDK.LogiLedSetLightingForKeyWithKeyName(keyCode, color.R * 100 / 255, color.G * 100 / 255, color.B * 100 / 255); - } + } } } diff --git a/LogiLockLED/LedController/OpenRgbController.cs b/LogiLockLED/LedController/OpenRgbController.cs index ba670fe..9a16645 100644 --- a/LogiLockLED/LedController/OpenRgbController.cs +++ b/LogiLockLED/LedController/OpenRgbController.cs @@ -12,7 +12,7 @@ namespace LogiLockLED { public class OpenRgbController : ILedController, IDisposable { - private OpenRGBClient _client; + private IOpenRGBClient _client; public bool Initialise() { @@ -57,6 +57,22 @@ public bool SetLockKeyColor(LockKey key, System.Drawing.Color color) keyName = "Key: Scroll Lock"; break; + case LockKey.Mute: + keyName = "Key: Media Mute"; + break; + + case LockKey.PrtSc: + keyName = "Key: Print Screen"; + break; + + case LockKey.F12: + keyName = "Key: F12"; + break; + + case LockKey.Num_Asterisk: + keyName = "Key: Number Pad *"; + break; + } var ledNumIndex = device.Leds.ToList().FindIndex(a => a.Name == keyName); @@ -82,12 +98,12 @@ public bool SetLockKeyColor(LockKey key, System.Drawing.Color color) public void Shutdown() { - _client.Disconnect(); + //_client.Disconnect(); } public void Dispose() { - _client.Dispose(); + (_client as IDisposable)?.Dispose(); } } } diff --git a/LogiLockLED/LedSettings.cs b/LogiLockLED/LedSettings.cs index 9609f6a..0d5bc7b 100644 --- a/LogiLockLED/LedSettings.cs +++ b/LogiLockLED/LedSettings.cs @@ -12,6 +12,8 @@ public class LedSettings public bool EnableCaps { get; set; } public bool EnableNum { get; set; } public bool EnableScroll { get; set; } + public bool EnableMute { get; set; } + public LockKey MuteIndicatorKey{ get; set; } public Color CapsOnColor { get; set; } public Color CapsOffColor { get; set; } @@ -19,6 +21,9 @@ public class LedSettings public Color NumOffColor { get; set; } public Color ScrollOnColor { get; set; } public Color ScrollOffColor { get; set; } + public Color MuteOnColor { get; set; } + public Color MuteOffColor { get; set; } + public bool OsdEnabled { get; set; } public Font OsdFont { get; set; } @@ -56,6 +61,10 @@ public void LoadSettings() EnableCaps = Properties.Settings.Default.EnableCaps; EnableNum =Properties.Settings.Default.EnableNum; EnableScroll = Properties.Settings.Default.EnableScroll; + EnableMute = Properties.Settings.Default.EnableMute; + + LockKey muteIndicatorKey; + MuteIndicatorKey = (Enum.TryParse(Properties.Settings.Default.MuteIndicatorKey, out muteIndicatorKey) ? muteIndicatorKey : LockKey.Mute); CapsOnColor = Properties.Settings.Default.CapsOnColour; CapsOffColor = Properties.Settings.Default.CapsOffColour; @@ -63,6 +72,8 @@ public void LoadSettings() NumOffColor = Properties.Settings.Default.NumOffColour; ScrollOnColor = Properties.Settings.Default.ScrollOnColour; ScrollOffColor = Properties.Settings.Default.ScrollOffColour; + MuteOnColor = Properties.Settings.Default.MuteOnColour; + MuteOffColor = Properties.Settings.Default.MuteOffColour; AutoStartApp = GetAutoStartSetting(); OsdEnabled = Properties.Settings.Default.OsdEnabled; @@ -100,6 +111,9 @@ public void SaveSettings() Properties.Settings.Default.EnableCaps = EnableCaps; Properties.Settings.Default.EnableNum = EnableNum; Properties.Settings.Default.EnableScroll = EnableScroll; + Properties.Settings.Default.EnableMute = EnableMute; + + Properties.Settings.Default.MuteIndicatorKey = MuteIndicatorKey.ToString(); Properties.Settings.Default.CapsOnColour = CapsOnColor; Properties.Settings.Default.CapsOffColour = CapsOffColor; @@ -107,6 +121,8 @@ public void SaveSettings() Properties.Settings.Default.NumOffColour = NumOffColor; Properties.Settings.Default.ScrollOnColour = ScrollOnColor; Properties.Settings.Default.ScrollOffColour = ScrollOffColor; + Properties.Settings.Default.MuteOnColour = MuteOnColor; + Properties.Settings.Default.MuteOffColour = MuteOffColor; Properties.Settings.Default.OsdEnabled = OsdEnabled; Properties.Settings.Default.OsdFont = OsdFont; diff --git a/LogiLockLED/LedThread.cs b/LogiLockLED/LedThread.cs index e7712e3..0c293d3 100644 --- a/LogiLockLED/LedThread.cs +++ b/LogiLockLED/LedThread.cs @@ -6,12 +6,16 @@ using System.Threading; using System.Threading.Tasks; using System.Timers; +using NAudio.CoreAudioApi; namespace LogiLockLED { - public class LedThread + public class LedThread : IDisposable { + private MMDeviceEnumerator _mmDeviceEnumerator; + private LedSettings _ledSettings; + private static List _threads = new List(); private Thread _thread; private bool _stopThread; private bool _refreshRequired = false; @@ -24,9 +28,11 @@ public class LedThread [DllImport("user32.dll", CharSet = CharSet.Auto, ExactSpelling = true, CallingConvention = CallingConvention.Winapi)] public static extern short GetKeyState(int keyCode); - public LedThread(ref LedSettings settings) - { + public LedThread(LedSettings settings) + { _ledSettings = settings; + _mmDeviceEnumerator = new MMDeviceEnumerator(); + _refreshTimer = new System.Timers.Timer(1000); _refreshTimer.Elapsed += refreshTimerEvent; _refreshTimer.Start(); @@ -49,13 +55,16 @@ public void StartThread() if (_ledSettings.EnableKeyLockLEDs) { - _ledApiInit = _ledController.Initialise(); + if (_thread == null || _thread.ThreadState != ThreadState.Running) { + _ledApiInit = _ledController.Initialise(); _thread = new Thread(ThreadMain); + _thread.Name = "LED Update Thread"; _stopThread = false; _thread.Start(); + _threads.Add(_thread); } } } @@ -80,24 +89,7 @@ public void StopThread() _ledApiInit = false; } - } - - public void UpdateSettings(LedSettings settings) - { - _ledSettings = settings; - if (_ledSettings.EnableKeyLockLEDs) - { - if (_thread == null || _thread.ThreadState != ThreadState.Running) - { - StartThread(); - } - Refresh(); - } - else - { - StopThread(); - } - } + } public void Refresh() { @@ -109,6 +101,9 @@ private void ThreadMain() bool prevCapsLock = (((ushort)GetKeyState(0x14)) & 0xffff) == 0; bool prevNumLock = (((ushort)GetKeyState(0x90)) & 0xffff) == 0; bool prevScrollLock = (((ushort)GetKeyState(0x91)) & 0xffff) == 0; + MMDevice _mmDevice = _mmDeviceEnumerator.GetDefaultAudioEndpoint(DataFlow.Render, Role.Multimedia); + bool prevMuteState = _mmDevice.AudioEndpointVolume.Mute; + bool firstLoop = true; while (!_stopThread) @@ -116,6 +111,7 @@ private void ThreadMain() bool CapsLock = (((ushort)GetKeyState(0x14)) & 0xffff) != 0; bool NumLock = (((ushort)GetKeyState(0x90)) & 0xffff) != 0; bool ScrollLock = (((ushort)GetKeyState(0x91)) & 0xffff) != 0; + bool MuteState = _mmDevice.AudioEndpointVolume.Mute; if ((_refreshRequired || prevNumLock != NumLock)) { @@ -159,6 +155,20 @@ private void ThreadMain() } } + if ((_refreshRequired || prevMuteState != MuteState)) + { + prevMuteState = MuteState; + + if (!firstLoop && !_refreshRequired) + KeylockUpdated?.Invoke(this, new KeylockChangeArgs(LockKey.Mute, MuteState)); + + if (_ledSettings.EnableMute) + { + var col = MuteState ? _ledSettings.MuteOnColor : _ledSettings.MuteOffColor; + setKeyColor(_ledSettings.MuteIndicatorKey, col, _refreshRequired); + } + } + _refreshRequired = false; firstLoop = false; Thread.Sleep(50); @@ -178,7 +188,11 @@ private bool setKeyColor(LockKey key, System.Drawing.Color col, bool forceSet = return _ledController.SetLockKeyColor(key, col); } - + public void Dispose() + { + _mmDeviceEnumerator.Dispose(); + (_ledController as IDisposable)?.Dispose(); + } } diff --git a/LogiLockLED/LogiLockLED.csproj b/LogiLockLED/LogiLockLED.csproj index 5e2173d..7974587 100644 --- a/LogiLockLED/LogiLockLED.csproj +++ b/LogiLockLED/LogiLockLED.csproj @@ -25,8 +25,8 @@ false true true - 3 - 1.4.0.%2a + 0 + 1.5.1.%2a false true true @@ -78,6 +78,12 @@ LogiLockLED.Program + + ..\packages\NAudio.Core.2.1.0\lib\netstandard2.0\NAudio.Core.dll + + + ..\packages\NAudio.Wasapi.2.1.0\lib\netstandard2.0\NAudio.Wasapi.dll + @@ -127,6 +133,7 @@ Resources.Designer.cs + SettingsSingleFileGenerator diff --git a/LogiLockLED/LogiLockLEDApp.cs b/LogiLockLED/LogiLockLEDApp.cs index e5a6c65..c83ad62 100644 --- a/LogiLockLED/LogiLockLEDApp.cs +++ b/LogiLockLED/LogiLockLEDApp.cs @@ -9,7 +9,7 @@ namespace LogiLockLED { class LogiLockLEDApp : ApplicationContext { - private readonly LedThread ledThread; + private LedThread ledThread; private readonly NotifyIcon notifyIcon; private readonly ConfigurationForm configWindow; @@ -31,14 +31,13 @@ public LogiLockLEDApp() configWindow.SettingsUpdated += ConfigWindow_OnSettingsUpdated; popupWindow = new IndicatorPopup(); popupWindow.Configure(ledSettings); + createLedThread(ledSettings); - ledThread = new LedThread(ref ledSettings); - ledThread.KeylockUpdated += ledThread_OnKeylockUpdated; - ledThread.StartThread(); + configEnableItem = new MenuItem("Enabled", new EventHandler(ToggleEnabled)) + { + Checked = ledSettings.EnableKeyLockLEDs + }; - configEnableItem = new MenuItem("Enabled", new EventHandler(ToggleEnabled)) { - Checked = ledSettings.EnableKeyLockLEDs }; - notifyIcon = new NotifyIcon(); notifyIcon.Icon = Properties.Resources.appicon; contextMenu = new ContextMenu(new MenuItem[]{ @@ -60,7 +59,19 @@ public LogiLockLEDApp() } - + private void createLedThread(LedSettings settings) + { + ledThread = new LedThread(settings); + ledThread.KeylockUpdated += ledThread_OnKeylockUpdated; + ledThread.StartThread(); + } + + private void disposeLedThread() + { + ledThread.StopThread(); + ledThread.Dispose(); + } + private void ledThread_OnKeylockUpdated(object sender, EventArgs e) { var args = (e as KeylockChangeArgs); @@ -104,12 +115,13 @@ private void ToggleEnabled(object sender, EventArgs e) private void PropagateSettings() { - ledThread.UpdateSettings(ledSettings); + //ledThread.UpdateSettings(ledSettings); + disposeLedThread(); + createLedThread(ledSettings); popupWindow.Configure(ledSettings); trayManager.UpdateSettings(ledSettings); } - private void Exit(object sender, EventArgs e) { ShutdownApplication(); diff --git a/LogiLockLED/LogitechGSDK.cs b/LogiLockLED/LogitechGSDK.cs index 88a3310..0291942 100644 --- a/LogiLockLED/LogitechGSDK.cs +++ b/LogiLockLED/LogitechGSDK.cs @@ -212,7 +212,12 @@ public class LogitechGSDK [DllImport("LogitechLedEnginesWrapper ", CallingConvention = CallingConvention.Cdecl)] public static extern bool LogiLedSetLightingForKeyWithKeyName(keyboardNames keyCode, int redPercentage, int greenPercentage, int bluePercentage); - + + [DllImport("LogitechLedEnginesWrapper ", CallingConvention = CallingConvention.Cdecl)] + public static extern bool LogiLedSetLightingForKeyWithKeyName(int keyCode, int redPercentage, int greenPercentage, int bluePercentage); + + + [DllImport("LogitechLedEnginesWrapper ", CallingConvention = CallingConvention.Cdecl)] public static extern bool LogiLedSaveLightingForKey(keyboardNames keyName); diff --git a/LogiLockLED/Properties/Settings.Designer.cs b/LogiLockLED/Properties/Settings.Designer.cs index a2f7260..5211e74 100644 --- a/LogiLockLED/Properties/Settings.Designer.cs +++ b/LogiLockLED/Properties/Settings.Designer.cs @@ -418,5 +418,53 @@ public string LedController { this["LedController"] = value; } } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("Red")] + public global::System.Drawing.Color MuteOnColour { + get { + return ((global::System.Drawing.Color)(this["MuteOnColour"])); + } + set { + this["MuteOnColour"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("White")] + public global::System.Drawing.Color MuteOffColour { + get { + return ((global::System.Drawing.Color)(this["MuteOffColour"])); + } + set { + this["MuteOffColour"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("False")] + public bool EnableMute { + get { + return ((bool)(this["EnableMute"])); + } + set { + this["EnableMute"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("Mute")] + public string MuteIndicatorKey { + get { + return ((string)(this["MuteIndicatorKey"])); + } + set { + this["MuteIndicatorKey"] = value; + } + } } } diff --git a/LogiLockLED/Properties/Settings.settings b/LogiLockLED/Properties/Settings.settings index 8e3e8f3..315998a 100644 --- a/LogiLockLED/Properties/Settings.settings +++ b/LogiLockLED/Properties/Settings.settings @@ -101,5 +101,17 @@ OpenRGB + + Red + + + White + + + False + + + Mute + \ No newline at end of file diff --git a/LogiLockLED/packages.config b/LogiLockLED/packages.config new file mode 100644 index 0000000..9b35fe3 --- /dev/null +++ b/LogiLockLED/packages.config @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file