Input Widget - auto tab parameter, hotkey config - a auto-tab setting (on by default). If off, the focused widget will stay focused after a binding, another key pressed will rebind the same key

This commit is contained in:
andres.delikat 2011-07-04 23:02:37 +00:00
parent 0934b35a1e
commit 02e562825e
4 changed files with 58 additions and 19 deletions

View File

@ -103,6 +103,7 @@
public bool AllowUD_LR = false; public bool AllowUD_LR = false;
public bool ShowContextMenu = true; public bool ShowContextMenu = true;
public bool EnableBackupMovies = true; public bool EnableBackupMovies = true;
public bool HotkeyConfigAutoTab = true;
// Run-Control settings // Run-Control settings
public int FrameProgressDelayMs = 500; //how long until a frame advance hold turns into a frame progress? public int FrameProgressDelayMs = 500; //how long until a frame advance hold turns into a frame progress?

View File

@ -31,6 +31,8 @@
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(HotkeyWindow)); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(HotkeyWindow));
this.hotkeyTabs = new System.Windows.Forms.TabControl(); this.hotkeyTabs = new System.Windows.Forms.TabControl();
this.tabPage1 = new System.Windows.Forms.TabPage(); this.tabPage1 = new System.Windows.Forms.TabPage();
this.label71 = new System.Windows.Forms.Label();
this.IDW_RESET = new BizHawk.MultiClient.InputWidget();
this.label70 = new System.Windows.Forms.Label(); this.label70 = new System.Windows.Forms.Label();
this.IDW_UNTHROTTLE = new BizHawk.MultiClient.InputWidget(); this.IDW_UNTHROTTLE = new BizHawk.MultiClient.InputWidget();
this.label69 = new System.Windows.Forms.Label(); this.label69 = new System.Windows.Forms.Label();
@ -176,8 +178,7 @@
this.IDB_SAVE = new System.Windows.Forms.Button(); this.IDB_SAVE = new System.Windows.Forms.Button();
this.IDB_CANCEL = new System.Windows.Forms.Button(); this.IDB_CANCEL = new System.Windows.Forms.Button();
this.label38 = new System.Windows.Forms.Label(); this.label38 = new System.Windows.Forms.Label();
this.IDW_RESET = new BizHawk.MultiClient.InputWidget(); this.AutoTabCheckBox = new System.Windows.Forms.CheckBox();
this.label71 = new System.Windows.Forms.Label();
this.hotkeyTabs.SuspendLayout(); this.hotkeyTabs.SuspendLayout();
this.tabPage1.SuspendLayout(); this.tabPage1.SuspendLayout();
this.tabPage2.SuspendLayout(); this.tabPage2.SuspendLayout();
@ -248,6 +249,24 @@
this.tabPage1.Text = "General"; this.tabPage1.Text = "General";
this.tabPage1.UseVisualStyleBackColor = true; this.tabPage1.UseVisualStyleBackColor = true;
// //
// label71
//
this.label71.AutoSize = true;
this.label71.Location = new System.Drawing.Point(6, 110);
this.label71.Name = "label71";
this.label71.Size = new System.Drawing.Size(57, 13);
this.label71.TabIndex = 61;
this.label71.Text = "Soft Reset";
//
// IDW_RESET
//
this.IDW_RESET.AcceptsTab = true;
this.IDW_RESET.BackColor = System.Drawing.SystemColors.Window;
this.IDW_RESET.Location = new System.Drawing.Point(92, 107);
this.IDW_RESET.Name = "IDW_RESET";
this.IDW_RESET.Size = new System.Drawing.Size(100, 20);
this.IDW_RESET.TabIndex = 5;
//
// label70 // label70
// //
this.label70.AutoSize = true; this.label70.AutoSize = true;
@ -1591,29 +1610,23 @@
this.label38.TabIndex = 3; this.label38.TabIndex = 3;
this.label38.Text = "* Escape clears a key mapping"; this.label38.Text = "* Escape clears a key mapping";
// //
// IDW_RESET // AutoTabCheckBox
// //
this.IDW_RESET.AcceptsTab = true; this.AutoTabCheckBox.AutoSize = true;
this.IDW_RESET.BackColor = System.Drawing.SystemColors.Window; this.AutoTabCheckBox.Location = new System.Drawing.Point(552, 362);
this.IDW_RESET.Location = new System.Drawing.Point(92, 107); this.AutoTabCheckBox.Name = "AutoTabCheckBox";
this.IDW_RESET.Name = "IDW_RESET"; this.AutoTabCheckBox.Size = new System.Drawing.Size(70, 17);
this.IDW_RESET.Size = new System.Drawing.Size(100, 20); this.AutoTabCheckBox.TabIndex = 100;
this.IDW_RESET.TabIndex = 5; this.AutoTabCheckBox.Text = "Auto Tab";
// this.AutoTabCheckBox.UseVisualStyleBackColor = true;
// label71 this.AutoTabCheckBox.CheckedChanged += new System.EventHandler(this.AutoTabCheckBox_CheckedChanged);
//
this.label71.AutoSize = true;
this.label71.Location = new System.Drawing.Point(6, 110);
this.label71.Name = "label71";
this.label71.Size = new System.Drawing.Size(57, 13);
this.label71.TabIndex = 61;
this.label71.Text = "Soft Reset";
// //
// HotkeyWindow // HotkeyWindow
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(637, 380); this.ClientSize = new System.Drawing.Size(637, 380);
this.Controls.Add(this.AutoTabCheckBox);
this.Controls.Add(this.label38); this.Controls.Add(this.label38);
this.Controls.Add(this.IDB_CANCEL); this.Controls.Add(this.IDB_CANCEL);
this.Controls.Add(this.IDB_SAVE); this.Controls.Add(this.IDB_SAVE);
@ -1790,5 +1803,6 @@
private InputWidget IDW_UNTHROTTLE; private InputWidget IDW_UNTHROTTLE;
private InputWidget IDW_RESET; private InputWidget IDW_RESET;
private System.Windows.Forms.Label label71; private System.Windows.Forms.Label label71;
private System.Windows.Forms.CheckBox AutoTabCheckBox;
} }
} }

