This commit is contained in:
mika-n 2019-08-27 21:13:56 +03:00
commit 65a461aa82
6 changed files with 356 additions and 64 deletions

View File

@ -174,14 +174,11 @@ namespace DS4Windows
SixMouseStick(arg); SixMouseStick(arg);
else if (!useReverseRatchet && !triggeractivated) else if (!useReverseRatchet && !triggeractivated)
SixMouseStick(arg); SixMouseStick(arg);
//else else
// SixMouseReset(arg); SixMouseReset(arg);
} }
} }
/*private const int GyroMouseStickDeadZone = 50;
private const int GyroMouseStickMaxZone = 880;
private const int GyroMouseStickFuzz = 20;
private const int SMOOTH_BUFFER_LEN = 3; private const int SMOOTH_BUFFER_LEN = 3;
private int[] xSmoothBuffer = new int[SMOOTH_BUFFER_LEN]; private int[] xSmoothBuffer = new int[SMOOTH_BUFFER_LEN];
private int[] ySmoothBuffer = new int[SMOOTH_BUFFER_LEN]; private int[] ySmoothBuffer = new int[SMOOTH_BUFFER_LEN];
@ -194,7 +191,6 @@ namespace DS4Windows
ySmoothBuffer[iIndex] = 0; ySmoothBuffer[iIndex] = 0;
smoothBufferTail = iIndex + 1; smoothBufferTail = iIndex + 1;
} }
*/
private void SixMouseStick(SixAxisEventArgs arg) private void SixMouseStick(SixAxisEventArgs arg)
{ {
@ -248,34 +244,42 @@ namespace DS4Windows
deltaY = 0; deltaY = 0;
} }
/*int iIndex = smoothBufferTail % SMOOTH_BUFFER_LEN; if (msinfo.useSmoothing)
xSmoothBuffer[iIndex] = deltaX;
ySmoothBuffer[iIndex] = deltaY;
smoothBufferTail = iIndex + 1;
double currentWeight = 1.0;
double finalWeight = 0.0;
double x_out = 0.0, y_out = 0.0;
int idx = 0;
for (int i = 0; i < SMOOTH_BUFFER_LEN; i++)
{ {
idx = (smoothBufferTail - i - 1 + SMOOTH_BUFFER_LEN) % SMOOTH_BUFFER_LEN; int iIndex = smoothBufferTail % SMOOTH_BUFFER_LEN;
x_out += xSmoothBuffer[idx] * currentWeight; xSmoothBuffer[iIndex] = deltaX;
y_out += ySmoothBuffer[idx] * currentWeight; ySmoothBuffer[iIndex] = deltaY;
finalWeight += currentWeight; smoothBufferTail = iIndex + 1;
currentWeight *= 0.5;
double currentWeight = 1.0;
double finalWeight = 0.0;
double x_out = 0.0, y_out = 0.0;
int idx = 0;
for (int i = 0; i < SMOOTH_BUFFER_LEN; i++)
{
idx = (smoothBufferTail - i - 1 + SMOOTH_BUFFER_LEN) % SMOOTH_BUFFER_LEN;
x_out += xSmoothBuffer[idx] * currentWeight;
y_out += ySmoothBuffer[idx] * currentWeight;
finalWeight += currentWeight;
currentWeight *= msinfo.smoothWeight;
}
x_out /= finalWeight;
deltaX = (int)x_out;
y_out /= finalWeight;
deltaY = (int)y_out;
maxValX = deltaX < 0 ? -msinfo.maxZone : msinfo.maxZone;
maxValY = deltaY < 0 ? -msinfo.maxZone : msinfo.maxZone;
maxDirX = deltaX >= 0 ? 127 : -128;
maxDirY = deltaY >= 0 ? 127 : -128;
} }
x_out /= finalWeight; if (msinfo.vertScale != 100)
deltaX = (int)x_out; {
y_out /= finalWeight; double verticalScale = msinfo.vertScale * 0.01;
deltaY = (int)y_out; deltaY = (int)(deltaY * verticalScale);
}
maxValX = deltaX < 0 ? -msinfo.maxZone : msinfo.maxZone;
maxValY = deltaY < 0 ? -msinfo.maxZone : msinfo.maxZone;
maxDirX = deltaX >= 0 ? 127 : -128;
maxDirY = deltaY >= 0 ? 127 : -128;
*/
if (deltaX != 0) xratio = deltaX / (double)maxValX; if (deltaX != 0) xratio = deltaX / (double)maxValX;
if (deltaY != 0) yratio = deltaY / (double)maxValY; if (deltaY != 0) yratio = deltaY / (double)maxValY;

View File

@ -34,7 +34,10 @@ namespace DS4Windows
public int maxZone; public int maxZone;
public double antiDeadX; public double antiDeadX;
public double antiDeadY; public double antiDeadY;
public int vertScale;
// Flags representing invert axis choices // Flags representing invert axis choices
public uint inverted; public uint inverted;
public bool useSmoothing;
public double smoothWeight;
} }
} }

View File

