diff --git a/DS4Windows/DS4Control/Mouse.cs b/DS4Windows/DS4Control/Mouse.cs
index 81775e8..6544258 100644
--- a/DS4Windows/DS4Control/Mouse.cs
+++ b/DS4Windows/DS4Control/Mouse.cs
@@ -34,21 +34,29 @@ namespace DS4Windows
public virtual void sixaxisMoved(object sender, SixAxisEventArgs arg)
{
- if (Global.UseSAforMouse[deviceNum] && Global.GyroSensitivity[deviceNum] > 0)
+ if (Global.isUsingSAforMouse(deviceNum) && Global.getGyroSensitivity(deviceNum) > 0)
{
bool triggeractivated = true;
+ bool useReverseRatchet = Global.getGyroTriggerTurns(deviceNum);
int i = 0;
- string[] ss = Global.SATriggers[deviceNum].Split(',');
+ string[] ss = Global.getSATriggers(deviceNum).Split(',');
if (!string.IsNullOrEmpty(ss[0]))
{
- foreach (string s in ss)
+ string s = string.Empty;
+ for (int index = 0, arlen = ss.Length; triggeractivated && index < arlen; index++)
+ //foreach (string s in ss)
{
+ s = ss[index];
if (!(int.TryParse(s, out i) && getDS4ControlsByName(i)))
+ {
triggeractivated = false;
+ }
}
}
- if (triggeractivated)
+ if (useReverseRatchet && triggeractivated)
+ cursor.sixaxisMoved(arg);
+ else if (!useReverseRatchet && !triggeractivated)
cursor.sixaxisMoved(arg);
dev.getCurrentState(s);
diff --git a/DS4Windows/DS4Control/ScpUtil.cs b/DS4Windows/DS4Control/ScpUtil.cs
index d974b38..c39c4c8 100644
--- a/DS4Windows/DS4Control/ScpUtil.cs
+++ b/DS4Windows/DS4Control/ScpUtil.cs
@@ -567,8 +567,28 @@ namespace DS4Windows
}
public static string[] SATriggers => m_Config.sATriggers;
+ public static string getSATriggers(int index)
+ {
+ return m_Config.sATriggers[index];
+ }
+
public static int[] GyroSensitivity => m_Config.gyroSensitivity;
+ public static int getGyroSensitivity(int index)
+ {
+ return m_Config.gyroSensitivity[index];
+ }
+
public static int[] GyroInvert => m_Config.gyroInvert;
+ public static int getGyroInvert(int index)
+ {
+ return m_Config.gyroInvert[index];
+ }
+
+ public static bool[] GyroTriggerTurns => m_Config.gyroTriggerTurns;
+ public static bool getGyroTriggerTurns(int index)
+ {
+ return m_Config.gyroTriggerTurns[index];
+ }
public static DS4Color[] MainColor => m_Config.m_Leds;
public static DS4Color getMainColor(int index)
@@ -1206,10 +1226,13 @@ namespace DS4Windows
public int flashWhenLateAt = 20;
// Cache whether profile has custom action
public bool[] containsCustomAction = { false, false, false, false, false };
+
// Cache whether profile has custom extras
public bool[] containsCustomExtras = { false, false, false, false, false };
+
public int[] gyroSensitivity = { 100, 100, 100, 100, 100 };
public int[] gyroInvert = { 0, 0, 0, 0, 0 };
+ public bool[] gyroTriggerTurns = { true, true, true, true, true };
public BackingStore()
{
@@ -1418,6 +1441,7 @@ namespace DS4Windows
XmlNode xmlSATriggers = m_Xdoc.CreateNode(XmlNodeType.Element, "SATriggers", null); xmlSATriggers.InnerText = sATriggers[device].ToString(); Node.AppendChild(xmlSATriggers);
XmlNode xmlGyroSensitivity = m_Xdoc.CreateNode(XmlNodeType.Element, "GyroSensitivity", null); xmlGyroSensitivity.InnerText = gyroSensitivity[device].ToString(); Node.AppendChild(xmlGyroSensitivity);
XmlNode xmlGyroInvert = m_Xdoc.CreateNode(XmlNodeType.Element, "GyroInvert", null); xmlGyroInvert.InnerText = gyroInvert[device].ToString(); Node.AppendChild(xmlGyroInvert);
+ XmlNode xmlGyroTriggerTurns = m_Xdoc.CreateNode(XmlNodeType.Element, "GyroTriggerTurns", null); xmlGyroTriggerTurns.InnerText = gyroTriggerTurns[device].ToString(); Node.AppendChild(xmlGyroTriggerTurns);
XmlNode xmlLSC = m_Xdoc.CreateNode(XmlNodeType.Element, "LSCurve", null); xmlLSC.InnerText = lsCurve[device].ToString(); Node.AppendChild(xmlLSC);
XmlNode xmlRSC = m_Xdoc.CreateNode(XmlNodeType.Element, "RSCurve", null); xmlRSC.InnerText = rsCurve[device].ToString(); Node.AppendChild(xmlRSC);
XmlNode xmlProfileActions = m_Xdoc.CreateNode(XmlNodeType.Element, "ProfileActions", null); xmlProfileActions.InnerText = string.Join("/", profileActions[device]); Node.AppendChild(xmlProfileActions);
@@ -2315,25 +2339,29 @@ namespace DS4Windows
}
catch { startTouchpadOff[device] = false; missingSetting = true; }
- try
- { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/UseTPforControls"); Boolean.TryParse(Item.InnerText, out useTPforControls[device]); }
+ try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/UseTPforControls"); bool.TryParse(Item.InnerText, out useTPforControls[device]); }
catch { useTPforControls[device] = false; missingSetting = true; }
- try
- { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/UseSAforMouse"); Boolean.TryParse(Item.InnerText, out useSAforMouse[device]); }
+
+ try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/UseSAforMouse"); bool.TryParse(Item.InnerText, out useSAforMouse[device]); }
catch { useSAforMouse[device] = false; missingSetting = true; }
- try
- { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/SATriggers"); sATriggers[device] = Item.InnerText; }
+
+ try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/SATriggers"); sATriggers[device] = Item.InnerText; }
catch { sATriggers[device] = ""; missingSetting = true; }
- try
- { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/GyroSensitivity"); int.TryParse(Item.InnerText, out gyroSensitivity[device]); }
+
+ try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/GyroSensitivity"); int.TryParse(Item.InnerText, out gyroSensitivity[device]); }
catch { gyroSensitivity[device] = 100; missingSetting = true; }
- try
- { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/GyroInvert"); int.TryParse(Item.InnerText, out gyroInvert[device]); }
+
+ try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/GyroInvert"); int.TryParse(Item.InnerText, out gyroInvert[device]); }
catch { gyroInvert[device] = 0; missingSetting = true; }
+
+ try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/GyroTriggerTurns"); bool.TryParse(Item.InnerText, out gyroTriggerTurns[device]); }
+ catch { gyroTriggerTurns[device] = true; missingSetting = true; }
+
try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/LSCurve"); int.TryParse(Item.InnerText, out lsCurve[device]); }
- catch { missingSetting = true; }
+ catch { lsCurve[device] = 0; missingSetting = true; }
+
try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/RSCurve"); int.TryParse(Item.InnerText, out rsCurve[device]); }
- catch { missingSetting = true; }
+ catch { rsCurve[device] = 0; missingSetting = true; }
try {
Item = m_Xdoc.SelectSingleNode("/" + rootname + "/BTPollRate");
@@ -3381,6 +3409,7 @@ namespace DS4Windows
gyroInvert[device] = 0;
lsOutCurveMode[device] = 0;
rsOutCurveMode[device] = 0;
+ gyroTriggerTurns[device] = true;
}
}
diff --git a/DS4Windows/DS4Forms/Options.Designer.cs b/DS4Windows/DS4Forms/Options.Designer.cs
index 876243c..d842730 100644
--- a/DS4Windows/DS4Forms/Options.Designer.cs
+++ b/DS4Windows/DS4Forms/Options.Designer.cs
@@ -328,6 +328,7 @@
this.shareToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.pSToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.alwaysOnToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.gyroTriggerBehavior = new System.Windows.Forms.CheckBox();
this.advColorDialog = new DS4Windows.AdvancedColorDialog();
((System.ComponentModel.ISupportInitialize)(this.nUDRainbow)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.tBBlueBar)).BeginInit();
@@ -3012,6 +3013,7 @@
//
// pnlSAMouse
//
+ this.pnlSAMouse.Controls.Add(this.gyroTriggerBehavior);
this.pnlSAMouse.Controls.Add(this.cBGyroInvertY);
this.pnlSAMouse.Controls.Add(this.cBGyroInvertX);
this.pnlSAMouse.Controls.Add(this.lbGyroInvert);
@@ -3474,6 +3476,15 @@
resources.ApplyResources(this.alwaysOnToolStripMenuItem, "alwaysOnToolStripMenuItem");
this.alwaysOnToolStripMenuItem.CheckedChanged += new System.EventHandler(this.SATrigger_CheckedChanged);
//
+ // gyroTriggerBehavior
+ //
+ resources.ApplyResources(this.gyroTriggerBehavior, "gyroTriggerBehavior");
+ this.gyroTriggerBehavior.Checked = true;
+ this.gyroTriggerBehavior.CheckState = System.Windows.Forms.CheckState.Checked;
+ this.gyroTriggerBehavior.Name = "gyroTriggerBehavior";
+ this.gyroTriggerBehavior.UseVisualStyleBackColor = true;
+ this.gyroTriggerBehavior.CheckedChanged += new System.EventHandler(this.gyroTriggerBehavior_CheckedChanged);
+ //
// Options
//
resources.ApplyResources(this, "$this");
@@ -3892,5 +3903,6 @@
private System.Windows.Forms.ComboBox lsOutCurveComboBox;
private System.Windows.Forms.Label label10;
private System.Windows.Forms.Label label9;
+ private System.Windows.Forms.CheckBox gyroTriggerBehavior;
}
}
\ No newline at end of file
diff --git a/DS4Windows/DS4Forms/Options.cs b/DS4Windows/DS4Forms/Options.cs
index 7a217a1..5d343d7 100644
--- a/DS4Windows/DS4Forms/Options.cs
+++ b/DS4Windows/DS4Forms/Options.cs
@@ -361,6 +361,7 @@ namespace DS4Windows
btPollRateComboBox.SelectedIndex = getBTPollRate(device);
lsOutCurveComboBox.SelectedIndex = getLsOutCurveMode(device);
rsOutCurveComboBox.SelectedIndex = getRsOutCurveMode(device);
+ gyroTriggerBehavior.Checked = getGyroTriggerTurns(device);
try
{
@@ -594,6 +595,7 @@ namespace DS4Windows
cbStartTouchpadOff.Checked = false;
rBSAControls.Checked = true;
rBTPMouse.Checked = true;
+ gyroTriggerBehavior.Checked = true;
switch (device)
{
case 0: tBRedBar.Value = 0; tBGreenBar.Value = 0; tBBlueBar.Value = 255; break;
@@ -1297,6 +1299,7 @@ namespace DS4Windows
StartTouchpadOff[device] = cbStartTouchpadOff.Checked;
UseTPforControls[device] = rBTPControls.Checked;
UseSAforMouse[device] = rBSAMouse.Checked;
+ GyroTriggerTurns[device] = gyroTriggerBehavior.Checked;
DS4Mapping = cBControllerInput.Checked;
LSCurve[device] = (int)Math.Round(nUDLSCurve.Value, 0);
RSCurve[device] = (int)Math.Round(nUDRSCurve.Value, 0);
@@ -2803,6 +2806,14 @@ namespace DS4Windows
}
}
+ private void gyroTriggerBehavior_CheckedChanged(object sender, EventArgs e)
+ {
+ if (!loading)
+ {
+ GyroTriggerTurns[device] = gyroTriggerBehavior.Checked;
+ }
+ }
+
private void Options_Resize(object sender, EventArgs e)
{
fLPSettings.AutoScroll = false;
diff --git a/DS4Windows/DS4Forms/Options.resx b/DS4Windows/DS4Forms/Options.resx
index c10a48a..a0e7ac1 100644
--- a/DS4Windows/DS4Forms/Options.resx
+++ b/DS4Windows/DS4Forms/Options.resx
@@ -6943,6 +6943,39 @@ with profile
1
+
+ True
+
+
+ NoControl
+
+
+ 5, 41
+
+
+ Yes
+
+
+ 165, 17
+
+
+ 262
+
+
+ Trigger Behavior - Turns Gyro
+
+
+ gyroTriggerBehavior
+
+
+ System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ pnlSAMouse
+
+
+ 0
+
True
@@ -6950,7 +6983,7 @@ with profile
NoControl
- 97, 76
+ 94, 94
Yes
@@ -6974,7 +7007,7 @@ with profile
pnlSAMouse
- 0
+ 1
True
@@ -6983,7 +7016,7 @@ with profile
NoControl
- 54, 76
+ 51, 94
Yes
@@ -7007,7 +7040,7 @@ with profile
pnlSAMouse
- 1
+ 2
True
@@ -7016,7 +7049,7 @@ with profile
NoControl
- 9, 77
+ 6, 95
37, 13
@@ -7040,7 +7073,7 @@ with profile
pnlSAMouse
- 2
+ 3
True
@@ -7073,7 +7106,7 @@ with profile
pnlSAMouse
- 3
+ 4
NoControl
@@ -7103,10 +7136,10 @@ with profile
pnlSAMouse
- 4
+ 5
- 110, 45
+ 110, 65
49, 20
@@ -7124,7 +7157,7 @@ with profile
pnlSAMouse
- 5
+ 6
True
@@ -7133,7 +7166,7 @@ with profile
NoControl
- 6, 46
+ 6, 66
82, 13
@@ -7157,7 +7190,7 @@ with profile
pnlSAMouse
- 6
+ 7
6, 43
@@ -7726,6 +7759,9 @@ with profile
1010, 481
+
+ NoControl
+
4, 4, 4, 4
@@ -8030,7 +8066,7 @@ with profile
advColorDialog
- DS4Windows.AdvancedColorDialog, DS4Windows, Version=1.4.74.0, Culture=neutral, PublicKeyToken=null
+ DS4Windows.AdvancedColorDialog, DS4Windows, Version=1.4.80.0, Culture=neutral, PublicKeyToken=null
Options
diff --git a/DS4Windows/DS4Library/DS4Device.cs b/DS4Windows/DS4Library/DS4Device.cs
index 696b2df..45d3d14 100644
--- a/DS4Windows/DS4Library/DS4Device.cs
+++ b/DS4Windows/DS4Library/DS4Device.cs
@@ -813,11 +813,6 @@ namespace DS4Windows
cState.TouchButton = (inputReport[7] & (1 << 2 - 1)) != 0;
cState.FrameCounter = (byte)(inputReport[7] >> 2);
- // Store Gyro and Accel values
- Array.Copy(inputReport, 13, gyro, 0, 6);
- Array.Copy(inputReport, 19, accel, 0, 6);
- sixAxis.handleSixaxis(gyro, accel, cState);
-
try
{
charging = (inputReport[30] & 0x10) != 0;
@@ -855,6 +850,11 @@ namespace DS4Windows
}
catch { currerror = "Index out of bounds: touchpad"; }
+ // Store Gyro and Accel values
+ Array.Copy(inputReport, 13, gyro, 0, 6);
+ Array.Copy(inputReport, 19, accel, 0, 6);
+ sixAxis.handleSixaxis(gyro, accel, cState);
+
/* Debug output of incoming HID data:
if (cState.L2 == 0xff && cState.R2 == 0xff)
{