From 7fa5de3c1578c1e2a4b1a7602f3a0e12c0f77f99 Mon Sep 17 00:00:00 2001 From: goyuken Date: Sat, 11 Jan 2014 15:11:49 +0000 Subject: [PATCH] add Flip Axis button to AnalogBindControl. resolves issue 139 --- .../ControllerConfig/AnalogBindControl.Designer.cs | 13 +++++++++++++ .../config/ControllerConfig/AnalogBindControl.cs | 5 +++++ 2 files changed, 18 insertions(+) diff --git a/BizHawk.Client.EmuHawk/config/ControllerConfig/AnalogBindControl.Designer.cs b/BizHawk.Client.EmuHawk/config/ControllerConfig/AnalogBindControl.Designer.cs index 874e5f079d..7b462336bd 100644 --- a/BizHawk.Client.EmuHawk/config/ControllerConfig/AnalogBindControl.Designer.cs +++ b/BizHawk.Client.EmuHawk/config/ControllerConfig/AnalogBindControl.Designer.cs @@ -37,6 +37,7 @@ this.buttonBind = new System.Windows.Forms.Button(); this.trackBarDeadzone = new System.Windows.Forms.TrackBar(); this.labelDeadzone = new System.Windows.Forms.Label(); + this.buttonFlip = new System.Windows.Forms.Button(); ((System.ComponentModel.ISupportInitialize)(this.trackBarSensitivity)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.trackBarDeadzone)).BeginInit(); this.SuspendLayout(); @@ -112,10 +113,21 @@ this.labelDeadzone.TabIndex = 6; this.labelDeadzone.Text = "Deadzone: 5 billion"; // + // buttonFlip + // + this.buttonFlip.Location = new System.Drawing.Point(88, 29); + this.buttonFlip.Name = "buttonFlip"; + this.buttonFlip.Size = new System.Drawing.Size(75, 23); + this.buttonFlip.TabIndex = 7; + this.buttonFlip.Text = "Flip Axis"; + this.buttonFlip.UseVisualStyleBackColor = true; + this.buttonFlip.Click += new System.EventHandler(this.buttonFlip_Click); + // // AnalogBindControl // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.buttonFlip); this.Controls.Add(this.labelDeadzone); this.Controls.Add(this.trackBarDeadzone); this.Controls.Add(this.buttonBind); @@ -142,5 +154,6 @@ private System.Windows.Forms.Button buttonBind; private System.Windows.Forms.TrackBar trackBarDeadzone; private System.Windows.Forms.Label labelDeadzone; + private System.Windows.Forms.Button buttonFlip; } } diff --git a/BizHawk.Client.EmuHawk/config/ControllerConfig/AnalogBindControl.cs b/BizHawk.Client.EmuHawk/config/ControllerConfig/AnalogBindControl.cs index ddc6e9d18a..511f995dfc 100644 --- a/BizHawk.Client.EmuHawk/config/ControllerConfig/AnalogBindControl.cs +++ b/BizHawk.Client.EmuHawk/config/ControllerConfig/AnalogBindControl.cs @@ -78,5 +78,10 @@ namespace BizHawk.Client.EmuHawk Bind.Deadzone = trackBarDeadzone.Value / 20.0f; labelDeadzone.Text = String.Format("Deadzone: {0}", (Bind.Deadzone*100)) + "%"; } + + private void buttonFlip_Click(object sender, EventArgs e) + { + trackBarSensitivity.Value *= -1; + } } }