View File

@ -184,7 +184,29 @@ namespace BizHawk.MultiClient.tools
private void HotkeyWindow_Load(object sender, EventArgs e) private void HotkeyWindow_Load(object sender, EventArgs e)
{ {
AutoTabCheckBox.Checked = Global.Config.HotkeyConfigAutoTab;
SetAutoTab();
}
private void AutoTabCheckBox_CheckedChanged(object sender, EventArgs e)
{
Global.Config.HotkeyConfigAutoTab = AutoTabCheckBox.Checked;
SetAutoTab();
}
private void SetAutoTab()
{
for (int x = 0; x < hotkeyTabs.TabPages.Count; x++)
{
for (int y = 0; y < hotkeyTabs.TabPages[x].Controls.Count; y++)
{
if (hotkeyTabs.TabPages[x].Controls[y] is InputWidget)
{
InputWidget w = hotkeyTabs.TabPages[x].Controls[y] as InputWidget;
w.AutoTab = AutoTabCheckBox.Checked;
}
}
}
} }
} }
} }

View File

@ -13,6 +13,7 @@ namespace BizHawk.MultiClient
} }
public List<IBinding> Bindings = new List<IBinding>(); public List<IBinding> Bindings = new List<IBinding>();
public bool AutoTab = true;
bool ctrlWasPressed = false; bool ctrlWasPressed = false;
bool altWasPressed = false; bool altWasPressed = false;
bool shiftWasPressed = false; bool shiftWasPressed = false;
@ -52,7 +53,8 @@ namespace BizHawk.MultiClient
Bindings.Clear(); Bindings.Clear();
UpdateLabel(); UpdateLabel();
} }
this.Parent.SelectNextControl(this, true, true, true, true); if (AutoTab)
this.Parent.SelectNextControl(this, true, true, true, true);
} }
protected override void OnKeyUp(KeyEventArgs e) protected override void OnKeyUp(KeyEventArgs e)