diff --git a/XOutput/ControllerDevice.cs b/XOutput/ControllerDevice.cs index 50e9613..5a47b1e 100644 --- a/XOutput/ControllerDevice.cs +++ b/XOutput/ControllerDevice.cs @@ -19,10 +19,10 @@ public class ControllerDevice public bool enabled = true; public OutputState cOutput; - public byte[] mapping = new byte[42]; + public byte[] mapping = new byte[44]; bool[] buttons; int[] dPads; - int[] analogs; + public int[] analogs; delegate byte input(byte subType, byte num); @@ -33,7 +33,14 @@ public ControllerDevice(Joystick joy, int num) deviceNumber = num; name = joystick.Information.InstanceName; cOutput = new OutputState(); - for (int i = 0; i < 42; i++) + + joystick.Poll(); + JoystickState jState = joystick.GetCurrentState(); + buttons = jState.GetButtons(); + dPads = jState.GetPointOfViewControllers(); + analogs = GetAxes(jState); + + for (int i = 0; i < mapping.Length; i++) { mapping[i] = 255; //Changed default mapping to blank } @@ -141,10 +148,10 @@ private void updateInput() input funcDPad = DPad; input[] funcArray = new input[] { funcButton, funcAnalog, funcDPad }; - byte[] output = new byte[21]; - for (int i = 0; i < 21; i++) + byte[] output = new byte[22]; + for (int i = 0; i < 22; i++) { - if (mapping[i * 2] == 255) + if (mapping[i * 2] == 255 || mapping[i * 2] == 253) { continue; } @@ -214,7 +221,6 @@ public byte[] getoutput() //Guide Report[12] = (byte)(cOutput.Home ? 0xFF : 0x00); - Report[14] = cOutput.LX; //Left Stick X @@ -231,7 +237,5 @@ public byte[] getoutput() return Report; } - - } } diff --git a/XOutput/ControllerManager.cs b/XOutput/ControllerManager.cs index 7b2b3a2..75b0435 100644 --- a/XOutput/ControllerManager.cs +++ b/XOutput/ControllerManager.cs @@ -25,6 +25,7 @@ private class ContData private Control handle; public bool isExclusive = false; + protected int compensationValue = 0; private object[] ds4locks = new object[4]; @@ -68,7 +69,6 @@ public void changeExclusive(bool e) public ControllerDevice getController(int n) { return devices[n]; - } public void Swap(int i, int p) @@ -94,6 +94,11 @@ public void setControllerEnable(int i, bool b) private Int32 Scale(Int32 Value, Boolean Flip) { + if (Value == 0) + { + return Value; + } + Value -= 0x80; if (Value == -128) Value = -127; @@ -133,6 +138,9 @@ public override bool Start() { if (devices[i] != null && devices[i].enabled) { + //Need to figure this out for multiple controllers... + compensationValue = devices[i].mapping[devices[i].mapping.Length - 1]; + running = true; processingData[i] = new ContData(); Console.WriteLine("Plug " + i); @@ -299,7 +307,6 @@ private void ProcessData(int n) byte[] data = devices[n].getoutput(); if (data != null && devices[n].enabled) { - data[0] = (byte)n; Parse(data, processingData[n].parsedData); Report(processingData[n].parsedData, processingData[n].output); @@ -362,7 +369,7 @@ public void Parse(Byte[] Input, Byte[] Output) Output[12] = Input[26]; // Left Trigger Output[13] = Input[27]; // Right Trigger - Int32 ThumbLX = Scale(Input[14], false); + Int32 ThumbLX = Scale(CorrectDeadZone(Input[14], 127, compensationValue), false); Int32 ThumbLY = -Scale(Input[15], false); Int32 ThumbRX = Scale(Input[16], false); Int32 ThumbRY = -Scale(Input[17], false); @@ -380,6 +387,35 @@ public void Parse(Byte[] Input, Byte[] Output) Output[21] = (Byte)((ThumbRY >> 8) & 0xFF); } } + private int CorrectDeadZone(int input, int centerPoint, int deadZoneCompensation) + { + int returnVal = input; + + if (deadZoneCompensation > 0) + { + if (input > centerPoint) + { + //Steering Right + returnVal += deadZoneCompensation; + } + else if (input < centerPoint) + { + //Steering Left + returnVal -= deadZoneCompensation; + } + + //Full Lock + if (returnVal > 255) + { + returnVal = 255; + } + else if (returnVal < 1) + { + returnVal = 1; + } + } + return returnVal; + } } } diff --git a/XOutput/ControllerOptions.Designer.cs b/XOutput/ControllerOptions.Designer.cs index 4e9845d..cedf7f1 100644 --- a/XOutput/ControllerOptions.Designer.cs +++ b/XOutput/ControllerOptions.Designer.cs @@ -28,518 +28,601 @@ protected override void Dispose(bool disposing) /// private void InitializeComponent() { - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(XOut)); - this.labelA = new System.Windows.Forms.Label(); - this.labelB = new System.Windows.Forms.Label(); - this.labelX = new System.Windows.Forms.Label(); - this.labelY = new System.Windows.Forms.Label(); - this.labelUp = new System.Windows.Forms.Label(); - this.labelDown = new System.Windows.Forms.Label(); - this.labelLeft = new System.Windows.Forms.Label(); - this.labelRight = new System.Windows.Forms.Label(); - this.dropRight = new XOutput.MultiLevelComboBox(); - this.dropLeft = new XOutput.MultiLevelComboBox(); - this.dropDown = new XOutput.MultiLevelComboBox(); - this.dropUp = new XOutput.MultiLevelComboBox(); - this.dropY = new XOutput.MultiLevelComboBox(); - this.dropX = new XOutput.MultiLevelComboBox(); - this.dropB = new XOutput.MultiLevelComboBox(); - this.dropA = new XOutput.MultiLevelComboBox(); - this.dropRT = new XOutput.MultiLevelComboBox(); - this.dropLT = new XOutput.MultiLevelComboBox(); - this.dropRB = new XOutput.MultiLevelComboBox(); - this.dropLB = new XOutput.MultiLevelComboBox(); - this.dropBack = new XOutput.MultiLevelComboBox(); - this.dropStart = new XOutput.MultiLevelComboBox(); - this.dropHome = new XOutput.MultiLevelComboBox(); - this.labelRT = new System.Windows.Forms.Label(); - this.labelLT = new System.Windows.Forms.Label(); - this.labelRB = new System.Windows.Forms.Label(); - this.labelLB = new System.Windows.Forms.Label(); this.labelBack = new System.Windows.Forms.Label(); this.labelStart = new System.Windows.Forms.Label(); this.labelHome = new System.Windows.Forms.Label(); - this.dropRA = new XOutput.MultiLevelComboBox(); - this.dropLA = new XOutput.MultiLevelComboBox(); - this.dropRX = new XOutput.MultiLevelComboBox(); - this.dropRY = new XOutput.MultiLevelComboBox(); - this.dropLX = new XOutput.MultiLevelComboBox(); - this.dropLY = new XOutput.MultiLevelComboBox(); this.labelRA = new System.Windows.Forms.Label(); this.labelLA = new System.Windows.Forms.Label(); this.labelLX = new System.Windows.Forms.Label(); this.labelRX = new System.Windows.Forms.Label(); this.labelLY = new System.Windows.Forms.Label(); this.labelRY = new System.Windows.Forms.Label(); + this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.label3 = new System.Windows.Forms.Label(); + this.label2 = new System.Windows.Forms.Label(); + this.numericCompensation = new System.Windows.Forms.NumericUpDown(); + this.dropA = new XOutput.MultiLevelComboBox(); + this.dropB = new XOutput.MultiLevelComboBox(); + this.dropX = new XOutput.MultiLevelComboBox(); + this.dropY = new XOutput.MultiLevelComboBox(); + this.dropUp = new XOutput.MultiLevelComboBox(); + this.dropDown = new XOutput.MultiLevelComboBox(); + this.dropLeft = new XOutput.MultiLevelComboBox(); + this.dropRight = new XOutput.MultiLevelComboBox(); + this.dropLT = new XOutput.MultiLevelComboBox(); + this.dropRT = new XOutput.MultiLevelComboBox(); + this.dropLB = new XOutput.MultiLevelComboBox(); + this.dropRB = new XOutput.MultiLevelComboBox(); + this.dropLA = new XOutput.MultiLevelComboBox(); + this.dropRA = new XOutput.MultiLevelComboBox(); + this.dropHome = new XOutput.MultiLevelComboBox(); + this.dropStart = new XOutput.MultiLevelComboBox(); + this.dropBack = new XOutput.MultiLevelComboBox(); + this.dropLY = new XOutput.MultiLevelComboBox(); + this.dropLX = new XOutput.MultiLevelComboBox(); + this.dropRY = new XOutput.MultiLevelComboBox(); + this.dropRX = new XOutput.MultiLevelComboBox(); + this.groupBox1.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.numericCompensation)).BeginInit(); this.SuspendLayout(); // - // labelA - // - this.labelA.AutoSize = true; - this.labelA.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.labelA.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.labelA.Location = new System.Drawing.Point(609, 290); - this.labelA.Name = "labelA"; - this.labelA.Size = new System.Drawing.Size(20, 20); - this.labelA.TabIndex = 0; - this.labelA.Text = "A"; - // - // labelB - // - this.labelB.AutoSize = true; - this.labelB.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.labelB.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.labelB.Location = new System.Drawing.Point(609, 340); - this.labelB.Name = "labelB"; - this.labelB.Size = new System.Drawing.Size(20, 20); - this.labelB.TabIndex = 7; - this.labelB.Text = "B"; - // - // labelX - // - this.labelX.AutoSize = true; - this.labelX.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.labelX.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.labelX.Location = new System.Drawing.Point(609, 390); - this.labelX.Name = "labelX"; - this.labelX.Size = new System.Drawing.Size(20, 20); - this.labelX.TabIndex = 8; - this.labelX.Text = "X"; - // - // labelY - // - this.labelY.AutoSize = true; - this.labelY.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.labelY.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.labelY.Location = new System.Drawing.Point(609, 440); - this.labelY.Name = "labelY"; - this.labelY.Size = new System.Drawing.Size(20, 20); - this.labelY.TabIndex = 9; - this.labelY.Text = "Y"; - // - // labelUp - // - this.labelUp.AutoSize = true; - this.labelUp.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.labelUp.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.labelUp.Location = new System.Drawing.Point(167, 290); - this.labelUp.Name = "labelUp"; - this.labelUp.Size = new System.Drawing.Size(30, 20); - this.labelUp.TabIndex = 14; - this.labelUp.Text = "Up"; - // - // labelDown - // - this.labelDown.AutoSize = true; - this.labelDown.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.labelDown.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.labelDown.Location = new System.Drawing.Point(167, 340); - this.labelDown.Name = "labelDown"; - this.labelDown.Size = new System.Drawing.Size(50, 20); - this.labelDown.TabIndex = 15; - this.labelDown.Text = "Down"; - // - // labelLeft - // - this.labelLeft.AutoSize = true; - this.labelLeft.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.labelLeft.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.labelLeft.Location = new System.Drawing.Point(167, 390); - this.labelLeft.Name = "labelLeft"; - this.labelLeft.Size = new System.Drawing.Size(37, 20); - this.labelLeft.TabIndex = 16; - this.labelLeft.Text = "Left"; - // - // labelRight - // - this.labelRight.AutoSize = true; - this.labelRight.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.labelRight.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.labelRight.Location = new System.Drawing.Point(167, 440); - this.labelRight.Name = "labelRight"; - this.labelRight.Size = new System.Drawing.Size(47, 20); - this.labelRight.TabIndex = 17; - this.labelRight.Text = "Right"; + // labelBack // - // dropRight + this.labelBack.AutoSize = true; + this.labelBack.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.labelBack.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.labelBack.Location = new System.Drawing.Point(335, 25); + this.labelBack.Name = "labelBack"; + this.labelBack.Size = new System.Drawing.Size(45, 20); + this.labelBack.TabIndex = 29; + this.labelBack.Text = "Back"; // - this.dropRight.FormattingEnabled = true; - this.dropRight.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.dropRight.Items.AddRange(new object[] { - ""}); - this.dropRight.Location = new System.Drawing.Point(40, 440); - this.dropRight.Name = "dropRight"; - this.dropRight.Size = new System.Drawing.Size(121, 21); - this.dropRight.TabIndex = 13; + // labelStart // - // dropLeft + this.labelStart.AutoSize = true; + this.labelStart.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.labelStart.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.labelStart.Location = new System.Drawing.Point(777, 25); + this.labelStart.Name = "labelStart"; + this.labelStart.Size = new System.Drawing.Size(44, 20); + this.labelStart.TabIndex = 30; + this.labelStart.Text = "Start"; // - this.dropLeft.FormattingEnabled = true; - this.dropLeft.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.dropLeft.Items.AddRange(new object[] { + // labelHome + // + this.labelHome.AutoSize = true; + this.labelHome.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.labelHome.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.labelHome.Location = new System.Drawing.Point(559, 25); + this.labelHome.Name = "labelHome"; + this.labelHome.Size = new System.Drawing.Size(52, 20); + this.labelHome.TabIndex = 31; + this.labelHome.Text = "Home"; + // + // labelRA + // + this.labelRA.AutoSize = true; + this.labelRA.BackColor = System.Drawing.Color.Transparent; + this.labelRA.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.labelRA.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.labelRA.Location = new System.Drawing.Point(759, 426); + this.labelRA.Name = "labelRA"; + this.labelRA.Size = new System.Drawing.Size(57, 20); + this.labelRA.TabIndex = 38; + this.labelRA.Text = "Button"; + // + // labelLA + // + this.labelLA.AutoSize = true; + this.labelLA.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.labelLA.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.labelLA.Location = new System.Drawing.Point(89, 310); + this.labelLA.Name = "labelLA"; + this.labelLA.Size = new System.Drawing.Size(57, 20); + this.labelLA.TabIndex = 39; + this.labelLA.Text = "Button"; + // + // labelLX + // + this.labelLX.AutoSize = true; + this.labelLX.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.labelLX.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.labelLX.Location = new System.Drawing.Point(126, 339); + this.labelLX.Name = "labelLX"; + this.labelLX.Size = new System.Drawing.Size(20, 20); + this.labelLX.TabIndex = 40; + this.labelLX.Text = "X"; + // + // labelRX + // + this.labelRX.AutoSize = true; + this.labelRX.BackColor = System.Drawing.Color.Transparent; + this.labelRX.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.labelRX.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.labelRX.Location = new System.Drawing.Point(759, 453); + this.labelRX.Name = "labelRX"; + this.labelRX.Size = new System.Drawing.Size(20, 20); + this.labelRX.TabIndex = 41; + this.labelRX.Text = "X"; + // + // labelLY + // + this.labelLY.AutoSize = true; + this.labelLY.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.labelLY.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.labelLY.Location = new System.Drawing.Point(126, 365); + this.labelLY.Name = "labelLY"; + this.labelLY.Size = new System.Drawing.Size(20, 20); + this.labelLY.TabIndex = 42; + this.labelLY.Text = "Y"; + // + // labelRY + // + this.labelRY.AutoSize = true; + this.labelRY.BackColor = System.Drawing.Color.Transparent; + this.labelRY.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.labelRY.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.labelRY.Location = new System.Drawing.Point(759, 480); + this.labelRY.Name = "labelRY"; + this.labelRY.Size = new System.Drawing.Size(20, 20); + this.labelRY.TabIndex = 43; + this.labelRY.Text = "Y"; + // + // groupBox1 + // + this.groupBox1.Controls.Add(this.label3); + this.groupBox1.Controls.Add(this.label2); + this.groupBox1.Controls.Add(this.numericCompensation); + this.groupBox1.Location = new System.Drawing.Point(94, 573); + this.groupBox1.Name = "groupBox1"; + this.groupBox1.Size = new System.Drawing.Size(762, 81); + this.groupBox1.TabIndex = 45; + this.groupBox1.TabStop = false; + this.groupBox1.Text = "Optional"; + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Location = new System.Drawing.Point(17, 50); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(744, 13); + this.label3.TabIndex = 49; + this.label3.Text = "This value will be added/subtracted to/from the Raw value from Left Analog X (Eli" + + "minates initial deadzone in some games and can make for quicker steering)"; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label2.Location = new System.Drawing.Point(123, 27); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(112, 20); + this.label2.TabIndex = 48; + this.label2.Text = "Compensation"; + // + // numericCompensation + // + this.numericCompensation.ImeMode = System.Windows.Forms.ImeMode.Close; + this.numericCompensation.Location = new System.Drawing.Point(20, 27); + this.numericCompensation.Maximum = new decimal(new int[] { + 70, + 0, + 0, + 0}); + this.numericCompensation.Name = "numericCompensation"; + this.numericCompensation.ReadOnly = true; + this.numericCompensation.Size = new System.Drawing.Size(97, 20); + this.numericCompensation.TabIndex = 47; + this.numericCompensation.ValueChanged += new System.EventHandler(this.numericCompensation_ValueChanged); + // + // dropA + // + this.dropA.FormattingEnabled = true; + this.dropA.ImeMode = System.Windows.Forms.ImeMode.NoControl; + this.dropA.Items.AddRange(new object[] { + "", + "", + "", + "", + "", + "", + "", + "", ""}); - this.dropLeft.Location = new System.Drawing.Point(40, 390); - this.dropLeft.Name = "dropLeft"; - this.dropLeft.Size = new System.Drawing.Size(121, 21); - this.dropLeft.TabIndex = 12; + this.dropA.Location = new System.Drawing.Point(717, 380); + this.dropA.Name = "dropA"; + this.dropA.Size = new System.Drawing.Size(121, 21); + this.dropA.TabIndex = 3; // - // dropDown + // dropB // - this.dropDown.FormattingEnabled = true; - this.dropDown.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.dropDown.Items.AddRange(new object[] { + this.dropB.FormattingEnabled = true; + this.dropB.ImeMode = System.Windows.Forms.ImeMode.NoControl; + this.dropB.Items.AddRange(new object[] { + "", + "", + "", + "", + "", + "", + "", + "", ""}); - this.dropDown.Location = new System.Drawing.Point(40, 340); - this.dropDown.Name = "dropDown"; - this.dropDown.Size = new System.Drawing.Size(121, 21); - this.dropDown.TabIndex = 11; + this.dropB.Location = new System.Drawing.Point(780, 313); + this.dropB.Name = "dropB"; + this.dropB.Size = new System.Drawing.Size(121, 21); + this.dropB.TabIndex = 4; // - // dropUp + // dropX // - this.dropUp.FormattingEnabled = true; - this.dropUp.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.dropUp.Items.AddRange(new object[] { + this.dropX.FormattingEnabled = true; + this.dropX.ImeMode = System.Windows.Forms.ImeMode.NoControl; + this.dropX.Items.AddRange(new object[] { + "", + "", + "", + "", + "", + "", + "", + "", ""}); - this.dropUp.Location = new System.Drawing.Point(40, 290); - this.dropUp.Name = "dropUp"; - this.dropUp.Size = new System.Drawing.Size(121, 21); - this.dropUp.TabIndex = 10; + this.dropX.Location = new System.Drawing.Point(613, 338); + this.dropX.Name = "dropX"; + this.dropX.Size = new System.Drawing.Size(121, 21); + this.dropX.TabIndex = 5; // // dropY // this.dropY.FormattingEnabled = true; this.dropY.ImeMode = System.Windows.Forms.ImeMode.NoControl; this.dropY.Items.AddRange(new object[] { + "", + "", + "", + "", + "", + "", + "", + "", ""}); - this.dropY.Location = new System.Drawing.Point(482, 440); + this.dropY.Location = new System.Drawing.Point(717, 252); this.dropY.Name = "dropY"; this.dropY.Size = new System.Drawing.Size(121, 21); this.dropY.TabIndex = 6; // - // dropX + // dropUp // - this.dropX.FormattingEnabled = true; - this.dropX.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.dropX.Items.AddRange(new object[] { + this.dropUp.FormattingEnabled = true; + this.dropUp.ImeMode = System.Windows.Forms.ImeMode.NoControl; + this.dropUp.Items.AddRange(new object[] { + "", + "", + "", + "", + "", + "", + "", + "", ""}); - this.dropX.Location = new System.Drawing.Point(482, 390); - this.dropX.Name = "dropX"; - this.dropX.Size = new System.Drawing.Size(121, 21); - this.dropX.TabIndex = 5; + this.dropUp.Location = new System.Drawing.Point(337, 389); + this.dropUp.Name = "dropUp"; + this.dropUp.Size = new System.Drawing.Size(121, 21); + this.dropUp.TabIndex = 10; // - // dropB + // dropDown // - this.dropB.FormattingEnabled = true; - this.dropB.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.dropB.Items.AddRange(new object[] { + this.dropDown.FormattingEnabled = true; + this.dropDown.ImeMode = System.Windows.Forms.ImeMode.NoControl; + this.dropDown.Items.AddRange(new object[] { + "", + "", + "", + "", + "", + "", + "", + "", ""}); - this.dropB.Location = new System.Drawing.Point(482, 340); - this.dropB.Name = "dropB"; - this.dropB.Size = new System.Drawing.Size(121, 21); - this.dropB.TabIndex = 4; + this.dropDown.Location = new System.Drawing.Point(337, 466); + this.dropDown.Name = "dropDown"; + this.dropDown.Size = new System.Drawing.Size(121, 21); + this.dropDown.TabIndex = 11; // - // dropA + // dropLeft // - this.dropA.FormattingEnabled = true; - this.dropA.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.dropA.Items.AddRange(new object[] { + this.dropLeft.FormattingEnabled = true; + this.dropLeft.ImeMode = System.Windows.Forms.ImeMode.NoControl; + this.dropLeft.Items.AddRange(new object[] { + "", + "", + "", + "", + "", + "", + "", + "", ""}); - this.dropA.Location = new System.Drawing.Point(482, 290); - this.dropA.Name = "dropA"; - this.dropA.Size = new System.Drawing.Size(121, 21); - this.dropA.TabIndex = 3; + this.dropLeft.Location = new System.Drawing.Point(251, 426); + this.dropLeft.Name = "dropLeft"; + this.dropLeft.Size = new System.Drawing.Size(121, 21); + this.dropLeft.TabIndex = 12; // - // dropRT + // dropRight // - this.dropRT.FormattingEnabled = true; - this.dropRT.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.dropRT.Items.AddRange(new object[] { + this.dropRight.FormattingEnabled = true; + this.dropRight.ImeMode = System.Windows.Forms.ImeMode.NoControl; + this.dropRight.Items.AddRange(new object[] { + "", + "", + "", + "", + "", + "", + "", + "", ""}); - this.dropRT.Location = new System.Drawing.Point(482, 40); - this.dropRT.Name = "dropRT"; - this.dropRT.Size = new System.Drawing.Size(121, 21); - this.dropRT.TabIndex = 18; + this.dropRight.Location = new System.Drawing.Point(407, 426); + this.dropRight.Name = "dropRight"; + this.dropRight.Size = new System.Drawing.Size(121, 21); + this.dropRight.TabIndex = 13; // // dropLT // this.dropLT.FormattingEnabled = true; this.dropLT.ImeMode = System.Windows.Forms.ImeMode.NoControl; this.dropLT.Items.AddRange(new object[] { + "", + "", + "", + "", + "", + "", + "", + "", ""}); - this.dropLT.Location = new System.Drawing.Point(40, 40); + this.dropLT.Location = new System.Drawing.Point(259, 103); this.dropLT.Name = "dropLT"; this.dropLT.Size = new System.Drawing.Size(121, 21); this.dropLT.TabIndex = 19; // - // dropRB + // dropRT // - this.dropRB.FormattingEnabled = true; - this.dropRB.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.dropRB.Items.AddRange(new object[] { + this.dropRT.FormattingEnabled = true; + this.dropRT.ImeMode = System.Windows.Forms.ImeMode.NoControl; + this.dropRT.Items.AddRange(new object[] { + "", + "", + "", + "", + "", + "", + "", + "", ""}); - this.dropRB.Location = new System.Drawing.Point(482, 90); - this.dropRB.Name = "dropRB"; - this.dropRB.Size = new System.Drawing.Size(121, 21); - this.dropRB.TabIndex = 20; + this.dropRT.Location = new System.Drawing.Point(632, 103); + this.dropRT.Name = "dropRT"; + this.dropRT.Size = new System.Drawing.Size(121, 21); + this.dropRT.TabIndex = 18; // // dropLB // this.dropLB.FormattingEnabled = true; this.dropLB.ImeMode = System.Windows.Forms.ImeMode.NoControl; this.dropLB.Items.AddRange(new object[] { + "", + "", + "", + "", + "", + "", + "", + "", ""}); - this.dropLB.Location = new System.Drawing.Point(40, 90); + this.dropLB.Location = new System.Drawing.Point(161, 189); this.dropLB.Name = "dropLB"; this.dropLB.Size = new System.Drawing.Size(121, 21); this.dropLB.TabIndex = 21; // - // dropBack - // - this.dropBack.FormattingEnabled = true; - this.dropBack.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.dropBack.Items.AddRange(new object[] { - ""}); - this.dropBack.Location = new System.Drawing.Point(40, 490); - this.dropBack.Name = "dropBack"; - this.dropBack.Size = new System.Drawing.Size(121, 21); - this.dropBack.TabIndex = 22; - // - // dropStart + // dropRB // - this.dropStart.FormattingEnabled = true; - this.dropStart.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.dropStart.Items.AddRange(new object[] { + this.dropRB.FormattingEnabled = true; + this.dropRB.ImeMode = System.Windows.Forms.ImeMode.NoControl; + this.dropRB.Items.AddRange(new object[] { + "", + "", + "", + "", + "", + "", + "", + "", ""}); - this.dropStart.Location = new System.Drawing.Point(482, 490); - this.dropStart.Name = "dropStart"; - this.dropStart.Size = new System.Drawing.Size(121, 21); - this.dropStart.TabIndex = 23; + this.dropRB.Location = new System.Drawing.Point(717, 189); + this.dropRB.Name = "dropRB"; + this.dropRB.Size = new System.Drawing.Size(121, 21); + this.dropRB.TabIndex = 20; // - // dropHome + // dropLA // - this.dropHome.FormattingEnabled = true; - this.dropHome.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.dropHome.Items.AddRange(new object[] { + this.dropLA.FormattingEnabled = true; + this.dropLA.ImeMode = System.Windows.Forms.ImeMode.NoControl; + this.dropLA.Items.AddRange(new object[] { + "", + "", + "", + "", + "", + "", + "", + "", ""}); - this.dropHome.Location = new System.Drawing.Point(264, 490); - this.dropHome.Name = "dropHome"; - this.dropHome.Size = new System.Drawing.Size(121, 21); - this.dropHome.TabIndex = 24; - // - // labelRT - // - this.labelRT.AutoSize = true; - this.labelRT.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.labelRT.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.labelRT.Location = new System.Drawing.Point(609, 40); - this.labelRT.Name = "labelRT"; - this.labelRT.Size = new System.Drawing.Size(100, 20); - this.labelRT.TabIndex = 25; - this.labelRT.Text = "Right Trigger"; - // - // labelLT - // - this.labelLT.AutoSize = true; - this.labelLT.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.labelLT.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.labelLT.Location = new System.Drawing.Point(167, 40); - this.labelLT.Name = "labelLT"; - this.labelLT.Size = new System.Drawing.Size(90, 20); - this.labelLT.TabIndex = 26; - this.labelLT.Text = "Left Trigger"; - // - // labelRB - // - this.labelRB.AutoSize = true; - this.labelRB.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.labelRB.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.labelRB.Location = new System.Drawing.Point(609, 90); - this.labelRB.Name = "labelRB"; - this.labelRB.Size = new System.Drawing.Size(107, 20); - this.labelRB.TabIndex = 27; - this.labelRB.Text = "Right Bumper"; - // - // labelLB - // - this.labelLB.AutoSize = true; - this.labelLB.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.labelLB.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.labelLB.Location = new System.Drawing.Point(167, 90); - this.labelLB.Name = "labelLB"; - this.labelLB.Size = new System.Drawing.Size(97, 20); - this.labelLB.TabIndex = 28; - this.labelLB.Text = "Left Bumper"; - // - // labelBack - // - this.labelBack.AutoSize = true; - this.labelBack.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.labelBack.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.labelBack.Location = new System.Drawing.Point(167, 490); - this.labelBack.Name = "labelBack"; - this.labelBack.Size = new System.Drawing.Size(45, 20); - this.labelBack.TabIndex = 29; - this.labelBack.Text = "Back"; - // - // labelStart - // - this.labelStart.AutoSize = true; - this.labelStart.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.labelStart.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.labelStart.Location = new System.Drawing.Point(609, 490); - this.labelStart.Name = "labelStart"; - this.labelStart.Size = new System.Drawing.Size(44, 20); - this.labelStart.TabIndex = 30; - this.labelStart.Text = "Start"; - // - // labelHome - // - this.labelHome.AutoSize = true; - this.labelHome.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.labelHome.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.labelHome.Location = new System.Drawing.Point(391, 490); - this.labelHome.Name = "labelHome"; - this.labelHome.Size = new System.Drawing.Size(52, 20); - this.labelHome.TabIndex = 31; - this.labelHome.Text = "Home"; + this.dropLA.Location = new System.Drawing.Point(152, 310); + this.dropLA.Name = "dropLA"; + this.dropLA.Size = new System.Drawing.Size(121, 21); + this.dropLA.TabIndex = 33; // // dropRA // this.dropRA.FormattingEnabled = true; this.dropRA.ImeMode = System.Windows.Forms.ImeMode.NoControl; this.dropRA.Items.AddRange(new object[] { + "", + "", + "", + "", + "", + "", + "", + "", ""}); - this.dropRA.Location = new System.Drawing.Point(482, 140); + this.dropRA.Location = new System.Drawing.Point(632, 426); this.dropRA.Name = "dropRA"; this.dropRA.Size = new System.Drawing.Size(121, 21); this.dropRA.TabIndex = 32; // - // dropLA - // - this.dropLA.FormattingEnabled = true; - this.dropLA.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.dropLA.Items.AddRange(new object[] { - ""}); - this.dropLA.Location = new System.Drawing.Point(40, 140); - this.dropLA.Name = "dropLA"; - this.dropLA.Size = new System.Drawing.Size(121, 21); - this.dropLA.TabIndex = 33; - // - // dropRX + // dropHome // - this.dropRX.FormattingEnabled = true; - this.dropRX.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.dropRX.Items.AddRange(new object[] { + this.dropHome.FormattingEnabled = true; + this.dropHome.ImeMode = System.Windows.Forms.ImeMode.NoControl; + this.dropHome.Items.AddRange(new object[] { + "", + "", + "", + "", + "", + "", + "", + "", ""}); - this.dropRX.Location = new System.Drawing.Point(482, 190); - this.dropRX.Name = "dropRX"; - this.dropRX.Size = new System.Drawing.Size(121, 21); - this.dropRX.TabIndex = 34; + this.dropHome.Location = new System.Drawing.Point(432, 25); + this.dropHome.Name = "dropHome"; + this.dropHome.Size = new System.Drawing.Size(121, 21); + this.dropHome.TabIndex = 24; // - // dropRY + // dropStart // - this.dropRY.FormattingEnabled = true; - this.dropRY.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.dropRY.Items.AddRange(new object[] { + this.dropStart.FormattingEnabled = true; + this.dropStart.ImeMode = System.Windows.Forms.ImeMode.NoControl; + this.dropStart.Items.AddRange(new object[] { + "", + "", + "", + "", + "", + "", + "", + "", ""}); - this.dropRY.Location = new System.Drawing.Point(482, 240); - this.dropRY.Name = "dropRY"; - this.dropRY.Size = new System.Drawing.Size(121, 21); - this.dropRY.TabIndex = 35; + this.dropStart.Location = new System.Drawing.Point(650, 25); + this.dropStart.Name = "dropStart"; + this.dropStart.Size = new System.Drawing.Size(121, 21); + this.dropStart.TabIndex = 23; // - // dropLX + // dropBack // - this.dropLX.FormattingEnabled = true; - this.dropLX.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.dropLX.Items.AddRange(new object[] { + this.dropBack.FormattingEnabled = true; + this.dropBack.ImeMode = System.Windows.Forms.ImeMode.NoControl; + this.dropBack.Items.AddRange(new object[] { + "", + "", + "", + "", + "", + "", + "", + "", ""}); - this.dropLX.Location = new System.Drawing.Point(40, 190); - this.dropLX.Name = "dropLX"; - this.dropLX.Size = new System.Drawing.Size(121, 21); - this.dropLX.TabIndex = 36; + this.dropBack.Location = new System.Drawing.Point(208, 25); + this.dropBack.Name = "dropBack"; + this.dropBack.Size = new System.Drawing.Size(121, 21); + this.dropBack.TabIndex = 22; // // dropLY // this.dropLY.FormattingEnabled = true; this.dropLY.ImeMode = System.Windows.Forms.ImeMode.NoControl; this.dropLY.Items.AddRange(new object[] { + "", + "", + "", + "", + "", + "", + "", + "", ""}); - this.dropLY.Location = new System.Drawing.Point(40, 240); + this.dropLY.Location = new System.Drawing.Point(152, 364); this.dropLY.Name = "dropLY"; this.dropLY.Size = new System.Drawing.Size(121, 21); this.dropLY.TabIndex = 37; // - // labelRA - // - this.labelRA.AutoSize = true; - this.labelRA.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.labelRA.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.labelRA.Location = new System.Drawing.Point(609, 140); - this.labelRA.Name = "labelRA"; - this.labelRA.Size = new System.Drawing.Size(153, 20); - this.labelRA.TabIndex = 38; - this.labelRA.Text = "Right Analog Button"; - // - // labelLA - // - this.labelLA.AutoSize = true; - this.labelLA.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.labelLA.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.labelLA.Location = new System.Drawing.Point(167, 140); - this.labelLA.Name = "labelLA"; - this.labelLA.Size = new System.Drawing.Size(143, 20); - this.labelLA.TabIndex = 39; - this.labelLA.Text = "Left Analog Button"; - // - // labelLX - // - this.labelLX.AutoSize = true; - this.labelLX.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.labelLX.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.labelLX.Location = new System.Drawing.Point(167, 190); - this.labelLX.Name = "labelLX"; - this.labelLX.Size = new System.Drawing.Size(106, 20); - this.labelLX.TabIndex = 40; - this.labelLX.Text = "Left Analog X"; - // - // labelRX + // dropLX // - this.labelRX.AutoSize = true; - this.labelRX.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.labelRX.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.labelRX.Location = new System.Drawing.Point(609, 190); - this.labelRX.Name = "labelRX"; - this.labelRX.Size = new System.Drawing.Size(116, 20); - this.labelRX.TabIndex = 41; - this.labelRX.Text = "Right Analog X"; + this.dropLX.FormattingEnabled = true; + this.dropLX.ImeMode = System.Windows.Forms.ImeMode.NoControl; + this.dropLX.Items.AddRange(new object[] { + "", + "", + "", + "", + "", + "", + "", + "", + ""}); + this.dropLX.Location = new System.Drawing.Point(152, 337); + this.dropLX.Name = "dropLX"; + this.dropLX.Size = new System.Drawing.Size(121, 21); + this.dropLX.TabIndex = 36; // - // labelLY + // dropRY // - this.labelLY.AutoSize = true; - this.labelLY.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.labelLY.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.labelLY.Location = new System.Drawing.Point(167, 240); - this.labelLY.Name = "labelLY"; - this.labelLY.Size = new System.Drawing.Size(106, 20); - this.labelLY.TabIndex = 42; - this.labelLY.Text = "Left Analog Y"; + this.dropRY.FormattingEnabled = true; + this.dropRY.ImeMode = System.Windows.Forms.ImeMode.NoControl; + this.dropRY.Items.AddRange(new object[] { + "", + "", + "", + "", + "", + "", + "", + "", + ""}); + this.dropRY.Location = new System.Drawing.Point(632, 480); + this.dropRY.Name = "dropRY"; + this.dropRY.Size = new System.Drawing.Size(121, 21); + this.dropRY.TabIndex = 35; // - // labelRY + // dropRX // - this.labelRY.AutoSize = true; - this.labelRY.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.labelRY.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.labelRY.Location = new System.Drawing.Point(609, 240); - this.labelRY.Name = "labelRY"; - this.labelRY.Size = new System.Drawing.Size(116, 20); - this.labelRY.TabIndex = 43; - this.labelRY.Text = "Right Analog Y"; + this.dropRX.FormattingEnabled = true; + this.dropRX.ImeMode = System.Windows.Forms.ImeMode.NoControl; + this.dropRX.Items.AddRange(new object[] { + "", + "", + "", + "", + "", + "", + "", + "", + ""}); + this.dropRX.Location = new System.Drawing.Point(632, 453); + this.dropRX.Name = "dropRX"; + this.dropRX.Size = new System.Drawing.Size(121, 21); + this.dropRX.TabIndex = 34; // // ControllerOptions // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(814, 561); + this.BackgroundImage = global::XOutput.Properties.Resources.xbox360controller; + this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center; + this.ClientSize = new System.Drawing.Size(1008, 661); + this.Controls.Add(this.groupBox1); this.Controls.Add(this.labelRY); this.Controls.Add(this.labelLY); this.Controls.Add(this.labelRX); @@ -549,18 +632,6 @@ private void InitializeComponent() this.Controls.Add(this.labelHome); this.Controls.Add(this.labelStart); this.Controls.Add(this.labelBack); - this.Controls.Add(this.labelLB); - this.Controls.Add(this.labelRB); - this.Controls.Add(this.labelLT); - this.Controls.Add(this.labelRT); - this.Controls.Add(this.labelRight); - this.Controls.Add(this.labelLeft); - this.Controls.Add(this.labelDown); - this.Controls.Add(this.labelUp); - this.Controls.Add(this.labelY); - this.Controls.Add(this.labelX); - this.Controls.Add(this.labelB); - this.Controls.Add(this.labelA); this.Controls.Add(this.dropA); this.Controls.Add(this.dropB); this.Controls.Add(this.dropX); @@ -582,36 +653,31 @@ private void InitializeComponent() this.Controls.Add(this.dropLX); this.Controls.Add(this.dropRY); this.Controls.Add(this.dropRX); + this.DoubleBuffered = true; this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; - this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.MaximizeBox = false; this.MinimizeBox = false; this.Name = "ControllerOptions"; + this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide; this.Text = "Controller Options"; this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.onClose); + this.groupBox1.ResumeLayout(false); + this.groupBox1.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.numericCompensation)).EndInit(); this.ResumeLayout(false); this.PerformLayout(); } #endregion - - private System.Windows.Forms.Label labelA; private MultiLevelComboBox dropA; private MultiLevelComboBox dropB; private MultiLevelComboBox dropX; private MultiLevelComboBox dropY; - private System.Windows.Forms.Label labelB; - private System.Windows.Forms.Label labelX; - private System.Windows.Forms.Label labelY; private MultiLevelComboBox dropUp; private MultiLevelComboBox dropDown; private MultiLevelComboBox dropLeft; private MultiLevelComboBox dropRight; - private System.Windows.Forms.Label labelUp; - private System.Windows.Forms.Label labelDown; - private System.Windows.Forms.Label labelLeft; - private System.Windows.Forms.Label labelRight; private MultiLevelComboBox dropRT; private MultiLevelComboBox dropLT; private MultiLevelComboBox dropRB; @@ -619,10 +685,6 @@ private void InitializeComponent() private MultiLevelComboBox dropBack; private MultiLevelComboBox dropStart; private MultiLevelComboBox dropHome; - private System.Windows.Forms.Label labelRT; - private System.Windows.Forms.Label labelLT; - private System.Windows.Forms.Label labelRB; - private System.Windows.Forms.Label labelLB; private System.Windows.Forms.Label labelBack; private System.Windows.Forms.Label labelStart; private System.Windows.Forms.Label labelHome; @@ -638,6 +700,9 @@ private void InitializeComponent() private System.Windows.Forms.Label labelRX; private System.Windows.Forms.Label labelLY; private System.Windows.Forms.Label labelRY; - + private System.Windows.Forms.GroupBox groupBox1; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.NumericUpDown numericCompensation; } } \ No newline at end of file diff --git a/XOutput/ControllerOptions.cs b/XOutput/ControllerOptions.cs index 80eaff0..3c4d68a 100644 --- a/XOutput/ControllerOptions.cs +++ b/XOutput/ControllerOptions.cs @@ -8,20 +8,20 @@ namespace XOutput public partial class ControllerOptions : Form { ControllerDevice dev; - private Thread detectThread; public ControllerOptions(ControllerDevice device) { InitializeComponent(); dev = device; int ind = 0; - foreach (MultiLevelComboBox m in this.Controls.OfType()) { + foreach (MultiLevelComboBox m in this.Controls.OfType()) + { //Tag structure: [Type, Number, Index] m.Items[0] = getBindingText(ind); //Change combobox text according to saved binding m.addOption("Disabled", tag: new byte[] { 255, 0, (byte)ind }); - m.addOption("Detect", - tag: new byte[] { 254, 0, (byte)ind }); + //m.addOption("Detect", + // tag: new byte[] { 254, 0, (byte)ind }); ToolStripMenuItem axes = m.addMenu("Axes"); ToolStripMenuItem buttons = m.addMenu("Buttons"); ToolStripMenuItem dpads = m.addMenu("D-Pads"); @@ -44,27 +44,45 @@ public ControllerOptions(ControllerDevice device) m.addOption("D-Pad " + i.ToString() + " Right", dpads, new byte[] { 35, (byte)(i - 1), (byte)ind }); } - for (int i = 1; i <= dev.joystick.Capabilities.AxesCount; i++) + for (int i = 0; i <= dev.analogs.Length - 1; i++) { - m.addOption("Axis " + i.ToString(), axes, - new byte[] { 16, (byte)(i - 1), (byte)ind }); - m.addOption("IAxis " + i.ToString(), iaxes, - new byte[] { 17, (byte)(i - 1), (byte)ind }); - m.addOption("HAxis" + i.ToString(), haxes, - new byte[] { 18, (byte)(i - 1), (byte)ind }); - m.addOption("IHAxis" + i.ToString(), ihaxes, - new byte[] { 19, (byte)(i - 1), (byte)ind }); + if (dev.analogs[i] != 0) + { + int ii = i + 1; + + m.addOption("Axis " + ii.ToString(), axes, + new byte[] { 16, (byte)(i), (byte)ind }); + m.addOption("IAxis " + ii.ToString(), iaxes, + new byte[] { 17, (byte)(i), (byte)ind }); + m.addOption("HAxis" + ii.ToString(), haxes, + new byte[] { 18, (byte)(i), (byte)ind }); + m.addOption("IHAxis" + ii.ToString(), ihaxes, + new byte[] { 19, (byte)(i), (byte)ind }); + } + } m.SelectionChangeCommitted += new System.EventHandler(SelectionChanged); ind++; } + + this.numericCompensation.Tag = new byte[] { 253, (byte)(0), (byte)ind }; + + int outVal = 0; + int.TryParse(getBindingText(ind), out outVal); + + this.numericCompensation.Value = outVal > 0 ? (outVal) : 0; } private string getBindingText(int i) { - if (dev.mapping[i * 2] == 255) { + if (dev.mapping[i * 2] == 255) + { return "Disabled"; } + else if (dev.mapping[i * 2] == 253) + { + return (dev.mapping[((i * 2) + 1)].ToString()); + } byte subType = (byte)(dev.mapping[i * 2] & 0x0F); byte type = (byte)((dev.mapping[i * 2] & 0xF0) >> 4); byte num = (byte)(dev.mapping[(i * 2) + 1] + 1); @@ -74,10 +92,12 @@ private string getBindingText(int i) return string.Format(typeString[type], num, axesString[subType], dpadString[subType]); } - private void SelectionChanged(object sender, EventArgs e) { + private void SelectionChanged(object sender, EventArgs e) + { ToolStripMenuItem i = (ToolStripMenuItem)sender; byte[] b = (byte[])i.Tag; - if (b[0] == 254) { + if (b[0] == 254) + { //start thread return; } @@ -86,9 +106,18 @@ private void SelectionChanged(object sender, EventArgs e) { dev.Save(); } - private void onClose(object sender, EventArgs e) { + private void onClose(object sender, EventArgs e) + { dev.Save(); } + private void numericCompensation_ValueChanged(object sender, EventArgs e) + { + NumericUpDown i = (NumericUpDown)sender; + byte[] b = (byte[])i.Tag; + dev.mapping[b[2] * 2] = b[0]; + dev.mapping[(b[2] * 2) + 1] = (byte)(i.Value); + dev.Save(); + } } } diff --git a/XOutput/ControllerOptions.resx b/XOutput/ControllerOptions.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/XOutput/ControllerOptions.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + \ No newline at end of file diff --git a/XOutput/Properties/AssemblyInfo.cs b/XOutput/Properties/AssemblyInfo.cs index 2e66c32..4eefa7e 100644 --- a/XOutput/Properties/AssemblyInfo.cs +++ b/XOutput/Properties/AssemblyInfo.cs @@ -6,9 +6,9 @@ // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("XOutput")] -[assembly: AssemblyDescription("")] +[assembly: AssemblyDescription("Base by Eric Barrett, Tweaked by API (All via GitHub)")] [assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Eric Barrett")] +[assembly: AssemblyCompany("")] [assembly: AssemblyProduct("XOutput")] [assembly: AssemblyCopyright("Copyright © Eric Barrett 2014")] [assembly: AssemblyTrademark("")] diff --git a/XOutput/Properties/Resources.Designer.cs b/XOutput/Properties/Resources.Designer.cs index 5029fc7..85d1a8d 100644 --- a/XOutput/Properties/Resources.Designer.cs +++ b/XOutput/Properties/Resources.Designer.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.34014 +// Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -89,5 +89,15 @@ internal static System.Drawing.Bitmap gear { return ((System.Drawing.Bitmap)(obj)); } } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap xbox360controller { + get { + object obj = ResourceManager.GetObject("xbox360controller", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } } } diff --git a/XOutput/Properties/Resources.resx b/XOutput/Properties/Resources.resx index 734caf8..1a56d65 100644 --- a/XOutput/Properties/Resources.resx +++ b/XOutput/Properties/Resources.resx @@ -118,13 +118,16 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - ..\Resources\arrow_Down.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - ..\Resources\arrow_Up.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\arrow_Down.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\Resources\gear.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\xbox360controller.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + \ No newline at end of file diff --git a/XOutput/Resources/xbox360controller.png b/XOutput/Resources/xbox360controller.png new file mode 100644 index 0000000..f487e28 Binary files /dev/null and b/XOutput/Resources/xbox360controller.png differ diff --git a/XOutput/SaveManager.cs b/XOutput/SaveManager.cs index 90dc5e1..fb3b594 100644 --- a/XOutput/SaveManager.cs +++ b/XOutput/SaveManager.cs @@ -1,5 +1,6 @@ using System; using System.IO; +using System.Linq; namespace XOutput { @@ -7,17 +8,17 @@ static class SaveManager { static string[] properties = new string[] {"button_a", "button_b", "button_x", "button_y", "dpad_up", "dpad_down", "dpad_left", "dpad_right", "left_trigger", "right_trigger", "left_bumper", "right_bumper", "left_axebutton", "right_axebutton", - "home", "start", "back", "left_y", "left_x", "right_y", "right_x"}; + "home", "start", "back", "left_y", "left_x", "right_y", "right_x", "compensation"}; static private string dirName = @"configs"; - private static byte[] parseLine(string line) { //This needs better error hadnling + private static byte[] parseLine(string line) { //This needs better error handling int i; //The index of the control in the map array byte type = 255, subType = 255, num = 255; - for (i = 0; i < 21; i++) { //find which button this is for + for (i = 0; i < 22; i++) { //find which button this is for if (line.StartsWith(properties[i])) { break; } - if (i == 20) { + if (i > 20) { Logger.Log("Error parsing: Could not identify property"); return new byte[] { 255, 255, 255}; } @@ -27,6 +28,7 @@ private static byte[] parseLine(string line) { //This needs better error hadnlin return new byte[] { 255, 255, 255 }; } string val = line.Remove(0, properties[i].Length + 1); //remove up to the = sign + int thisNumericValue = 0; if (val.StartsWith("btn")) { type = 0; subType = 0; @@ -63,6 +65,9 @@ private static byte[] parseLine(string line) { //This needs better error hadnlin num = byte.Parse(val.Remove(val.Length - 5)); } } else if (val == "disabled") { + } else if(int.TryParse(val, out thisNumericValue)){ + subType = 253; + num = (byte)(thisNumericValue + 1); } else { Logger.Log("Error parsing: Could not identify value"); return new byte[] { 255, 255, 255 }; @@ -77,17 +82,18 @@ public static byte[] Load(string devName) { Directory.CreateDirectory(dirName); return null; } - string path = dirName + "\\" + devName + ".ini"; + + string path = dirName + "\\" + removeInvalidFileNameChars(devName) + ".ini"; if (!File.Exists(path)) { File.Create(path); return null; } - byte[] mapping = new byte[42]; + byte[] mapping = new byte[44]; string[] config = File.ReadAllLines(path); for (int i = 0; i < config.Length; i++) { byte[] data = parseLine(config[i]); Console.Write(data[0]); - if (data[0] > 40) { + if (data[0] > 42) { continue; } mapping[data[0]] = data[1]; @@ -100,24 +106,40 @@ public static void Save(string devName, byte[] mapping) { if (!Directory.Exists(dirName)) { Directory.CreateDirectory(dirName); } - string path = dirName + "\\" + devName + ".ini"; + + string path = dirName + "\\" + removeInvalidFileNameChars(devName) + ".ini"; if (!File.Exists(path)) { File.Create(path); } File.WriteAllText(path, generateSaveString(mapping)); } + private static string removeInvalidFileNameChars(string proposedFileName) + { + var invalidChars = Path.GetInvalidFileNameChars(); + + string invalidCharsRemoved = new string(proposedFileName + .Where(x => !invalidChars.Contains(x)) + .ToArray()); + + return invalidCharsRemoved; + } + private static string generateSaveString(byte[] Mapping) { string[] typeString = new string[] { "btn{0}", "{1}axis{0}", "dpad{0}{2}" }; string[] axesString = new string[] { "", "i", "h", "ih" }; string[] dpadString = new string[] { "up", "down", "left", "right" }; string saveString = ""; - for (int i = 0; i < 21; i++) { + for (int i = 0; i < 22; i++) { saveString += properties[i] + "="; if (Mapping[i * 2] == 255) { saveString += "disabled\r\n"; continue; + }else if (Mapping[i * 2] == 253) + { + saveString += ((byte)Mapping[i * 2 + 1]).ToString() + "\r\n"; + continue; } byte subType = (byte)(Mapping[i * 2] & 0x0F); byte type = (byte)((Mapping[i * 2] & 0xF0) >> 4); diff --git a/XOutput/XOutput.csproj b/XOutput/XOutput.csproj index 95d01ce..f2590bd 100644 --- a/XOutput/XOutput.csproj +++ b/XOutput/XOutput.csproj @@ -100,6 +100,9 @@ XOut.cs + + ControllerOptions.cs + ResXFileCodeGenerator Resources.Designer.cs @@ -112,6 +115,7 @@ XOut.cs + Designer SettingsSingleFileGenerator @@ -153,6 +157,7 @@ +