@ -2280,6 +2280,9 @@ namespace DS4Windows
XmlNode xmlGyroMStickAntiDY = m_Xdoc.CreateNode(XmlNodeType.Element, "GyroMouseStickAntiDeadY", null); xmlGyroMStickAntiDY.InnerText = gyroMStickInfo[device].antiDeadY.ToString(); Node.AppendChild(xmlGyroMStickAntiDY); XmlNode xmlGyroMStickAntiDY = m_Xdoc.CreateNode(XmlNodeType.Element, "GyroMouseStickAntiDeadY", null); xmlGyroMStickAntiDY.InnerText = gyroMStickInfo[device].antiDeadY.ToString(); Node.AppendChild(xmlGyroMStickAntiDY);
XmlNode xmlGyroMStickInvert = m_Xdoc.CreateNode(XmlNodeType.Element, "GyroMouseStickInvert", null); xmlGyroMStickInvert.InnerText = gyroMStickInfo[device].inverted.ToString(); Node.AppendChild(xmlGyroMStickInvert); XmlNode xmlGyroMStickInvert = m_Xdoc.CreateNode(XmlNodeType.Element, "GyroMouseStickInvert", null); xmlGyroMStickInvert.InnerText = gyroMStickInfo[device].inverted.ToString(); Node.AppendChild(xmlGyroMStickInvert);
XmlNode xmlGyroMStickToggle = m_Xdoc.CreateNode(XmlNodeType.Element, "GyroMouseStickToggle", null); xmlGyroMStickToggle.InnerText = gyroMouseStickToggle[device].ToString(); Node.AppendChild(xmlGyroMStickToggle); XmlNode xmlGyroMStickToggle = m_Xdoc.CreateNode(XmlNodeType.Element, "GyroMouseStickToggle", null); xmlGyroMStickToggle.InnerText = gyroMouseStickToggle[device].ToString(); Node.AppendChild(xmlGyroMStickToggle);
XmlNode xmlGyroMStickVerticalScale = m_Xdoc.CreateNode(XmlNodeType.Element, "GyroMouseStickVerticalScale", null); xmlGyroMStickVerticalScale.InnerText = gyroMStickInfo[device].vertScale.ToString(); Node.AppendChild(xmlGyroMStickVerticalScale);
XmlNode xmlGyroMStickSmoothing = m_Xdoc.CreateNode(XmlNodeType.Element, "GyroMouseStickSmoothing", null); xmlGyroMStickSmoothing.InnerText = gyroMStickInfo[device].useSmoothing.ToString(); Node.AppendChild(xmlGyroMStickSmoothing);
XmlNode xmlGyroMStickSmoothWeight = m_Xdoc.CreateNode(XmlNodeType.Element, "GyroMouseStickSmoothingWeight", null); xmlGyroMStickSmoothWeight.InnerText = Convert.ToInt32(gyroMStickInfo[device].smoothWeight * 100).ToString(); Node.AppendChild(xmlGyroMStickSmoothWeight);
XmlNode xmlLSC = m_Xdoc.CreateNode(XmlNodeType.Element, "LSCurve", null); xmlLSC.InnerText = lsCurve[device].ToString(); Node.AppendChild(xmlLSC); 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 xmlRSC = m_Xdoc.CreateNode(XmlNodeType.Element, "RSCurve", null); xmlRSC.InnerText = rsCurve[device].ToString(); Node.AppendChild(xmlRSC);
@ -3192,6 +3195,18 @@ namespace DS4Windows
} }
catch { gyroMouseStickToggle[device] = false; missingSetting = true; } catch { gyroMouseStickToggle[device] = false; missingSetting = true; }
try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/GyroMouseStickVerticalScale"); int.TryParse(Item.InnerText, out gyroMStickInfo[device].vertScale); }
catch { gyroMStickInfo[device].vertScale = 100; missingSetting = true; }
try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/GyroMouseStickSmoothing"); bool.TryParse(Item.InnerText, out gyroMStickInfo[device].useSmoothing); }
catch { gyroMStickInfo[device].useSmoothing = false; missingSetting = true; }
try {
Item = m_Xdoc.SelectSingleNode("/" + rootname + "/GyroMouseStickSmoothingWeight");
int temp = 0; int.TryParse(Item.InnerText, out temp);
gyroMStickInfo[device].smoothWeight = Math.Min(Math.Max(0.0, Convert.ToDouble(temp * 0.01)), 1.0);
}
catch { gyroMStickInfo[device].smoothWeight = 0.5; missingSetting = true; }
try try
{ {
@ -4587,8 +4602,9 @@ namespace DS4Windows
sAMouseStickTriggerCond[device] = true; sAMouseStickTriggerCond[device] = true;
gyroMStickInfo[device].deadZone = 30; gyroMStickInfo[device].maxZone = 830; gyroMStickInfo[device].deadZone = 30; gyroMStickInfo[device].maxZone = 830;
gyroMStickInfo[device].antiDeadX = 0.4; gyroMStickInfo[device].antiDeadY = 0.4; gyroMStickInfo[device].antiDeadX = 0.4; gyroMStickInfo[device].antiDeadY = 0.4;
gyroMStickInfo[device].inverted = 0; gyroMStickInfo[device].inverted = 0; gyroMStickInfo[device].vertScale = 100;
gyroMouseStickToggle[device] = false; gyroMouseStickToggle[device] = false;
gyroMStickInfo[device].useSmoothing = false; gyroMStickInfo[device].smoothWeight = 0.5;
sASteeringWheelEmulationAxis[device] = SASteeringWheelEmulationAxisType.None; sASteeringWheelEmulationAxis[device] = SASteeringWheelEmulationAxisType.None;
sASteeringWheelEmulationRange[device] = 360; sASteeringWheelEmulationRange[device] = 360;
touchDisInvertTriggers[device] = new int[1] { -1 }; touchDisInvertTriggers[device] = new int[1] { -1 };

View File

@ -208,6 +208,9 @@
this.gyroMouseStickAntiDeadX = new System.Windows.Forms.NumericUpDown(); this.gyroMouseStickAntiDeadX = new System.Windows.Forms.NumericUpDown();
this.label32 = new System.Windows.Forms.Label(); this.label32 = new System.Windows.Forms.Label();
this.gyroMouseStickAntiDeadY = new System.Windows.Forms.NumericUpDown(); this.gyroMouseStickAntiDeadY = new System.Windows.Forms.NumericUpDown();
this.label37 = new System.Windows.Forms.Label();
this.gyroMStickVertScaleNUD = new System.Windows.Forms.NumericUpDown();
this.label38 = new System.Windows.Forms.Label();
this.label35 = new System.Windows.Forms.Label(); this.label35 = new System.Windows.Forms.Label();
this.gyroMouseStickEvalCombo = new System.Windows.Forms.ComboBox(); this.gyroMouseStickEvalCombo = new System.Windows.Forms.ComboBox();
this.label33 = new System.Windows.Forms.Label(); this.label33 = new System.Windows.Forms.Label();
@ -424,6 +427,9 @@
this.optionsTouchInvStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.optionsTouchInvStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.shareTouchInvStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.shareTouchInvStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.psTouchInvStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.psTouchInvStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.gyroMStickUseSmoothCk = new System.Windows.Forms.CheckBox();
this.gyroMStickSmoothWeightNUD = new System.Windows.Forms.NumericUpDown();
this.label39 = new System.Windows.Forms.Label();
((System.ComponentModel.ISupportInitialize)(this.nUDRainbow)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.nUDRainbow)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.tBBlueBar)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.tBBlueBar)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.tBGreenBar)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.tBGreenBar)).BeginInit();
@ -476,6 +482,7 @@
((System.ComponentModel.ISupportInitialize)(this.gyroMouseStickMaxZ)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.gyroMouseStickMaxZ)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.gyroMouseStickAntiDeadX)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.gyroMouseStickAntiDeadX)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.gyroMouseStickAntiDeadY)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.gyroMouseStickAntiDeadY)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.gyroMStickVertScaleNUD)).BeginInit();
this.tCControls.SuspendLayout(); this.tCControls.SuspendLayout();
this.tPControls.SuspendLayout(); this.tPControls.SuspendLayout();
this.pnlController.SuspendLayout(); this.pnlController.SuspendLayout();
@ -525,6 +532,7 @@
((System.ComponentModel.ISupportInitialize)(this.nUDSZS)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.nUDSZS)).BeginInit();
this.cMGyroTriggers.SuspendLayout(); this.cMGyroTriggers.SuspendLayout();
this.cMTouchDisableInvert.SuspendLayout(); this.cMTouchDisableInvert.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.gyroMStickSmoothWeightNUD)).BeginInit();
this.SuspendLayout(); this.SuspendLayout();
// //
// lowColorChooserButton // lowColorChooserButton
@ -2046,12 +2054,18 @@
this.gyroMouseJoyFLP.Controls.Add(this.gyroMouseStickAntiDeadX); this.gyroMouseJoyFLP.Controls.Add(this.gyroMouseStickAntiDeadX);
this.gyroMouseJoyFLP.Controls.Add(this.label32); this.gyroMouseJoyFLP.Controls.Add(this.label32);
this.gyroMouseJoyFLP.Controls.Add(this.gyroMouseStickAntiDeadY); this.gyroMouseJoyFLP.Controls.Add(this.gyroMouseStickAntiDeadY);
this.gyroMouseJoyFLP.Controls.Add(this.label37);
this.gyroMouseJoyFLP.Controls.Add(this.gyroMStickVertScaleNUD);
this.gyroMouseJoyFLP.Controls.Add(this.label38);
this.gyroMouseJoyFLP.Controls.Add(this.label35); this.gyroMouseJoyFLP.Controls.Add(this.label35);
this.gyroMouseJoyFLP.Controls.Add(this.gyroMouseStickEvalCombo); this.gyroMouseJoyFLP.Controls.Add(this.gyroMouseStickEvalCombo);
this.gyroMouseJoyFLP.Controls.Add(this.label33); this.gyroMouseJoyFLP.Controls.Add(this.label33);
this.gyroMouseJoyFLP.Controls.Add(this.gyroMousestickXAxisCom); this.gyroMouseJoyFLP.Controls.Add(this.gyroMousestickXAxisCom);
this.gyroMouseJoyFLP.Controls.Add(this.gyroMouseStickInvertXCk); this.gyroMouseJoyFLP.Controls.Add(this.gyroMouseStickInvertXCk);
this.gyroMouseJoyFLP.Controls.Add(this.gyroMouseStickInvertYCk); this.gyroMouseJoyFLP.Controls.Add(this.gyroMouseStickInvertYCk);
this.gyroMouseJoyFLP.Controls.Add(this.gyroMStickUseSmoothCk);
this.gyroMouseJoyFLP.Controls.Add(this.label39);
this.gyroMouseJoyFLP.Controls.Add(this.gyroMStickSmoothWeightNUD);
resources.ApplyResources(this.gyroMouseJoyFLP, "gyroMouseJoyFLP"); resources.ApplyResources(this.gyroMouseJoyFLP, "gyroMouseJoyFLP");
this.gyroMouseJoyFLP.Name = "gyroMouseJoyFLP"; this.gyroMouseJoyFLP.Name = "gyroMouseJoyFLP";
// //
@ -2169,6 +2183,32 @@
131072}); 131072});
this.gyroMouseStickAntiDeadY.ValueChanged += new System.EventHandler(this.GyroMouseSStickAntiDeadY_ValueChanged); this.gyroMouseStickAntiDeadY.ValueChanged += new System.EventHandler(this.GyroMouseSStickAntiDeadY_ValueChanged);
// //
// label37
//
resources.ApplyResources(this.label37, "label37");
this.label37.Name = "label37";
//
// gyroMStickVertScaleNUD
//
resources.ApplyResources(this.gyroMStickVertScaleNUD, "gyroMStickVertScaleNUD");
this.gyroMStickVertScaleNUD.Maximum = new decimal(new int[] {
400,
0,
0,
0});
this.gyroMStickVertScaleNUD.Name = "gyroMStickVertScaleNUD";
this.gyroMStickVertScaleNUD.Value = new decimal(new int[] {
100,
0,
0,
0});
this.gyroMStickVertScaleNUD.ValueChanged += new System.EventHandler(this.GyroMStickVertScaleNUD_ValueChanged);
//
// label38
//
resources.ApplyResources(this.label38, "label38");
this.label38.Name = "label38";
//
// label35 // label35
// //
resources.ApplyResources(this.label35, "label35"); resources.ApplyResources(this.label35, "label35");
@ -4557,6 +4597,35 @@
resources.ApplyResources(this.psTouchInvStripMenuItem, "psTouchInvStripMenuItem"); resources.ApplyResources(this.psTouchInvStripMenuItem, "psTouchInvStripMenuItem");
this.psTouchInvStripMenuItem.CheckedChanged += new System.EventHandler(this.TouchDisableInvert_CheckedChanged); this.psTouchInvStripMenuItem.CheckedChanged += new System.EventHandler(this.TouchDisableInvert_CheckedChanged);
// //
// gyroMStickUseSmoothCk
//
resources.ApplyResources(this.gyroMStickUseSmoothCk, "gyroMStickUseSmoothCk");
this.gyroMStickUseSmoothCk.Name = "gyroMStickUseSmoothCk";
this.gyroMStickUseSmoothCk.UseVisualStyleBackColor = true;
this.gyroMStickUseSmoothCk.CheckedChanged += new System.EventHandler(this.GyroMStickUseSmoothCk_CheckedChanged);
//
// gyroMStickSmoothWeightNUD
//
this.gyroMStickSmoothWeightNUD.DecimalPlaces = 3;
resources.ApplyResources(this.gyroMStickSmoothWeightNUD, "gyroMStickSmoothWeightNUD");
this.gyroMStickSmoothWeightNUD.Maximum = new decimal(new int[] {
1,
0,
0,
0});
this.gyroMStickSmoothWeightNUD.Name = "gyroMStickSmoothWeightNUD";
this.gyroMStickSmoothWeightNUD.Value = new decimal(new int[] {
5,
0,
0,
65536});
this.gyroMStickSmoothWeightNUD.ValueChanged += new System.EventHandler(this.GyroMStickSmoothWeightNUD_ValueChanged);
//
// label39
//
resources.ApplyResources(this.label39, "label39");
this.label39.Name = "label39";
//
// Options // Options
// //
resources.ApplyResources(this, "$this"); resources.ApplyResources(this, "$this");
@ -4631,6 +4700,7 @@
((System.ComponentModel.ISupportInitialize)(this.gyroMouseStickMaxZ)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.gyroMouseStickMaxZ)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.gyroMouseStickAntiDeadX)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.gyroMouseStickAntiDeadX)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.gyroMouseStickAntiDeadY)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.gyroMouseStickAntiDeadY)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.gyroMStickVertScaleNUD)).EndInit();
this.tCControls.ResumeLayout(false); this.tCControls.ResumeLayout(false);
this.tPControls.ResumeLayout(false); this.tPControls.ResumeLayout(false);
this.pnlController.ResumeLayout(false); this.pnlController.ResumeLayout(false);
@ -4690,6 +4760,7 @@
((System.ComponentModel.ISupportInitialize)(this.nUDSZS)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.nUDSZS)).EndInit();
this.cMGyroTriggers.ResumeLayout(false); this.cMGyroTriggers.ResumeLayout(false);
this.cMTouchDisableInvert.ResumeLayout(false); this.cMTouchDisableInvert.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.gyroMStickSmoothWeightNUD)).EndInit();
this.ResumeLayout(false); this.ResumeLayout(false);
} }
@ -5092,5 +5163,11 @@
private System.Windows.Forms.Label label35; private System.Windows.Forms.Label label35;
private System.Windows.Forms.ComboBox gyroMouseStickEvalCombo; private System.Windows.Forms.ComboBox gyroMouseStickEvalCombo;
private System.Windows.Forms.CheckBox gyroMStickToggleCk; private System.Windows.Forms.CheckBox gyroMStickToggleCk;
private System.Windows.Forms.Label label37;
private System.Windows.Forms.NumericUpDown gyroMStickVertScaleNUD;
private System.Windows.Forms.Label label38;
private System.Windows.Forms.CheckBox gyroMStickUseSmoothCk;
private System.Windows.Forms.Label label39;
private System.Windows.Forms.NumericUpDown gyroMStickSmoothWeightNUD;
} }
} }

