From 8ae6e062e33927e3ef7980b87ab507c0afef3b9c Mon Sep 17 00:00:00 2001 From: Travis Nickles Date: Fri, 4 Aug 2017 22:36:46 -0500 Subject: [PATCH] Add experimental touchpad invert disable routine. Raise mouse stick offset --- DS4Windows/DS4Control/Mapping.cs | 2 +- DS4Windows/DS4Control/Mouse.cs | 30 +-- DS4Windows/DS4Control/MouseCursor.cs | 33 +-- DS4Windows/DS4Control/ScpUtil.cs | 61 +++-- DS4Windows/DS4Forms/Options.Designer.cs | 221 +++++++++++++++ DS4Windows/DS4Forms/Options.cs | 344 ++++++++---------------- DS4Windows/DS4Forms/Options.resx | 334 +++++++++++++++++++++-- 7 files changed, 715 insertions(+), 310 deletions(-) diff --git a/DS4Windows/DS4Control/Mapping.cs b/DS4Windows/DS4Control/Mapping.cs index e8ece59..a6ad651 100644 --- a/DS4Windows/DS4Control/Mapping.cs +++ b/DS4Windows/DS4Control/Mapping.cs @@ -146,7 +146,7 @@ namespace DS4Windows public static int prevmouseaccel = 0; private static double horizontalRemainder = 0.0, verticalRemainder = 0.0; private const int MOUSESPEEDFACTOR = 30; - private const double MOUSESTICKOFFSET = 0.03; + private const double MOUSESTICKOFFSET = 0.032; public static void Commit(int device) { diff --git a/DS4Windows/DS4Control/Mouse.cs b/DS4Windows/DS4Control/Mouse.cs index 10c900b..87f7905 100644 --- a/DS4Windows/DS4Control/Mouse.cs +++ b/DS4Windows/DS4Control/Mouse.cs @@ -48,8 +48,8 @@ namespace DS4Windows if (!string.IsNullOrEmpty(ss[0])) { string s = string.Empty; - for (int index = 0, arlen = ss.Length; triggeractivated && index < arlen; index++) - //foreach (string s in ss) + for (int index = 0, arlen = ss.Length; + triggeractivated && index < arlen; index++) { s = ss[index]; if (!(int.TryParse(s, out i) && getDS4ControlsByName(i))) @@ -65,8 +65,6 @@ namespace DS4Windows cursor.sixaxisMoved(arg); else cursor.mouseRemainderReset(); - - //dev.getCurrentState(s); } } @@ -100,11 +98,22 @@ namespace DS4Windows return false; } + private bool tempBool = false; public virtual void touchesMoved(object sender, TouchpadEventArgs arg) { - if (!Global.UseTPforControls[deviceNum]) + s = dev.getCurrentStateRef(); + + if (Global.getUseTPforControls(deviceNum) == false) { - cursor.touchesMoved(arg, dragging || dragging2); + int[] disArray = Global.getTouchDisInvertTriggers(deviceNum); + tempBool = true; + for (int i = 0, arlen = disArray.Length; tempBool && i < arlen; i++) + { + if (getDS4ControlsByName(disArray[i]) == false) + tempBool = false; + } + + cursor.touchesMoved(arg, dragging || dragging2, tempBool); wheel.touchesMoved(arg, dragging || dragging2); } else @@ -131,8 +140,6 @@ namespace DS4Windows slideleft = true; } - s = dev.getCurrentStateRef(); - //dev.getCurrentState(s); synthesizeMouseButtons(); } @@ -155,7 +162,6 @@ namespace DS4Windows } s = dev.getCurrentStateRef(); - //dev.getCurrentState(s); synthesizeMouseButtons(); } @@ -191,7 +197,6 @@ namespace DS4Windows } s = dev.getCurrentStateRef(); - //dev.getCurrentState(s); synthesizeMouseButtons(); } @@ -208,8 +213,6 @@ namespace DS4Windows public virtual void touchUnchanged(object sender, EventArgs unused) { s = dev.getCurrentStateRef(); - //dev.getCurrentState(s); - //if (s.Touch1 || s.Touch2 || s.TouchButton) synthesizeMouseButtons(); } @@ -260,7 +263,6 @@ namespace DS4Windows } s = remapped; - //remapped.CopyTo(s); } public virtual void touchButtonUp(object sender, TouchpadEventArgs arg) @@ -269,7 +271,6 @@ namespace DS4Windows upperDown = leftDown = rightDown = multiDown = false; dev.setRumble(0, 0); s = dev.getCurrentStateRef(); - //dev.getCurrentState(s); if (s.Touch1 || s.Touch2) synthesizeMouseButtons(); } @@ -292,7 +293,6 @@ namespace DS4Windows } s = dev.getCurrentStateRef(); - //dev.getCurrentState(s); synthesizeMouseButtons(); } diff --git a/DS4Windows/DS4Control/MouseCursor.cs b/DS4Windows/DS4Control/MouseCursor.cs index 98ae266..59a429a 100644 --- a/DS4Windows/DS4Control/MouseCursor.cs +++ b/DS4Windows/DS4Control/MouseCursor.cs @@ -76,7 +76,6 @@ namespace DS4Windows } int deadzone = GYRO_MOUSE_DEADZONE; - //int deadzone = 0; int deadzoneX = (int)System.Math.Abs(normX * deadzone); int deadzoneY = (int)System.Math.Abs(normY * deadzone); @@ -106,6 +105,10 @@ namespace DS4Windows { xMotion += hRemainder; } + else + { + hRemainder = 0.0; + } verticalScale = Global.getGyroSensVerticalScale(deviceNumber) * 0.01; double yMotion = deltaY != 0 ? (coefficient * verticalScale) * (deltaY * tempDouble) @@ -116,6 +119,10 @@ namespace DS4Windows { yMotion += vRemainder; } + else + { + vRemainder = 0.0; + } if (gyroSmooth) { @@ -143,25 +150,18 @@ namespace DS4Windows yMotion = y_out; } + hRemainder = vRemainder = 0.0; if (xMotion != 0.0) { xAction = (int)xMotion; hRemainder = xMotion - xAction; } - else - { - hRemainder = 0.0; - } if (yMotion != 0.0) { yAction = (int)yMotion; vRemainder = yMotion - yAction; } - else - { - vRemainder = 0.0; - } int gyroInvert = Global.getGyroInvert(deviceNumber); if ((gyroInvert & 0x02) == 2) @@ -196,7 +196,7 @@ namespace DS4Windows } private byte lastTouchID; - public void touchesMoved(TouchpadEventArgs arg, bool dragging) + public void touchesMoved(TouchpadEventArgs arg, bool dragging, bool disableInvert = false) { int touchesLen = arg.touches.Length; if ((!dragging && touchesLen != 1) || (dragging && touchesLen < 1)) @@ -304,12 +304,15 @@ namespace DS4Windows int yAction = (int)yMotion; verticalRemainder = yMotion - yAction; - int touchpadInvert = tempInt = Global.getTouchpadInvert(deviceNumber); - if ((touchpadInvert & 0x02) == 2) - xAction *= -1; + if (disableInvert == false) + { + int touchpadInvert = tempInt = Global.getTouchpadInvert(deviceNumber); + if ((touchpadInvert & 0x02) == 2) + xAction *= -1; - if ((touchpadInvert & 0x01) == 1) - yAction *= -1; + if ((touchpadInvert & 0x01) == 1) + yAction *= -1; + } if (yAction != 0 || xAction != 0) InputMethods.MoveCursorBy(xAction, yAction); diff --git a/DS4Windows/DS4Control/ScpUtil.cs b/DS4Windows/DS4Control/ScpUtil.cs index 3fa265c..a94d53b 100644 --- a/DS4Windows/DS4Control/ScpUtil.cs +++ b/DS4Windows/DS4Control/ScpUtil.cs @@ -572,6 +572,12 @@ namespace DS4Windows return m_Config.sATriggers[index]; } + public static int[][] TouchDisInvertTriggers => m_Config.touchDisInvertTriggers; + public static int[] getTouchDisInvertTriggers(int index) + { + return m_Config.touchDisInvertTriggers[index]; + } + public static int[] GyroSensitivity => m_Config.gyroSensitivity; public static int getGyroSensitivity(int index) { @@ -1287,7 +1293,9 @@ namespace DS4Windows public bool[] startTouchpadOff = { false, false, false, false, false }; public bool[] useTPforControls = { false, false, false, false, false }; public bool[] useSAforMouse = { false, false, false, false, false }; - public string[] sATriggers = { "", "", "", "", "" }; + public string[] sATriggers = new string[5] { string.Empty, string.Empty, string.Empty, string.Empty, string.Empty }; + public int[][] touchDisInvertTriggers = new int[5][] { new int[1] { -1 }, new int[1] { -1 }, new int[1] { -1 }, + new int[1] { -1 }, new int[1] { -1 } }; public int[] lsCurve = { 0, 0, 0, 0, 0 }; public int[] rsCurve = { 0, 0, 0, 0, 0 }; public Boolean useExclusiveMode = false; @@ -1305,17 +1313,6 @@ namespace DS4Windows public bool closeMini = false; public List actions = new List(); public List[] ds4settings = { new List(), new List(), new List(), new List(), new List() }; - /*public Dictionary[] customMapKeyTypes = { null, null, null, null, null }; - public Dictionary[] customMapKeys = { null, null, null, null, null }; - public Dictionary[] customMapMacros = { null, null, null, null, null }; - public Dictionary[] customMapButtons = { null, null, null, null, null }; - public Dictionary[] customMapExtras = { null, null, null, null, null }; - - public Dictionary[] shiftCustomMapKeyTypes = { null, null, null, null, null }; - public Dictionary[] shiftCustomMapKeys = { null, null, null, null, null }; - public Dictionary[] shiftCustomMapMacros = { null, null, null, null, null }; - public Dictionary[] shiftCustomMapButtons = { null, null, null, null, null }; - public Dictionary[] shiftCustomMapExtras = { null, null, null, null, null };*/ public List[] profileActions = { null, null, null, null, null }; public int[] profileActionCount = { 0, 0, 0, 0, 0 }; public Dictionary[] profileActionDict = { new Dictionary(), new Dictionary(), new Dictionary(), new Dictionary(), new Dictionary() }; @@ -1325,10 +1322,10 @@ namespace DS4Windows public bool flashWhenLate = true; public int flashWhenLateAt = 20; // Cache whether profile has custom action - public bool[] containsCustomAction = { false, false, false, false, false }; + public bool[] containsCustomAction = new bool[5] { false, false, false, false, false }; // Cache whether profile has custom extras - public bool[] containsCustomExtras = { false, false, false, false, false }; + public bool[] containsCustomExtras = new bool[5] { false, false, false, false, false }; public int[] gyroSensitivity = { 100, 100, 100, 100, 100 }; public int[] gyroSensVerticalScale = { 100, 100, 100, 100, 100 }; @@ -1350,18 +1347,6 @@ namespace DS4Windows ds4settings[i].Add(new DS4ControlSettings(dc)); } - /*customMapKeyTypes[i] = new Dictionary(); - customMapKeys[i] = new Dictionary(); - customMapMacros[i] = new Dictionary(); - customMapButtons[i] = new Dictionary(); - customMapExtras[i] = new Dictionary(); - - shiftCustomMapKeyTypes[i] = new Dictionary(); - shiftCustomMapKeys[i] = new Dictionary(); - shiftCustomMapMacros[i] = new Dictionary(); - shiftCustomMapButtons[i] = new Dictionary(); - shiftCustomMapExtras[i] = new Dictionary();*/ - profileActions[i] = new List(); profileActions[i].Add("Disconnect Controller"); profileActionCount[i] = profileActions[i].Count; @@ -1583,6 +1568,12 @@ namespace DS4Windows XmlNode xmlUseTPforControls = m_Xdoc.CreateNode(XmlNodeType.Element, "UseTPforControls", null); xmlUseTPforControls.InnerText = useTPforControls[device].ToString(); Node.AppendChild(xmlUseTPforControls); XmlNode xmlUseSAforMouse = m_Xdoc.CreateNode(XmlNodeType.Element, "UseSAforMouse", null); xmlUseSAforMouse.InnerText = useSAforMouse[device].ToString(); Node.AppendChild(xmlUseSAforMouse); XmlNode xmlSATriggers = m_Xdoc.CreateNode(XmlNodeType.Element, "SATriggers", null); xmlSATriggers.InnerText = sATriggers[device].ToString(); Node.AppendChild(xmlSATriggers); + + XmlNode xmlTouchDisInvTriggers = m_Xdoc.CreateNode(XmlNodeType.Element, "TouchDisInvTriggers", null); + string tempTouchDisInv = string.Join(",", touchDisInvertTriggers[device]); + xmlTouchDisInvTriggers.InnerText = tempTouchDisInv; + Node.AppendChild(xmlTouchDisInvTriggers); + XmlNode xmlGyroSensitivity = m_Xdoc.CreateNode(XmlNodeType.Element, "GyroSensitivity", null); xmlGyroSensitivity.InnerText = gyroSensitivity[device].ToString(); Node.AppendChild(xmlGyroSensitivity); XmlNode xmlGyroSensVerticalScale = m_Xdoc.CreateNode(XmlNodeType.Element, "GyroSensVerticalScale", null); xmlGyroSensVerticalScale.InnerText = gyroSensVerticalScale[device].ToString(); Node.AppendChild(xmlGyroSensVerticalScale); XmlNode xmlGyroInvert = m_Xdoc.CreateNode(XmlNodeType.Element, "GyroInvert", null); xmlGyroInvert.InnerText = gyroInvert[device].ToString(); Node.AppendChild(xmlGyroInvert); @@ -2556,6 +2547,21 @@ namespace DS4Windows try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/SATriggers"); sATriggers[device] = Item.InnerText; } catch { sATriggers[device] = ""; missingSetting = true; } + try { + Item = m_Xdoc.SelectSingleNode("/" + rootname + "/TouchDisInvTriggers"); + string[] triggers = Item.InnerText.Split(','); + int temp = -1; + List tempIntList = new List(); + for (int i = 0, arlen = triggers.Length; i < arlen; i++) + { + if (int.TryParse(triggers[i], out temp)) + tempIntList.Add(temp); + } + + touchDisInvertTriggers[device] = tempIntList.ToArray(); + } + catch { touchDisInvertTriggers[device] = new int[1] { -1 }; missingSetting = true; } + try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/GyroSensitivity"); int.TryParse(Item.InnerText, out gyroSensitivity[device]); } catch { gyroSensitivity[device] = 100; missingSetting = true; } @@ -3640,7 +3646,8 @@ namespace DS4Windows startTouchpadOff[device] = false; useTPforControls[device] = false; useSAforMouse[device] = false; - sATriggers[device] = ""; + sATriggers[device] = string.Empty; + touchDisInvertTriggers[device] = new int[1] { -1 }; lsCurve[device] = rsCurve[device] = 0; gyroSensitivity[device] = 100; gyroSensVerticalScale[device] = 100; diff --git a/DS4Windows/DS4Forms/Options.Designer.cs b/DS4Windows/DS4Forms/Options.Designer.cs index 40e057b..7128848 100644 --- a/DS4Windows/DS4Forms/Options.Designer.cs +++ b/DS4Windows/DS4Forms/Options.Designer.cs @@ -76,6 +76,8 @@ this.nUDL2 = new System.Windows.Forms.NumericUpDown(); this.gBTouchpad = new System.Windows.Forms.GroupBox(); this.pnlTPMouse = new System.Windows.Forms.Panel(); + this.touchpadDisInvertButton = new System.Windows.Forms.Button(); + this.label25 = new System.Windows.Forms.Label(); this.label15 = new System.Windows.Forms.Label(); this.touchpadInvertComboBox = new System.Windows.Forms.ComboBox(); this.cbStartTouchpadOff = new System.Windows.Forms.CheckBox(); @@ -361,6 +363,26 @@ this.shareToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.pSToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.alwaysOnToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.cMTouchDisableInvert = new System.Windows.Forms.ContextMenuStrip(this.components); + this.crossTouchInvStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.circleTouchInvStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.squareTouchInvStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.triangleTouchInvStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.l1TouchInvStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.l2TouchInvStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.r1TouchInvStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.r2TouchInvStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.upTouchInvStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.downTouchInvStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.leftTouchInvStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.rightTouchInvStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.l3TouchInvStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.r3TouchInvStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.oneFingerTouchInvStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.twoFingerTouchInvStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.optionsTouchInvStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.shareTouchInvStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.psTouchInvStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.advColorDialog = new DS4Windows.AdvancedColorDialog(); ((System.ComponentModel.ISupportInitialize)(this.nUDRainbow)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.tBBlueBar)).BeginInit(); @@ -453,6 +475,7 @@ ((System.ComponentModel.ISupportInitialize)(this.nUDSXS)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.nUDSZS)).BeginInit(); this.cMGyroTriggers.SuspendLayout(); + this.cMTouchDisableInvert.SuspendLayout(); this.SuspendLayout(); // // lowColorChooserButton @@ -911,6 +934,8 @@ // // pnlTPMouse // + this.pnlTPMouse.Controls.Add(this.touchpadDisInvertButton); + this.pnlTPMouse.Controls.Add(this.label25); this.pnlTPMouse.Controls.Add(this.label15); this.pnlTPMouse.Controls.Add(this.touchpadInvertComboBox); this.pnlTPMouse.Controls.Add(this.nUDScroll); @@ -926,6 +951,19 @@ resources.ApplyResources(this.pnlTPMouse, "pnlTPMouse"); this.pnlTPMouse.Name = "pnlTPMouse"; // + // touchpadDisInvertButton + // + this.touchpadDisInvertButton.ForeColor = System.Drawing.SystemColors.ControlText; + resources.ApplyResources(this.touchpadDisInvertButton, "touchpadDisInvertButton"); + this.touchpadDisInvertButton.Name = "touchpadDisInvertButton"; + this.touchpadDisInvertButton.UseVisualStyleBackColor = true; + this.touchpadDisInvertButton.Click += new System.EventHandler(this.touchpadDisInvertButton_Click); + // + // label25 + // + resources.ApplyResources(this.label25, "label25"); + this.label25.Name = "label25"; + // // label15 // resources.ApplyResources(this.label15, "label15"); @@ -3875,6 +3913,166 @@ resources.ApplyResources(this.alwaysOnToolStripMenuItem, "alwaysOnToolStripMenuItem"); this.alwaysOnToolStripMenuItem.CheckedChanged += new System.EventHandler(this.SATrigger_CheckedChanged); // + // cMTouchDisableInvert + // + this.cMTouchDisableInvert.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.crossTouchInvStripMenuItem, + this.circleTouchInvStripMenuItem, + this.squareTouchInvStripMenuItem, + this.triangleTouchInvStripMenuItem, + this.l1TouchInvStripMenuItem, + this.l2TouchInvStripMenuItem, + this.r1TouchInvStripMenuItem, + this.r2TouchInvStripMenuItem, + this.upTouchInvStripMenuItem, + this.downTouchInvStripMenuItem, + this.leftTouchInvStripMenuItem, + this.rightTouchInvStripMenuItem, + this.l3TouchInvStripMenuItem, + this.r3TouchInvStripMenuItem, + this.oneFingerTouchInvStripMenuItem, + this.twoFingerTouchInvStripMenuItem, + this.optionsTouchInvStripMenuItem, + this.shareTouchInvStripMenuItem, + this.psTouchInvStripMenuItem}); + this.cMTouchDisableInvert.Name = "cMTouchDisableInvert"; + this.cMTouchDisableInvert.ShowCheckMargin = true; + this.cMTouchDisableInvert.ShowImageMargin = false; + resources.ApplyResources(this.cMTouchDisableInvert, "cMTouchDisableInvert"); + // + // crossTouchInvStripMenuItem + // + this.crossTouchInvStripMenuItem.CheckOnClick = true; + this.crossTouchInvStripMenuItem.Name = "crossTouchInvStripMenuItem"; + resources.ApplyResources(this.crossTouchInvStripMenuItem, "crossTouchInvStripMenuItem"); + this.crossTouchInvStripMenuItem.CheckedChanged += new System.EventHandler(this.TouchDisableInvert_CheckedChanged); + // + // circleTouchInvStripMenuItem + // + this.circleTouchInvStripMenuItem.CheckOnClick = true; + this.circleTouchInvStripMenuItem.Name = "circleTouchInvStripMenuItem"; + resources.ApplyResources(this.circleTouchInvStripMenuItem, "circleTouchInvStripMenuItem"); + this.circleTouchInvStripMenuItem.CheckedChanged += new System.EventHandler(this.TouchDisableInvert_CheckedChanged); + // + // squareTouchInvStripMenuItem + // + this.squareTouchInvStripMenuItem.CheckOnClick = true; + this.squareTouchInvStripMenuItem.Name = "squareTouchInvStripMenuItem"; + resources.ApplyResources(this.squareTouchInvStripMenuItem, "squareTouchInvStripMenuItem"); + this.squareTouchInvStripMenuItem.CheckedChanged += new System.EventHandler(this.TouchDisableInvert_CheckedChanged); + // + // triangleTouchInvStripMenuItem + // + this.triangleTouchInvStripMenuItem.CheckOnClick = true; + this.triangleTouchInvStripMenuItem.Name = "triangleTouchInvStripMenuItem"; + resources.ApplyResources(this.triangleTouchInvStripMenuItem, "triangleTouchInvStripMenuItem"); + this.triangleTouchInvStripMenuItem.CheckedChanged += new System.EventHandler(this.TouchDisableInvert_CheckedChanged); + // + // l1TouchInvStripMenuItem + // + this.l1TouchInvStripMenuItem.CheckOnClick = true; + this.l1TouchInvStripMenuItem.Name = "l1TouchInvStripMenuItem"; + resources.ApplyResources(this.l1TouchInvStripMenuItem, "l1TouchInvStripMenuItem"); + this.l1TouchInvStripMenuItem.CheckedChanged += new System.EventHandler(this.TouchDisableInvert_CheckedChanged); + // + // l2TouchInvStripMenuItem + // + this.l2TouchInvStripMenuItem.CheckOnClick = true; + this.l2TouchInvStripMenuItem.Name = "l2TouchInvStripMenuItem"; + resources.ApplyResources(this.l2TouchInvStripMenuItem, "l2TouchInvStripMenuItem"); + this.l2TouchInvStripMenuItem.CheckedChanged += new System.EventHandler(this.TouchDisableInvert_CheckedChanged); + // + // r1TouchInvStripMenuItem + // + this.r1TouchInvStripMenuItem.CheckOnClick = true; + this.r1TouchInvStripMenuItem.Name = "r1TouchInvStripMenuItem"; + resources.ApplyResources(this.r1TouchInvStripMenuItem, "r1TouchInvStripMenuItem"); + this.r1TouchInvStripMenuItem.CheckedChanged += new System.EventHandler(this.TouchDisableInvert_CheckedChanged); + // + // r2TouchInvStripMenuItem + // + this.r2TouchInvStripMenuItem.CheckOnClick = true; + this.r2TouchInvStripMenuItem.Name = "r2TouchInvStripMenuItem"; + resources.ApplyResources(this.r2TouchInvStripMenuItem, "r2TouchInvStripMenuItem"); + this.r2TouchInvStripMenuItem.CheckedChanged += new System.EventHandler(this.TouchDisableInvert_CheckedChanged); + // + // upTouchInvStripMenuItem + // + this.upTouchInvStripMenuItem.CheckOnClick = true; + this.upTouchInvStripMenuItem.Name = "upTouchInvStripMenuItem"; + resources.ApplyResources(this.upTouchInvStripMenuItem, "upTouchInvStripMenuItem"); + this.upTouchInvStripMenuItem.CheckedChanged += new System.EventHandler(this.TouchDisableInvert_CheckedChanged); + // + // downTouchInvStripMenuItem + // + this.downTouchInvStripMenuItem.CheckOnClick = true; + this.downTouchInvStripMenuItem.Name = "downTouchInvStripMenuItem"; + resources.ApplyResources(this.downTouchInvStripMenuItem, "downTouchInvStripMenuItem"); + this.downTouchInvStripMenuItem.CheckedChanged += new System.EventHandler(this.TouchDisableInvert_CheckedChanged); + // + // leftTouchInvStripMenuItem + // + this.leftTouchInvStripMenuItem.CheckOnClick = true; + this.leftTouchInvStripMenuItem.Name = "leftTouchInvStripMenuItem"; + resources.ApplyResources(this.leftTouchInvStripMenuItem, "leftTouchInvStripMenuItem"); + this.leftTouchInvStripMenuItem.CheckedChanged += new System.EventHandler(this.TouchDisableInvert_CheckedChanged); + // + // rightTouchInvStripMenuItem + // + this.rightTouchInvStripMenuItem.CheckOnClick = true; + this.rightTouchInvStripMenuItem.Name = "rightTouchInvStripMenuItem"; + resources.ApplyResources(this.rightTouchInvStripMenuItem, "rightTouchInvStripMenuItem"); + this.rightTouchInvStripMenuItem.CheckedChanged += new System.EventHandler(this.TouchDisableInvert_CheckedChanged); + // + // l3TouchInvStripMenuItem + // + this.l3TouchInvStripMenuItem.CheckOnClick = true; + this.l3TouchInvStripMenuItem.Name = "l3TouchInvStripMenuItem"; + resources.ApplyResources(this.l3TouchInvStripMenuItem, "l3TouchInvStripMenuItem"); + this.l3TouchInvStripMenuItem.CheckedChanged += new System.EventHandler(this.TouchDisableInvert_CheckedChanged); + // + // r3TouchInvStripMenuItem + // + this.r3TouchInvStripMenuItem.CheckOnClick = true; + this.r3TouchInvStripMenuItem.Name = "r3TouchInvStripMenuItem"; + resources.ApplyResources(this.r3TouchInvStripMenuItem, "r3TouchInvStripMenuItem"); + this.r3TouchInvStripMenuItem.CheckedChanged += new System.EventHandler(this.TouchDisableInvert_CheckedChanged); + // + // oneFingerTouchInvStripMenuItem + // + this.oneFingerTouchInvStripMenuItem.CheckOnClick = true; + this.oneFingerTouchInvStripMenuItem.Name = "oneFingerTouchInvStripMenuItem"; + resources.ApplyResources(this.oneFingerTouchInvStripMenuItem, "oneFingerTouchInvStripMenuItem"); + this.oneFingerTouchInvStripMenuItem.CheckedChanged += new System.EventHandler(this.TouchDisableInvert_CheckedChanged); + // + // twoFingerTouchInvStripMenuItem + // + this.twoFingerTouchInvStripMenuItem.CheckOnClick = true; + this.twoFingerTouchInvStripMenuItem.Name = "twoFingerTouchInvStripMenuItem"; + resources.ApplyResources(this.twoFingerTouchInvStripMenuItem, "twoFingerTouchInvStripMenuItem"); + this.twoFingerTouchInvStripMenuItem.CheckedChanged += new System.EventHandler(this.TouchDisableInvert_CheckedChanged); + // + // optionsTouchInvStripMenuItem + // + this.optionsTouchInvStripMenuItem.CheckOnClick = true; + this.optionsTouchInvStripMenuItem.Name = "optionsTouchInvStripMenuItem"; + resources.ApplyResources(this.optionsTouchInvStripMenuItem, "optionsTouchInvStripMenuItem"); + this.optionsTouchInvStripMenuItem.CheckedChanged += new System.EventHandler(this.TouchDisableInvert_CheckedChanged); + // + // shareTouchInvStripMenuItem + // + this.shareTouchInvStripMenuItem.CheckOnClick = true; + this.shareTouchInvStripMenuItem.Name = "shareTouchInvStripMenuItem"; + resources.ApplyResources(this.shareTouchInvStripMenuItem, "shareTouchInvStripMenuItem"); + this.shareTouchInvStripMenuItem.CheckedChanged += new System.EventHandler(this.TouchDisableInvert_CheckedChanged); + // + // psTouchInvStripMenuItem + // + this.psTouchInvStripMenuItem.CheckOnClick = true; + this.psTouchInvStripMenuItem.Name = "psTouchInvStripMenuItem"; + resources.ApplyResources(this.psTouchInvStripMenuItem, "psTouchInvStripMenuItem"); + this.psTouchInvStripMenuItem.CheckedChanged += new System.EventHandler(this.TouchDisableInvert_CheckedChanged); + // // Options // resources.ApplyResources(this, "$this"); @@ -3996,6 +4194,7 @@ ((System.ComponentModel.ISupportInitialize)(this.nUDSXS)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.nUDSZS)).EndInit(); this.cMGyroTriggers.ResumeLayout(false); + this.cMTouchDisableInvert.ResumeLayout(false); this.ResumeLayout(false); } @@ -4336,5 +4535,27 @@ private System.Windows.Forms.ComboBox cBSixaxisXOutputCurve; private System.Windows.Forms.Label label24; private System.Windows.Forms.Label label23; + private System.Windows.Forms.ContextMenuStrip cMTouchDisableInvert; + private System.Windows.Forms.ToolStripMenuItem crossTouchInvStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem circleTouchInvStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem squareTouchInvStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem triangleTouchInvStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem l1TouchInvStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem l2TouchInvStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem r1TouchInvStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem r2TouchInvStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem upTouchInvStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem downTouchInvStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem leftTouchInvStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem rightTouchInvStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem l3TouchInvStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem r3TouchInvStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem oneFingerTouchInvStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem twoFingerTouchInvStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem optionsTouchInvStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem shareTouchInvStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem psTouchInvStripMenuItem; + private System.Windows.Forms.Button touchpadDisInvertButton; + private System.Windows.Forms.Label label25; } } \ No newline at end of file diff --git a/DS4Windows/DS4Forms/Options.cs b/DS4Windows/DS4Forms/Options.cs index c083b14..3d973a3 100644 --- a/DS4Windows/DS4Forms/Options.cs +++ b/DS4Windows/DS4Forms/Options.cs @@ -641,6 +641,26 @@ namespace DS4Windows break; } } + + btnGyroTriggers.Text = string.Join(", ", s); + s.Clear(); + + int[] touchDisInvTriggers = TouchDisInvertTriggers[device]; + int touchDisableInvCount = cMTouchDisableInvert.Items.Count; + for (int i = 0, trigLen = touchDisInvTriggers.Length; i < trigLen; i++) + { + int tr = touchDisInvTriggers[i]; + if (tr < touchDisableInvCount && tr > -1) + { + ToolStripMenuItem current = (ToolStripMenuItem)cMTouchDisableInvert.Items[tr]; + current.Checked = true; + s.Add(current.Text); + } + } + + if (s.Count > 0) + touchpadDisInvertButton.Text = string.Join(", ", s); + nUDGyroSensitivity.Value = GyroSensitivity[device]; gyroTriggerBehavior.Checked = GyroTriggerTurns[device]; nUDGyroMouseVertScale.Value = GyroSensVerticalScale[device]; @@ -744,7 +764,18 @@ namespace DS4Windows nUDLSCurve.Value = 0; nUDRSCurve.Value = 0; cBControllerInput.Checked = DS4Mapping; + + for (int i = 0, arlen = cMGyroTriggers.Items.Count - 1; i < arlen; i++) + { + ((ToolStripMenuItem)cMGyroTriggers.Items[i]).Checked = false; + } ((ToolStripMenuItem)cMGyroTriggers.Items[cMGyroTriggers.Items.Count - 1]).Checked = true; + + for (int i = 0, arlen = cMTouchDisableInvert.Items.Count; i < arlen; i++) + { + ((ToolStripMenuItem)cMTouchDisableInvert.Items[i]).Checked = false; + } + nUDGyroSensitivity.Value = 100; nUDGyroMouseVertScale.Value = 100; gyroTriggerBehavior.Checked = true; @@ -1116,57 +1147,6 @@ namespace DS4Windows { lBControls.SelectedIndex = tempIndex; } - - /*switch (name) - { - #region - case "bnCross": lBControls.SelectedIndex = 0; break; - case "bnCircle": lBControls.SelectedIndex = 1; break; - case "bnSquare": lBControls.SelectedIndex = 2; break; - case "bnTriangle": lBControls.SelectedIndex = 3; break; - case "bnOptions": lBControls.SelectedIndex = 4; break; - case "bnShare": lBControls.SelectedIndex = 5; break; - case "bnUp": lBControls.SelectedIndex = 6; break; - case "bnDown": lBControls.SelectedIndex = 7; break; - case "bnLeft": lBControls.SelectedIndex = 8; break; - case "bnRight": lBControls.SelectedIndex = 9; break; - case "bnPS": lBControls.SelectedIndex = 10; break; - case "bnL1": lBControls.SelectedIndex = 11; break; - case "bnR1": lBControls.SelectedIndex = 12; break; - case "bnL2": lBControls.SelectedIndex = 13; break; - case "bnR2": lBControls.SelectedIndex = 14; break; - case "bnL3": lBControls.SelectedIndex = 15; break; - case "bnR3": lBControls.SelectedIndex = 16; break; - case "bnTouchLeft": lBControls.SelectedIndex = 17; break; - case "bnTouchRight": lBControls.SelectedIndex = 18; break; - case "bnTouchMulti": lBControls.SelectedIndex = 19; break; - case "bnTouchUpper": lBControls.SelectedIndex = 20; break; - case "bnLSUp": lBControls.SelectedIndex = 21; break; - case "bnLSDown": lBControls.SelectedIndex = 22; break; - case "bnLSLeft": lBControls.SelectedIndex = 23; break; - case "bnLSRight": lBControls.SelectedIndex = 24; break; - case "bnRSUp": lBControls.SelectedIndex = 25; break; - case "bnRSDown": lBControls.SelectedIndex = 26; break; - case "bnRSLeft": lBControls.SelectedIndex = 27; break; - case "bnRSRight": lBControls.SelectedIndex = 28; break; - case "bnGyroZN": lBControls.SelectedIndex = 29; break; - case "bnGyroZP": lBControls.SelectedIndex = 30; break; - case "bnGyroXP": lBControls.SelectedIndex = 31; break; - case "bnGyroXN": lBControls.SelectedIndex = 32; break; - #endregion - } - - if (swipesOn) - { - switch (name) - { - case "bnSwipeUp": if (swipesOn) lBControls.SelectedIndex = 33; break; - case "bnSwipeDown": if (swipesOn) lBControls.SelectedIndex = 34; break; - case "bnSwipeLeft": if (swipesOn) lBControls.SelectedIndex = 35; break; - case "bnSwipeRight": if (swipesOn) lBControls.SelectedIndex = 36; break; - } - } - */ } DS4ControlSettings dcs = getDS4CSetting(device, name); @@ -1196,129 +1176,6 @@ namespace DS4Windows pBHoveredButton.Location = tempLabel.Location; } - /*switch (name) - { - #region - case "bnCross": - pBHoveredButton.Image = Properties.Resources.DS4_Config_Cross; - pBHoveredButton.Location = lbLCross.Location; - break; - case "bnCircle": - pBHoveredButton.Image = Properties.Resources.DS4_Config_Circle; - pBHoveredButton.Location = lbLCircle.Location; - break; - case "bnSquare": - pBHoveredButton.Image = Properties.Resources.DS4_Config_Square; - pBHoveredButton.Location = lbLSquare.Location; - break; - case "bnTriangle": - pBHoveredButton.Image = Properties.Resources.DS4_Config_Triangle; - pBHoveredButton.Location = lbLTriangle.Location; - break; - case "bnOptions": - pBHoveredButton.Image = Properties.Resources.DS4_Config_Options; - pBHoveredButton.Location = lbLOptions.Location; - break; - case "bnShare": - pBHoveredButton.Image = Properties.Resources.DS4_Config_Share; - pBHoveredButton.Location = lbLShare.Location; - break; - case "bnUp": - pBHoveredButton.Image = Properties.Resources.DS4_Config_Up; - pBHoveredButton.Location = lbLUp.Location; - break; - case "bnDown": - pBHoveredButton.Image = Properties.Resources.DS4_Config_Down; - pBHoveredButton.Location = lbLDown.Location; - break; - case "bnLeft": - pBHoveredButton.Image = Properties.Resources.DS4_Config_Left; - pBHoveredButton.Location = lbLLeft.Location; - break; - case "bnRight": - pBHoveredButton.Image = Properties.Resources.DS4_Config_Right; - pBHoveredButton.Location = lbLright.Location; - break; - case "bnPS": - pBHoveredButton.Image = Properties.Resources.DS4_Config_PS; - pBHoveredButton.Location = lbLPS.Location; - break; - case "bnL1": - pBHoveredButton.Image = Properties.Resources.DS4_Config_L1; - pBHoveredButton.Location = lbLL1.Location; - break; - case "bnR1": - pBHoveredButton.Image = Properties.Resources.DS4_Config_R1; - pBHoveredButton.Location = lbLR1.Location; - break; - case "bnL2": - pBHoveredButton.Image = Properties.Resources.DS4_Config_L2; - pBHoveredButton.Location = lbLL2.Location; - break; - case "bnR2": - pBHoveredButton.Image = Properties.Resources.DS4_Config_R2; - pBHoveredButton.Location = lbLR2.Location; - break; - case "bnTouchLeft": - pBHoveredButton.Image = Properties.Resources.DS4_Config_TouchLeft; - pBHoveredButton.Location = lbLTouchLM.Location; - break; - case "bnTouchRight": - pBHoveredButton.Image = Properties.Resources.DS4_Config_TouchRight; - pBHoveredButton.Location = lbLTouchRight.Location; - break; - case "bnTouchMulti": - pBHoveredButton.Image = Properties.Resources.DS4_Config_TouchMulti; - pBHoveredButton.Location = lbLTouchLM.Location; - break; - case "bnTouchUpper": - pBHoveredButton.Image = Properties.Resources.DS4_Config_TouchUpper; - pBHoveredButton.Location = lbLTouchUpper.Location; - break; - case "bnL3": - pBHoveredButton.Image = Properties.Resources.DS4_Config_LS; - pBHoveredButton.Location = lbLLS.Location; - break; - case "bnLSUp": - pBHoveredButton.Image = Properties.Resources.DS4_Config_LS; - pBHoveredButton.Location = lbLLS.Location; - break; - case "bnLSDown": - pBHoveredButton.Image = Properties.Resources.DS4_Config_LS; - pBHoveredButton.Location = lbLLS.Location; - break; - case "bnLSLeft": - pBHoveredButton.Image = Properties.Resources.DS4_Config_LS; - pBHoveredButton.Location = lbLLS.Location; - break; - case "bnLSRight": - pBHoveredButton.Image = Properties.Resources.DS4_Config_LS; - pBHoveredButton.Location = lbLLS.Location; - break; - case "bnR3": - pBHoveredButton.Image = Properties.Resources.DS4_Config_RS; - pBHoveredButton.Location = lbLRS.Location; - break; - case "bnRSUp": - pBHoveredButton.Image = Properties.Resources.DS4_Config_RS; - pBHoveredButton.Location = lbLRS.Location; - break; - case "bnRSDown": - pBHoveredButton.Image = Properties.Resources.DS4_Config_RS; - pBHoveredButton.Location = lbLRS.Location; - break; - case "bnRSLeft": - pBHoveredButton.Image = Properties.Resources.DS4_Config_RS; - pBHoveredButton.Location = lbLRS.Location; - break; - case "bnRSRight": - pBHoveredButton.Image = Properties.Resources.DS4_Config_RS; - pBHoveredButton.Location = lbLRS.Location; - break; - #endregion - } - */ - if (pBHoveredButton.Image != null) pBHoveredButton.Size = new Size((int)(pBHoveredButton.Image.Size.Width * (dpix / 1.25f)), (int)(pBHoveredButton.Image.Size.Height * (dpix / 1.25f))); } @@ -1445,6 +1302,18 @@ namespace DS4Windows SATriggers[device] = string.Join(",", ints); + ints.Clear(); + for (int i = 0, trigLen = cMTouchDisableInvert.Items.Count - 1; i < trigLen; i++) + { + if (((ToolStripMenuItem)cMTouchDisableInvert.Items[i]).Checked) + ints.Add(i); + } + + if (ints.Count == 0) + ints.Add(-1); + + TouchDisInvertTriggers[device] = ints.ToArray(); + if (nUDRainbow.Value == 0) btnRainbow.Image = greyscale; else btnRainbow.Image = colored; } @@ -1484,36 +1353,6 @@ namespace DS4Windows } } - /*public void Toggle_Bn(bool SC, bool TG, bool MC, bool MR) - { - if (lastSelected.Tag is KeyValuePair || lastSelected.Tag is KeyValuePair || lastSelected.Tag is KeyValuePair) - lastSelected.Font = new Font(lastSelected.Font, - (SC ? FontStyle.Bold : FontStyle.Regular) | (TG ? FontStyle.Italic : FontStyle.Regular) | - (MC ? FontStyle.Underline : FontStyle.Regular) | (MR ? FontStyle.Strikeout : FontStyle.Regular)); - else if (lastSelected.Tag is KeyValuePair) - if (lastSelected.Tag.ToString().Contains("Mouse Button")) - lastSelected.Font = new Font(lastSelected.Font, TG ? FontStyle.Italic : FontStyle.Regular); - else - lastSelected.Font = new Font(lastSelected.Font, FontStyle.Regular); - } - - public void Toggle_Bn(bool SC, bool TG, bool MC, bool MR, System.Windows.Forms.Control ctrl) - { - if (ctrl is Button) - { - Button btn = (Button)ctrl; - if (btn.Tag is KeyValuePair || btn.Tag is KeyValuePair || btn.Tag is KeyValuePair) - btn.Font = new Font(btn.Font, - (SC ? FontStyle.Bold : FontStyle.Regular) | (TG ? FontStyle.Italic : FontStyle.Regular) | - (MC ? FontStyle.Underline : FontStyle.Regular) | (MR ? FontStyle.Strikeout : FontStyle.Regular)); - else if (btn.Tag is KeyValuePair) - if (btn.Tag.ToString().Contains("Mouse Button")) - btn.Font = new Font(btn.Font, TG ? FontStyle.Italic : FontStyle.Regular); - else - btn.Font = new Font(btn.Font, FontStyle.Regular); - } - }*/ - private void btnLightbar_Click(object sender, EventArgs e) { advColorDialog.Color = Color.FromArgb(tBRedBar.Value, tBGreenBar.Value, tBBlueBar.Value); @@ -2451,14 +2290,6 @@ namespace DS4Windows MouseToolStripMenuItem.Visible = !(name == "lbTPSwipes" || name.StartsWith("bnSwipe")); } - /*private void BatchToggle_Bn(bool scancode, Button button1, Button button2, Button button3, Button button4) - { - Toggle_Bn(scancode, false, false, false, button1); - Toggle_Bn(scancode, false, false, false, button2); - Toggle_Bn(scancode, false, false, false, button3); - Toggle_Bn(scancode, false, false, false, button4); - }*/ - private void SetPreset(object sender, EventArgs e) { bool scancode = false; @@ -2728,37 +2559,45 @@ namespace DS4Windows private void btnGyroTriggers_Click(object sender, EventArgs e) { - cMGyroTriggers.Show((Control)sender, new Point(0, ((Control)sender).Height)); + Control button = (Control)sender; + cMGyroTriggers.Show(button, new Point(0, button.Height)); } private void SATrigger_CheckedChanged(object sender, EventArgs e) { - if (sender != cMGyroTriggers.Items[cMGyroTriggers.Items.Count - 1] && ((ToolStripMenuItem)sender).Checked) - ((ToolStripMenuItem)cMGyroTriggers.Items[cMGyroTriggers.Items.Count - 1]).Checked = false; - if (((ToolStripMenuItem)cMGyroTriggers.Items[cMGyroTriggers.Items.Count - 1]).Checked) //always on - for (int i = 0; i < cMGyroTriggers.Items.Count - 1; i++) - ((ToolStripMenuItem)cMGyroTriggers.Items[i]).Checked = false; - - List ints = new List(); - List s = new List(); - for (int i = 0; i < cMGyroTriggers.Items.Count - 1; i++) + if (loading == false) { - if (((ToolStripMenuItem)cMGyroTriggers.Items[i]).Checked) + int gyroTriggerCount = cMGyroTriggers.Items.Count; + if (sender != cMGyroTriggers.Items[gyroTriggerCount - 1] && ((ToolStripMenuItem)sender).Checked) + ((ToolStripMenuItem)cMGyroTriggers.Items[gyroTriggerCount - 1]).Checked = false; + + if (((ToolStripMenuItem)cMGyroTriggers.Items[gyroTriggerCount - 1]).Checked) //always on { - ints.Add(i); - s.Add(cMGyroTriggers.Items[i].Text); + for (int i = 0; i < gyroTriggerCount - 1; i++) + ((ToolStripMenuItem)cMGyroTriggers.Items[i]).Checked = false; } - } - if (ints.Count == 0) - { - ints.Add(-1); - s.Add(cMGyroTriggers.Items[cMGyroTriggers.Items.Count - 1].Text); - } + List ints = new List(); + List s = new List(); + for (int i = 0; i < gyroTriggerCount - 1; i++) + { + if (((ToolStripMenuItem)cMGyroTriggers.Items[i]).Checked) + { + ints.Add(i); + s.Add(cMGyroTriggers.Items[i].Text); + } + } - SATriggers[device] = string.Join(",", ints); - if (s.Count > 0) - btnGyroTriggers.Text = string.Join(", ", s); + if (ints.Count == 0) + { + ints.Add(-1); + s.Add(cMGyroTriggers.Items[gyroTriggerCount - 1].Text); + } + + SATriggers[device] = string.Join(",", ints); + if (s.Count > 0) + btnGyroTriggers.Text = string.Join(", ", s); + } } private void cBGyroInvert_CheckChanged(object sender, EventArgs e) @@ -3042,6 +2881,42 @@ namespace DS4Windows } } + private void TouchDisableInvert_CheckedChanged(object sender, EventArgs e) + { + if (loading == false) + { + int touchDisableInvCount = cMTouchDisableInvert.Items.Count; + + List ints = new List(); + List s = new List(); + for (int i = 0; i < touchDisableInvCount - 1; i++) + { + ToolStripMenuItem current = (ToolStripMenuItem)cMTouchDisableInvert.Items[i]; + if (current.Checked) + { + ints.Add(i); + s.Add(current.Text); + } + } + + if (ints.Count == 0) + { + ints.Add(-1); + s.Add("None"); + } + + TouchDisInvertTriggers[device] = ints.ToArray(); + if (s.Count > 0) + touchpadDisInvertButton.Text = string.Join(", ", s); + } + } + + private void touchpadDisInvertButton_Click(object sender, EventArgs e) + { + Control button = (Control)sender; + cMTouchDisableInvert.Show(button, new Point(0, button.Height)); + } + private void Options_Resize(object sender, EventArgs e) { fLPSettings.AutoScroll = false; @@ -3054,7 +2929,6 @@ namespace DS4Windows if (lBControls.SelectedItem != null) { - //lbControlName.Text = lBControls.SelectedItem.ToString(); if (controlSelectedIndex == 0) lbControlName.ForeColor = Color.FromArgb(153, 205, 204); else if (controlSelectedIndex == 1) diff --git a/DS4Windows/DS4Forms/Options.resx b/DS4Windows/DS4Forms/Options.resx index 7aa233b..d13873e 100644 --- a/DS4Windows/DS4Forms/Options.resx +++ b/DS4Windows/DS4Forms/Options.resx @@ -430,7 +430,7 @@ pnlTPMouse - 3 + 5 True @@ -463,7 +463,7 @@ pnlTPMouse - 8 + 10 63, 39 @@ -484,7 +484,7 @@ pnlTPMouse - 6 + 8 True @@ -517,7 +517,7 @@ pnlTPMouse - 4 + 6 True @@ -550,7 +550,7 @@ pnlTPMouse - 9 + 11 167, 9 @@ -571,7 +571,7 @@ pnlTPMouse - 2 + 4 63, 9 @@ -592,7 +592,7 @@ pnlTPMouse - 10 + 12 True @@ -658,7 +658,7 @@ pnlTPMouse - 7 + 9 True @@ -691,7 +691,7 @@ pnlTPMouse - 5 + 7 True @@ -1335,6 +1335,63 @@ 1 + + NoControl + + + 162, 103 + + + 101, 23 + + + 237 + + + None + + + touchpadDisInvertButton + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlTPMouse + + + 0 + + + True + + + NoControl + + + 141, 87 + + + 75, 13 + + + 236 + + + Disable Invert: + + + label25 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlTPMouse + + + 1 + True @@ -1363,7 +1420,7 @@ pnlTPMouse - 0 + 2 None @@ -1378,10 +1435,10 @@ Both X and Y Axes - 144, 82 + 178, 62 - 121, 21 + 85, 21 234 @@ -1396,7 +1453,7 @@ pnlTPMouse - 1 + 3 True @@ -1426,7 +1483,7 @@ pnlTPMouse - 11 + 13 -3, 39 @@ -6080,7 +6137,7 @@ with profile $this - 3 + 4 4, 22 @@ -8498,7 +8555,7 @@ with profile $this - 2 + 3 482, 17 @@ -8632,12 +8689,141 @@ with profile System.Windows.Forms.ContextMenuStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 144, 63 + + + 194, 22 + + + Cross + + + 194, 22 + + + Circle + + + 194, 22 + + + Square + + + 194, 22 + + + Triangle + + + 194, 22 + + + L1 + + + 194, 22 + + + L2 + + + 194, 22 + + + R1 + + + 194, 22 + + + R2 + + + 194, 22 + + + Up + + + 194, 22 + + + Down + + + 194, 22 + + + Left + + + 194, 22 + + + Right + + + 194, 22 + + + L3 + + + 194, 22 + + + R3 + + + 194, 22 + + + Finger on Touchpad + + + 194, 22 + + + 2 Fingers on Touchpad + + + 194, 22 + + + Options + + + 194, 22 + + + Share + + + 194, 22 + + + PS + + + 195, 444 + + + cMTouchDisableInvert + + + System.Windows.Forms.ContextMenuStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + 647, 17 True + + 176 + 96, 96 @@ -8947,11 +9133,125 @@ with profile System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + crossTouchInvStripMenuItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + circleTouchInvStripMenuItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + squareTouchInvStripMenuItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + triangleTouchInvStripMenuItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + l1TouchInvStripMenuItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + l2TouchInvStripMenuItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + r1TouchInvStripMenuItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + r2TouchInvStripMenuItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + upTouchInvStripMenuItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + downTouchInvStripMenuItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + leftTouchInvStripMenuItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + rightTouchInvStripMenuItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + l3TouchInvStripMenuItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + r3TouchInvStripMenuItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + oneFingerTouchInvStripMenuItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + twoFingerTouchInvStripMenuItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + optionsTouchInvStripMenuItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + shareTouchInvStripMenuItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + psTouchInvStripMenuItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + advColorDialog - DS4Windows.AdvancedColorDialog, DS4Windows, Version=1.4.85.0, Culture=neutral, PublicKeyToken=null + DS4Windows.AdvancedColorDialog, DS4Windows, Version=1.4.87.0, Culture=neutral, PublicKeyToken=null Options