From d5bb0c9b4c63b7290eb21a1e9a1653b529413b54 Mon Sep 17 00:00:00 2001 From: goyuken Date: Sun, 9 Feb 2014 23:18:42 +0000 Subject: [PATCH] analog controls: add ability to unbind buttons --- .../ControllerConfig/AnalogBindControl.Designer.cs | 13 +++++++++++++ .../config/ControllerConfig/AnalogBindControl.cs | 6 ++++++ 2 files changed, 19 insertions(+) diff --git a/BizHawk.Client.EmuHawk/config/ControllerConfig/AnalogBindControl.Designer.cs b/BizHawk.Client.EmuHawk/config/ControllerConfig/AnalogBindControl.Designer.cs index 7b462336bd..1e8217f47d 100644 --- a/BizHawk.Client.EmuHawk/config/ControllerConfig/AnalogBindControl.Designer.cs +++ b/BizHawk.Client.EmuHawk/config/ControllerConfig/AnalogBindControl.Designer.cs @@ -38,6 +38,7 @@ this.trackBarDeadzone = new System.Windows.Forms.TrackBar(); this.labelDeadzone = new System.Windows.Forms.Label(); this.buttonFlip = new System.Windows.Forms.Button(); + this.buttonUnbind = new System.Windows.Forms.Button(); ((System.ComponentModel.ISupportInitialize)(this.trackBarSensitivity)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.trackBarDeadzone)).BeginInit(); this.SuspendLayout(); @@ -123,10 +124,21 @@ this.buttonFlip.UseVisualStyleBackColor = true; this.buttonFlip.Click += new System.EventHandler(this.buttonFlip_Click); // + // buttonUnbind + // + this.buttonUnbind.Location = new System.Drawing.Point(3, 58); + this.buttonUnbind.Name = "buttonUnbind"; + this.buttonUnbind.Size = new System.Drawing.Size(75, 23); + this.buttonUnbind.TabIndex = 8; + this.buttonUnbind.Text = "Unbind!"; + this.buttonUnbind.UseVisualStyleBackColor = true; + this.buttonUnbind.Click += new System.EventHandler(this.buttonUnbind_Click); + // // AnalogBindControl // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.buttonUnbind); this.Controls.Add(this.buttonFlip); this.Controls.Add(this.labelDeadzone); this.Controls.Add(this.trackBarDeadzone); @@ -155,5 +167,6 @@ private System.Windows.Forms.TrackBar trackBarDeadzone; private System.Windows.Forms.Label labelDeadzone; private System.Windows.Forms.Button buttonFlip; + private System.Windows.Forms.Button buttonUnbind; } } diff --git a/BizHawk.Client.EmuHawk/config/ControllerConfig/AnalogBindControl.cs b/BizHawk.Client.EmuHawk/config/ControllerConfig/AnalogBindControl.cs index 511f995dfc..4e943482a8 100644 --- a/BizHawk.Client.EmuHawk/config/ControllerConfig/AnalogBindControl.cs +++ b/BizHawk.Client.EmuHawk/config/ControllerConfig/AnalogBindControl.cs @@ -83,5 +83,11 @@ namespace BizHawk.Client.EmuHawk { trackBarSensitivity.Value *= -1; } + + private void buttonUnbind_Click(object sender, EventArgs e) + { + Bind.Value = ""; + textBox1.Text = ""; + } } }