View File

@ -815,6 +815,10 @@ namespace DS4Windows.Forms
gyroMouseStickInvertXCk.Checked = (gyroMouseStickInfo.inverted & 1) == 1; gyroMouseStickInvertXCk.Checked = (gyroMouseStickInfo.inverted & 1) == 1;
gyroMouseStickInvertYCk.Checked = (gyroMouseStickInfo.inverted & 2) == 2; gyroMouseStickInvertYCk.Checked = (gyroMouseStickInfo.inverted & 2) == 2;
gyroMStickToggleCk.Checked = GyroMouseStickToggle[device]; gyroMStickToggleCk.Checked = GyroMouseStickToggle[device];
gyroMStickVertScaleNUD.Value = gyroMouseStickInfo.vertScale;
gyroMStickUseSmoothCk.Checked = gyroMouseStickInfo.useSmoothing;
gyroMStickSmoothWeightNUD.Enabled = gyroMouseStickInfo.useSmoothing;
gyroMStickSmoothWeightNUD.Value = (decimal)gyroMouseStickInfo.smoothWeight;
} }
else else
{ {
@ -960,6 +964,10 @@ namespace DS4Windows.Forms
gyroMouseStickInvertYCk.Checked = false; gyroMouseStickInvertYCk.Checked = false;
gyroMStickTrigBehaveCk.Checked = false; gyroMStickTrigBehaveCk.Checked = false;
gyroMStickToggleCk.Checked = false; gyroMStickToggleCk.Checked = false;
gyroMStickVertScaleNUD.Value = 100;
gyroMStickUseSmoothCk.Checked = false;
gyroMStickSmoothWeightNUD.Enabled = false;
gyroMStickSmoothWeightNUD.Value = 0.5m;
Set(); Set();
} }
@ -1553,24 +1561,29 @@ namespace DS4Windows.Forms
SetSaMouseStickTriggerCond(device, SetSaMouseStickTriggerCond(device,
gyroMouseStickEvalCombo.SelectedItem.ToString().ToLower()); gyroMouseStickEvalCombo.SelectedItem.ToString().ToLower());
GyroMouseStickInfo gyroMouseStickInfo = GyroMouseStickInf[device];
if (GyroMouseStickDead()) if (GyroMouseStickDead())
{ {
GyroMouseStickInf[device].deadZone = (int)gyroMouseStickDZ.Value; gyroMouseStickInfo.deadZone = (int)gyroMouseStickDZ.Value;
GyroMouseStickInf[device].maxZone = (int)gyroMouseStickMaxZ.Value; gyroMouseStickInfo.maxZone = (int)gyroMouseStickMaxZ.Value;
} }
else else
{ {
GyroMouseStickInf[device].deadZone = (int)gyroMouseStickMaxZ.Value; gyroMouseStickInfo.deadZone = (int)gyroMouseStickMaxZ.Value;
GyroMouseStickInf[device].maxZone = (int)gyroMouseStickMaxZ.Value; gyroMouseStickInfo.maxZone = (int)gyroMouseStickMaxZ.Value;
} }
GyroMouseStickInf[device].antiDeadX = (double)gyroMouseStickAntiDeadX.Value; gyroMouseStickInfo.antiDeadX = (double)gyroMouseStickAntiDeadX.Value;
GyroMouseStickInf[device].antiDeadY = (double)gyroMouseStickAntiDeadY.Value; gyroMouseStickInfo.antiDeadY = (double)gyroMouseStickAntiDeadY.Value;
GyroMouseStickHorizontalAxis[device] = gyroMousestickXAxisCom.SelectedIndex; GyroMouseStickHorizontalAxis[device] = gyroMousestickXAxisCom.SelectedIndex;
uint tempInvert = 0; uint tempInvert = 0;
if (gyroMouseStickInvertXCk.Checked) tempInvert |= 1 << 0; if (gyroMouseStickInvertXCk.Checked) tempInvert |= 1 << 0;
if (gyroMouseStickInvertYCk.Checked) tempInvert |= 1 << 1; if (gyroMouseStickInvertYCk.Checked) tempInvert |= 1 << 1;
GyroMouseStickInf[device].inverted = tempInvert; gyroMouseStickInfo.inverted = tempInvert;
gyroMouseStickInfo.vertScale = (int)gyroMStickVertScaleNUD.Value;
gyroMouseStickInfo.useSmoothing = gyroMStickUseSmoothCk.Checked;
gyroMouseStickInfo.smoothWeight = (double)gyroMStickSmoothWeightNUD.Value;
} }
private void Show_ControlsBtn(object sender, EventArgs e) private void Show_ControlsBtn(object sender, EventArgs e)
@ -3586,9 +3599,13 @@ namespace DS4Windows.Forms
break; break;
case 1: case 1:
GyroOutputMode[device] = GyroOutMode.Mouse; GyroOutputMode[device] = GyroOutMode.Mouse;
SetGyroMouseToggle(device, toggleGyroMCb.Checked,
Program.rootHub);
break; break;
case 2: case 2:
GyroOutputMode[device] = GyroOutMode.MouseJoystick; GyroOutputMode[device] = GyroOutMode.MouseJoystick;
SetGyroMouseStickToggle(device,
gyroMStickToggleCk.Checked, Program.rootHub);
break; break;
default: default:
break; break;
@ -3681,6 +3698,34 @@ namespace DS4Windows.Forms
} }
} }
private void GyroMStickVertScaleNUD_ValueChanged(object sender, EventArgs e)
{
if (loading == false)
{
GyroMouseStickInf[device].vertScale = (int)gyroMStickVertScaleNUD.Value;
}
}
private void GyroMStickSmoothWeightNUD_ValueChanged(object sender, EventArgs e)
{
if (loading == false)
{
GyroMouseStickInf[device].smoothWeight =
(double)gyroMStickSmoothWeightNUD.Value;
}
}
private void GyroMStickUseSmoothCk_CheckedChanged(object sender, EventArgs e)
{
if (loading == false)
{
GyroMouseStickInf[device].useSmoothing =
gyroMStickUseSmoothCk.Checked;
gyroMStickSmoothWeightNUD.Enabled =
GyroMouseStickInf[device].useSmoothing;
}
}
private void trackFrictionNUD_ValueChanged(object sender, EventArgs e) private void trackFrictionNUD_ValueChanged(object sender, EventArgs e)
{ {
if (loading == false) if (loading == false)

View File

@ -4936,7 +4936,7 @@
<value>6, 47</value> <value>6, 47</value>
</data> </data>
<data name="fLPTiltControls.Size" type="System.Drawing.Size, System.Drawing"> <data name="fLPTiltControls.Size" type="System.Drawing.Size, System.Drawing">
<value>271, 195</value> <value>271, 199</value>
</data> </data>
<data name="fLPTiltControls.TabIndex" type="System.Int32, mscorlib"> <data name="fLPTiltControls.TabIndex" type="System.Int32, mscorlib">
<value>254</value> <value>254</value>
@ -5679,6 +5679,81 @@
<data name="&gt;&gt;gyroMouseStickAntiDeadY.ZOrder" xml:space="preserve"> <data name="&gt;&gt;gyroMouseStickAntiDeadY.ZOrder" xml:space="preserve">
<value>11</value> <value>11</value>
</data> </data>
<data name="label37.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="label37.Location" type="System.Drawing.Point, System.Drawing">
<value>3, 104</value>
</data>
<data name="label37.Size" type="System.Drawing.Size, System.Drawing">
<value>75, 13</value>
</data>
<data name="label37.TabIndex" type="System.Int32, mscorlib">
<value>280</value>
</data>
<data name="label37.Text" xml:space="preserve">
<value>Vertical Scale:</value>
</data>
<data name="&gt;&gt;label37.Name" xml:space="preserve">
<value>label37</value>
</data>
<data name="&gt;&gt;label37.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;label37.Parent" xml:space="preserve">
<value>gyroMouseJoyFLP</value>
</data>
<data name="&gt;&gt;label37.ZOrder" xml:space="preserve">
<value>12</value>
</data>
<data name="gyroMStickVertScaleNUD.Location" type="System.Drawing.Point, System.Drawing">
<value>84, 107</value>
</data>
<data name="gyroMStickVertScaleNUD.Size" type="System.Drawing.Size, System.Drawing">
<value>75, 20</value>
</data>
<data name="gyroMStickVertScaleNUD.TabIndex" type="System.Int32, mscorlib">
<value>281</value>
</data>
<data name="&gt;&gt;gyroMStickVertScaleNUD.Name" xml:space="preserve">
<value>gyroMStickVertScaleNUD</value>
</data>
<data name="&gt;&gt;gyroMStickVertScaleNUD.Type" xml:space="preserve">
<value>System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;gyroMStickVertScaleNUD.Parent" xml:space="preserve">
<value>gyroMouseJoyFLP</value>
</data>
<data name="&gt;&gt;gyroMStickVertScaleNUD.ZOrder" xml:space="preserve">
<value>13</value>
</data>
<data name="label38.Location" type="System.Drawing.Point, System.Drawing">
<value>165, 104</value>
</data>
<data name="label38.Size" type="System.Drawing.Size, System.Drawing">
<value>20, 23</value>
</data>
<data name="label38.TabIndex" type="System.Int32, mscorlib">
<value>282</value>
</data>
<data name="label38.Text" xml:space="preserve">
<value>%</value>
</data>
<data name="label38.TextAlign" type="System.Drawing.ContentAlignment, System.Drawing">
<value>MiddleCenter</value>
</data>
<data name="&gt;&gt;label38.Name" xml:space="preserve">
<value>label38</value>
</data>
<data name="&gt;&gt;label38.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;label38.Parent" xml:space="preserve">
<value>gyroMouseJoyFLP</value>
</data>
<data name="&gt;&gt;label38.ZOrder" xml:space="preserve">
<value>14</value>
</data>
<data name="label35.AutoSize" type="System.Boolean, mscorlib"> <data name="label35.AutoSize" type="System.Boolean, mscorlib">
<value>True</value> <value>True</value>
</data> </data>
@ -5686,7 +5761,7 @@
<value>NoControl</value> <value>NoControl</value>
</data> </data>
<data name="label35.Location" type="System.Drawing.Point, System.Drawing"> <data name="label35.Location" type="System.Drawing.Point, System.Drawing">
<value>3, 104</value> <value>3, 130</value>
</data> </data>
<data name="label35.Size" type="System.Drawing.Size, System.Drawing"> <data name="label35.Size" type="System.Drawing.Size, System.Drawing">
<value>59, 13</value> <value>59, 13</value>
@ -5707,7 +5782,7 @@
<value>gyroMouseJoyFLP</value> <value>gyroMouseJoyFLP</value>
</data> </data>
<data name="&gt;&gt;label35.ZOrder" xml:space="preserve"> <data name="&gt;&gt;label35.ZOrder" xml:space="preserve">
<value>12</value> <value>15</value>
</data> </data>
<data name="gyroMouseStickEvalCombo.Items" xml:space="preserve"> <data name="gyroMouseStickEvalCombo.Items" xml:space="preserve">
<value>And</value> <value>And</value>
@ -5716,7 +5791,7 @@
<value>Or</value> <value>Or</value>
</data> </data>
<data name="gyroMouseStickEvalCombo.Location" type="System.Drawing.Point, System.Drawing"> <data name="gyroMouseStickEvalCombo.Location" type="System.Drawing.Point, System.Drawing">
<value>68, 107</value> <value>68, 133</value>
</data> </data>
<data name="gyroMouseStickEvalCombo.Size" type="System.Drawing.Size, System.Drawing"> <data name="gyroMouseStickEvalCombo.Size" type="System.Drawing.Size, System.Drawing">
<value>72, 21</value> <value>72, 21</value>
@ -5734,13 +5809,13 @@
<value>gyroMouseJoyFLP</value> <value>gyroMouseJoyFLP</value>
</data> </data>
<data name="&gt;&gt;gyroMouseStickEvalCombo.ZOrder" xml:space="preserve"> <data name="&gt;&gt;gyroMouseStickEvalCombo.ZOrder" xml:space="preserve">
<value>13</value> <value>16</value>
</data> </data>
<data name="label33.AutoSize" type="System.Boolean, mscorlib"> <data name="label33.AutoSize" type="System.Boolean, mscorlib">
<value>True</value> <value>True</value>
</data> </data>
<data name="label33.Location" type="System.Drawing.Point, System.Drawing"> <data name="label33.Location" type="System.Drawing.Point, System.Drawing">
<value>146, 104</value> <value>146, 130</value>
</data> </data>
<data name="label33.Size" type="System.Drawing.Size, System.Drawing"> <data name="label33.Size" type="System.Drawing.Size, System.Drawing">
<value>39, 13</value> <value>39, 13</value>
@ -5761,7 +5836,7 @@
<value>gyroMouseJoyFLP</value> <value>gyroMouseJoyFLP</value>
</data> </data>
<data name="&gt;&gt;label33.ZOrder" xml:space="preserve"> <data name="&gt;&gt;label33.ZOrder" xml:space="preserve">
<value>14</value> <value>17</value>
</data> </data>
<data name="gyroMousestickXAxisCom.Items" xml:space="preserve"> <data name="gyroMousestickXAxisCom.Items" xml:space="preserve">
<value>Yaw</value> <value>Yaw</value>
@ -5770,7 +5845,7 @@
<value>Roll</value> <value>Roll</value>
</data> </data>
<data name="gyroMousestickXAxisCom.Location" type="System.Drawing.Point, System.Drawing"> <data name="gyroMousestickXAxisCom.Location" type="System.Drawing.Point, System.Drawing">
<value>191, 107</value> <value>191, 133</value>
</data> </data>
<data name="gyroMousestickXAxisCom.Size" type="System.Drawing.Size, System.Drawing"> <data name="gyroMousestickXAxisCom.Size" type="System.Drawing.Size, System.Drawing">
<value>56, 21</value> <value>56, 21</value>
@ -5788,19 +5863,16 @@
<value>gyroMouseJoyFLP</value> <value>gyroMouseJoyFLP</value>
</data> </data>
<data name="&gt;&gt;gyroMousestickXAxisCom.ZOrder" xml:space="preserve"> <data name="&gt;&gt;gyroMousestickXAxisCom.ZOrder" xml:space="preserve">
<value>15</value> <value>18</value>
</data>
<data name="gyroMouseStickInvertXCk.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data> </data>
<data name="gyroMouseStickInvertXCk.Location" type="System.Drawing.Point, System.Drawing"> <data name="gyroMouseStickInvertXCk.Location" type="System.Drawing.Point, System.Drawing">
<value>3, 134</value> <value>3, 160</value>
</data> </data>
<data name="gyroMouseStickInvertXCk.RightToLeft" type="System.Windows.Forms.RightToLeft, System.Windows.Forms"> <data name="gyroMouseStickInvertXCk.RightToLeft" type="System.Windows.Forms.RightToLeft, System.Windows.Forms">
<value>Yes</value> <value>No</value>
</data> </data>
<data name="gyroMouseStickInvertXCk.Size" type="System.Drawing.Size, System.Drawing"> <data name="gyroMouseStickInvertXCk.Size" type="System.Drawing.Size, System.Drawing">
<value>63, 17</value> <value>96, 17</value>
</data> </data>
<data name="gyroMouseStickInvertXCk.TabIndex" type="System.Int32, mscorlib"> <data name="gyroMouseStickInvertXCk.TabIndex" type="System.Int32, mscorlib">
<value>11</value> <value>11</value>
@ -5818,19 +5890,16 @@
<value>gyroMouseJoyFLP</value> <value>gyroMouseJoyFLP</value>
</data> </data>
<data name="&gt;&gt;gyroMouseStickInvertXCk.ZOrder" xml:space="preserve"> <data name="&gt;&gt;gyroMouseStickInvertXCk.ZOrder" xml:space="preserve">
<value>16</value> <value>19</value>
</data>
<data name="gyroMouseStickInvertYCk.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data> </data>
<data name="gyroMouseStickInvertYCk.Location" type="System.Drawing.Point, System.Drawing"> <data name="gyroMouseStickInvertYCk.Location" type="System.Drawing.Point, System.Drawing">
<value>72, 134</value> <value>105, 160</value>
</data> </data>
<data name="gyroMouseStickInvertYCk.RightToLeft" type="System.Windows.Forms.RightToLeft, System.Windows.Forms"> <data name="gyroMouseStickInvertYCk.RightToLeft" type="System.Windows.Forms.RightToLeft, System.Windows.Forms">
<value>Yes</value> <value>No</value>
</data> </data>
<data name="gyroMouseStickInvertYCk.Size" type="System.Drawing.Size, System.Drawing"> <data name="gyroMouseStickInvertYCk.Size" type="System.Drawing.Size, System.Drawing">
<value>63, 17</value> <value>127, 17</value>
</data> </data>
<data name="gyroMouseStickInvertYCk.TabIndex" type="System.Int32, mscorlib"> <data name="gyroMouseStickInvertYCk.TabIndex" type="System.Int32, mscorlib">
<value>12</value> <value>12</value>
@ -5848,13 +5917,91 @@
<value>gyroMouseJoyFLP</value> <value>gyroMouseJoyFLP</value>
</data> </data>
<data name="&gt;&gt;gyroMouseStickInvertYCk.ZOrder" xml:space="preserve"> <data name="&gt;&gt;gyroMouseStickInvertYCk.ZOrder" xml:space="preserve">
<value>17</value> <value>20</value>
</data>
<data name="gyroMStickUseSmoothCk.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="gyroMStickUseSmoothCk.Location" type="System.Drawing.Point, System.Drawing">
<value>3, 183</value>
</data>
<data name="gyroMStickUseSmoothCk.RightToLeft" type="System.Windows.Forms.RightToLeft, System.Windows.Forms">
<value>Yes</value>
</data>
<data name="gyroMStickUseSmoothCk.Size" type="System.Drawing.Size, System.Drawing">
<value>76, 17</value>
</data>
<data name="gyroMStickUseSmoothCk.TabIndex" type="System.Int32, mscorlib">
<value>283</value>
</data>
<data name="gyroMStickUseSmoothCk.Text" xml:space="preserve">
<value>Smoothing</value>
</data>
<data name="&gt;&gt;gyroMStickUseSmoothCk.Name" xml:space="preserve">
<value>gyroMStickUseSmoothCk</value>
</data>
<data name="&gt;&gt;gyroMStickUseSmoothCk.Type" xml:space="preserve">
<value>System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;gyroMStickUseSmoothCk.Parent" xml:space="preserve">
<value>gyroMouseJoyFLP</value>
</data>
<data name="&gt;&gt;gyroMStickUseSmoothCk.ZOrder" xml:space="preserve">
<value>21</value>
</data>
<data name="label39.Location" type="System.Drawing.Point, System.Drawing">
<value>85, 180</value>
</data>
<data name="label39.Size" type="System.Drawing.Size, System.Drawing">
<value>60, 23</value>
</data>
<data name="label39.TabIndex" type="System.Int32, mscorlib">
<value>285</value>
</data>
<data name="label39.Text" xml:space="preserve">
<value>Weight:</value>
</data>
<data name="label39.TextAlign" type="System.Drawing.ContentAlignment, System.Drawing">
<value>MiddleCenter</value>
</data>
<data name="&gt;&gt;label39.Name" xml:space="preserve">
<value>label39</value>
</data>
<data name="&gt;&gt;label39.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;label39.Parent" xml:space="preserve">
<value>gyroMouseJoyFLP</value>
</data>
<data name="&gt;&gt;label39.ZOrder" xml:space="preserve">
<value>22</value>
</data>
<data name="gyroMStickSmoothWeightNUD.Location" type="System.Drawing.Point, System.Drawing">
<value>151, 183</value>
</data>
<data name="gyroMStickSmoothWeightNUD.Size" type="System.Drawing.Size, System.Drawing">
<value>72, 20</value>
</data>
<data name="gyroMStickSmoothWeightNUD.TabIndex" type="System.Int32, mscorlib">
<value>284</value>
</data>
<data name="&gt;&gt;gyroMStickSmoothWeightNUD.Name" xml:space="preserve">
<value>gyroMStickSmoothWeightNUD</value>
</data>
<data name="&gt;&gt;gyroMStickSmoothWeightNUD.Type" xml:space="preserve">
<value>System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;gyroMStickSmoothWeightNUD.Parent" xml:space="preserve">
<value>gyroMouseJoyFLP</value>
</data>
<data name="&gt;&gt;gyroMStickSmoothWeightNUD.ZOrder" xml:space="preserve">
<value>23</value>
</data> </data>
<data name="gyroMouseJoyFLP.Location" type="System.Drawing.Point, System.Drawing"> <data name="gyroMouseJoyFLP.Location" type="System.Drawing.Point, System.Drawing">
<value>8, 47</value> <value>8, 47</value>
</data> </data>
<data name="gyroMouseJoyFLP.Size" type="System.Drawing.Size, System.Drawing"> <data name="gyroMouseJoyFLP.Size" type="System.Drawing.Size, System.Drawing">
<value>252, 181</value> <value>252, 210</value>
</data> </data>
<data name="gyroMouseJoyFLP.TabIndex" type="System.Int32, mscorlib"> <data name="gyroMouseJoyFLP.TabIndex" type="System.Int32, mscorlib">
<value>260</value> <value>260</value>