diff --git a/src/RSoft.MacroPad.BLL/Infrasturture/Model/MouseButton.cs b/src/RSoft.MacroPad.BLL/Infrasturture/Model/MouseButton.cs index 3d3c4ab..028759c 100644 --- a/src/RSoft.MacroPad.BLL/Infrasturture/Model/MouseButton.cs +++ b/src/RSoft.MacroPad.BLL/Infrasturture/Model/MouseButton.cs @@ -3,18 +3,23 @@ public enum MouseButton { [MouseValues(1,0)] + [VirtualKeyMap(VirtualKey.LButton)] Left, [MouseValues(4, 0)] + [VirtualKeyMap(VirtualKey.MButton)] Middle, [MouseValues(2, 0)] + [VirtualKeyMap(VirtualKey.RButton)] Right, [MouseValues(0, 1)] + [VirtualKeyMap(VirtualKey.Up)] ScrollUp, [MouseValues(0, 255)] + [VirtualKeyMap(VirtualKey.Down)] ScrollDown } } diff --git a/src/RSoft.MacroPad.BLL/RSoft.MacroPad.BLL.csproj b/src/RSoft.MacroPad.BLL/RSoft.MacroPad.BLL.csproj index 52f21a3..d470ace 100644 --- a/src/RSoft.MacroPad.BLL/RSoft.MacroPad.BLL.csproj +++ b/src/RSoft.MacroPad.BLL/RSoft.MacroPad.BLL.csproj @@ -1,6 +1,6 @@  - net6.0 + net8.0 Library false RSoft.MacroPad.BLL @@ -9,6 +9,12 @@ 1.0.0.0 1.0.0.0 + + 9999 + + + 9999 + diff --git a/src/RSoft.MacroPad/Controls/Compound/KeyRecorderTextBox.Designer.cs b/src/RSoft.MacroPad/Controls/Compound/KeyRecorderTextBox.Designer.cs index 9b63f8b..fa65bdc 100644 --- a/src/RSoft.MacroPad/Controls/Compound/KeyRecorderTextBox.Designer.cs +++ b/src/RSoft.MacroPad/Controls/Compound/KeyRecorderTextBox.Designer.cs @@ -27,16 +27,17 @@ private void InitializeComponent() panel1 = new System.Windows.Forms.Panel(); checkBox1 = new System.Windows.Forms.CheckBox(); toolTip1 = new System.Windows.Forms.ToolTip(components); + button3 = new System.Windows.Forms.Button(); SuspendLayout(); // // button1 // button1.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right; - button1.Font = new System.Drawing.Font("Arial", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point); - button1.Location = new System.Drawing.Point(807, 3); - button1.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + button1.Font = new System.Drawing.Font("Arial", 9.75F, System.Drawing.FontStyle.Bold); + button1.Location = new System.Drawing.Point(1153, 5); + button1.Margin = new System.Windows.Forms.Padding(6, 5, 6, 5); button1.Name = "button1"; - button1.Size = new System.Drawing.Size(27, 27); + button1.Size = new System.Drawing.Size(39, 45); button1.TabIndex = 1; button1.Text = "X"; toolTip1.SetToolTip(button1, "Clear all"); @@ -46,11 +47,11 @@ private void InitializeComponent() // button2 // button2.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right; - button2.Font = new System.Drawing.Font("Arial Narrow", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); - button2.Location = new System.Drawing.Point(807, 37); - button2.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + button2.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F); + button2.Location = new System.Drawing.Point(1153, 62); + button2.Margin = new System.Windows.Forms.Padding(6, 5, 6, 5); button2.Name = "button2"; - button2.Size = new System.Drawing.Size(27, 27); + button2.Size = new System.Drawing.Size(39, 45); button2.TabIndex = 1; button2.Text = "◄"; toolTip1.SetToolTip(button2, "Delete last"); @@ -63,21 +64,21 @@ private void InitializeComponent() panel1.BackColor = System.Drawing.Color.White; panel1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; panel1.Location = new System.Drawing.Point(0, 0); - panel1.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + panel1.Margin = new System.Windows.Forms.Padding(6, 5, 6, 5); panel1.Name = "panel1"; - panel1.Size = new System.Drawing.Size(795, 144); + panel1.Size = new System.Drawing.Size(1135, 239); panel1.TabIndex = 2; // // checkBox1 // checkBox1.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right; checkBox1.Appearance = System.Windows.Forms.Appearance.Button; - checkBox1.Font = new System.Drawing.Font("Arial Narrow", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + checkBox1.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F); checkBox1.ForeColor = System.Drawing.Color.Red; - checkBox1.Location = new System.Drawing.Point(807, 70); - checkBox1.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + checkBox1.Location = new System.Drawing.Point(1153, 117); + checkBox1.Margin = new System.Windows.Forms.Padding(6, 5, 6, 5); checkBox1.Name = "checkBox1"; - checkBox1.Size = new System.Drawing.Size(27, 27); + checkBox1.Size = new System.Drawing.Size(39, 45); checkBox1.TabIndex = 0; checkBox1.Text = "●"; checkBox1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; @@ -85,18 +86,33 @@ private void InitializeComponent() checkBox1.UseVisualStyleBackColor = true; checkBox1.CheckedChanged += checkBox1_CheckedChanged; // + // button3 + // + button3.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right; + button3.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F); + button3.Location = new System.Drawing.Point(1153, 172); + button3.Margin = new System.Windows.Forms.Padding(6, 5, 6, 5); + button3.Name = "button3"; + button3.Size = new System.Drawing.Size(39, 45); + button3.TabIndex = 3; + button3.Text = "≡"; + toolTip1.SetToolTip(button3, "Manually Enter Key"); + button3.UseVisualStyleBackColor = true; + button3.Click += button3_Click; + // // KeyRecorderTextBox // - AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); + AutoScaleDimensions = new System.Drawing.SizeF(10F, 25F); AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + Controls.Add(button3); Controls.Add(checkBox1); Controls.Add(panel1); Controls.Add(button2); Controls.Add(button1); - Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); - MinimumSize = new System.Drawing.Size(467, 92); + Margin = new System.Windows.Forms.Padding(6, 5, 6, 5); + MinimumSize = new System.Drawing.Size(667, 153); Name = "KeyRecorderTextBox"; - Size = new System.Drawing.Size(838, 144); + Size = new System.Drawing.Size(1197, 240); ResumeLayout(false); } @@ -106,5 +122,6 @@ private void InitializeComponent() private System.Windows.Forms.Panel panel1; private System.Windows.Forms.CheckBox checkBox1; private System.Windows.Forms.ToolTip toolTip1; + private System.Windows.Forms.Button button3; } } diff --git a/src/RSoft.MacroPad/Controls/Compound/KeyRecorderTextBox.cs b/src/RSoft.MacroPad/Controls/Compound/KeyRecorderTextBox.cs index 1ed899f..6906265 100644 --- a/src/RSoft.MacroPad/Controls/Compound/KeyRecorderTextBox.cs +++ b/src/RSoft.MacroPad/Controls/Compound/KeyRecorderTextBox.cs @@ -9,8 +9,11 @@ using RSoft.MacroPad.BLL.Infrasturture.Model; using RSoft.MacroPad.BLL.Infrasturture.Protocol.Mappers; using RSoft.MacroPad.Controls.Simple; +using RSoft.MacroPad.Forms; using RSoft.MacroPad.Infrastructure; using RSoft.MacroPad.Model; +using Windows.Win32; +using Windows.Win32.UI.Input.KeyboardAndMouse; namespace RSoft.MacroPad.Controls.Compound { @@ -242,5 +245,29 @@ private bool IsModifier(Keys k) k == Keys.LControlKey || k == Keys.RControlKey || k == Keys.LWin || k == Keys.RWin; } + + private void button3_Click(object sender, EventArgs e) + { + var manualKeyForm = new ManualKeyForm(); + manualKeyForm.ShowDialog(); + if (manualKeyForm.DialogResult == DialogResult.OK && manualKeyForm.keySelected != VirtualKey.None) + { + var newModStroke = new KeyStroke + { + Key = (Keys)manualKeyForm.keySelected, + ScanCode = PInvoke.MapVirtualKey((uint)manualKeyForm.keySelected, MAP_VIRTUAL_KEY_TYPE.MAPVK_VK_TO_VSC), + Operation = KeyStrokeOperation.Release, + AltL = (manualKeyForm.modifier & Modifier.LeftAlt) != Modifier.None, + AltR = (manualKeyForm.modifier & Modifier.RightAlt) != Modifier.None, + CtrlL = (manualKeyForm.modifier & Modifier.LeftCtrl) != Modifier.None, + CtrlR = (manualKeyForm.modifier & Modifier.RightCtrl) != Modifier.None, + ShiftL = (manualKeyForm.modifier & Modifier.LeftShift) != Modifier.None, + ShiftR = (manualKeyForm.modifier & Modifier.RightShift) != Modifier.None, + WinL = (manualKeyForm.modifier & Modifier.LeftWin) != Modifier.None, + WinR = (manualKeyForm.modifier & Modifier.RightWin) != Modifier.None, + }; + _sequence.Add(newModStroke); + } + } } } diff --git a/src/RSoft.MacroPad/Controls/Compound/KeyRecorderTextBox.resx b/src/RSoft.MacroPad/Controls/Compound/KeyRecorderTextBox.resx index 946f457..dcfd08d 100644 --- a/src/RSoft.MacroPad/Controls/Compound/KeyRecorderTextBox.resx +++ b/src/RSoft.MacroPad/Controls/Compound/KeyRecorderTextBox.resx @@ -1,7 +1,7 @@  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 17 + + \ No newline at end of file diff --git a/src/RSoft.MacroPad/RSoft.MacroPad.csproj b/src/RSoft.MacroPad/RSoft.MacroPad.csproj index a7f11a9..53a35eb 100644 --- a/src/RSoft.MacroPad/RSoft.MacroPad.csproj +++ b/src/RSoft.MacroPad/RSoft.MacroPad.csproj @@ -1,6 +1,6 @@  - net6.0-windows + net8.0-windows10.0.26100.0 WinExe publish\ true