From bb98f7d5b067a3ae62ea1a5c1a6c977224360390 Mon Sep 17 00:00:00 2001 From: zeromus Date: Tue, 22 Apr 2014 19:23:52 +0000 Subject: [PATCH] fix new bugs in hotkey/input binding process --- BizHawk.Client.EmuHawk/config/HotkeyConfig.cs | 2 +- .../config/InputCompositeWidget.Designer.cs | 4 ++-- BizHawk.Client.EmuHawk/config/InputCompositeWidget.cs | 7 +++++++ BizHawk.Client.EmuHawk/config/InputWidget.cs | 4 +++- 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/BizHawk.Client.EmuHawk/config/HotkeyConfig.cs b/BizHawk.Client.EmuHawk/config/HotkeyConfig.cs index cdb29ed3b9..a38a8a054b 100644 --- a/BizHawk.Client.EmuHawk/config/HotkeyConfig.cs +++ b/BizHawk.Client.EmuHawk/config/HotkeyConfig.cs @@ -110,7 +110,7 @@ namespace BizHawk.Client.EmuHawk Width = iwOffsetX - 2, }; - var w = new InputWidget + var w = new InputCompositeWidget { Bindings = b.Bindings, Location = new Point(_x + iwOffsetX, _y + iwOffsetY), diff --git a/BizHawk.Client.EmuHawk/config/InputCompositeWidget.Designer.cs b/BizHawk.Client.EmuHawk/config/InputCompositeWidget.Designer.cs index b202c6dfe2..68ef79dfab 100644 --- a/BizHawk.Client.EmuHawk/config/InputCompositeWidget.Designer.cs +++ b/BizHawk.Client.EmuHawk/config/InputCompositeWidget.Designer.cs @@ -44,7 +44,7 @@ this.btnSpecial.Margin = new System.Windows.Forms.Padding(2, 0, 0, 0); this.btnSpecial.Name = "btnSpecial"; this.btnSpecial.Size = new System.Drawing.Size(20, 20); - this.btnSpecial.TabIndex = 6; + this.btnSpecial.TabIndex = 2; this.btnSpecial.UseVisualStyleBackColor = true; this.btnSpecial.Click += new System.EventHandler(this.btnSpecial_Click); // @@ -74,7 +74,7 @@ this.widget.Margin = new System.Windows.Forms.Padding(0); this.widget.Name = "widget"; this.widget.Size = new System.Drawing.Size(470, 20); - this.widget.TabIndex = 8; + this.widget.TabIndex = 1; this.widget.Text = "button1"; this.widget.WidgetName = null; // diff --git a/BizHawk.Client.EmuHawk/config/InputCompositeWidget.cs b/BizHawk.Client.EmuHawk/config/InputCompositeWidget.cs index f96ad3cca1..3726b65001 100644 --- a/BizHawk.Client.EmuHawk/config/InputCompositeWidget.cs +++ b/BizHawk.Client.EmuHawk/config/InputCompositeWidget.cs @@ -25,6 +25,13 @@ namespace BizHawk.Client.EmuHawk } btnSpecial.ContextMenuStrip = DropdownMenu; + + widget.CompositeWidget = this; + } + + public void TabNext() + { + Parent.SelectNextControl(btnSpecial, true, true, true, true); } ContextMenuStrip DropdownMenu; diff --git a/BizHawk.Client.EmuHawk/config/InputWidget.cs b/BizHawk.Client.EmuHawk/config/InputWidget.cs index 37f2fc8321..e54d4ebeb5 100644 --- a/BizHawk.Client.EmuHawk/config/InputWidget.cs +++ b/BizHawk.Client.EmuHawk/config/InputWidget.cs @@ -17,6 +17,8 @@ namespace BizHawk.Client.EmuHawk private int _pos; // Which mapping the widget will listen for private string _wasPressed = string.Empty; + public InputCompositeWidget CompositeWidget; + /// /// These bindings get ignored by the widget and can only be entered by SetBinding() via the contextmenu from the InputCompositeWidget /// @@ -200,7 +202,7 @@ namespace BizHawk.Client.EmuHawk { if (AutoTab) { - Parent.SelectNextControl(this, true, true, true, true); + CompositeWidget.TabNext(); } else {