Fixed issue with gyro triggers getting reset

This commit is contained in:
Travis Nickles 2019-08-23 21:39:22 -05:00
parent 5bc8346fe6
commit 78cf371dce
2 changed files with 10 additions and 9 deletions

View File

@ -3552,7 +3552,8 @@ namespace DS4Windows
containsCustomAction[device] = HasCustomActions(device); containsCustomAction[device] = HasCustomActions(device);
containsCustomExtras[device] = HasCustomExtras(device); containsCustomExtras[device] = HasCustomExtras(device);
Program.rootHub.touchPad[device]?.ResetToggleGyroM(); if (device < 4)
Program.rootHub.touchPad[device]?.ResetToggleGyroM();
// If a device exists, make sure to transfer relevant profile device // If a device exists, make sure to transfer relevant profile device
// options to device instance // options to device instance

View File

@ -735,7 +735,7 @@ namespace DS4Windows.Forms
Program.rootHub.touchPad[device]?.ResetTrackAccel(TrackballFriction[device]); Program.rootHub.touchPad[device]?.ResetTrackAccel(TrackballFriction[device]);
} }
ResetGyroTriggers(); ResetGyroTriggers(true);
for (int i = 0, arlen = cMTouchDisableInvert.Items.Count; i < arlen; i++) for (int i = 0, arlen = cMTouchDisableInvert.Items.Count; i < arlen; i++)
{ {
@ -745,11 +745,11 @@ namespace DS4Windows.Forms
string[] satriggers; string[] satriggers;
satriggers = SATriggers[device].Split(','); satriggers = SATriggers[device].Split(',');
btnGyroTriggers.Text = GetGyroTriggerActionString(ref satriggers); btnGyroTriggers.Text = GetGyroTriggerActionString(ref satriggers);
if (gyroOut == GyroOutMode.Mouse) MarkCurrentGyroTriggers(ref satriggers); if (gyroOut == GyroOutMode.Mouse) MarkCurrentGyroTriggers(ref satriggers, true);
satriggers = SAMousestickTriggers[device].Split(','); satriggers = SAMousestickTriggers[device].Split(',');
btnGyroMStickTrig.Text = GetGyroTriggerActionString(ref satriggers); btnGyroMStickTrig.Text = GetGyroTriggerActionString(ref satriggers);
if (gyroOut == GyroOutMode.MouseJoystick) MarkCurrentGyroTriggers(ref satriggers); if (gyroOut == GyroOutMode.MouseJoystick) MarkCurrentGyroTriggers(ref satriggers, true);
List<string> s = new List<string>(); List<string> s = new List<string>();
int[] touchDisInvTriggers = TouchDisInvertTriggers[device]; int[] touchDisInvTriggers = TouchDisInvertTriggers[device];
@ -935,7 +935,7 @@ namespace DS4Windows.Forms
Program.rootHub.touchPad[device]?.ResetTrackAccel(10.0); Program.rootHub.touchPad[device]?.ResetTrackAccel(10.0);
} }
ResetGyroTriggers(); ResetGyroTriggers(true);
((ToolStripMenuItem)cMGyroTriggers.Items[cMGyroTriggers.Items.Count - 1]).Checked = true; ((ToolStripMenuItem)cMGyroTriggers.Items[cMGyroTriggers.Items.Count - 1]).Checked = true;
for (int i = 0, arlen = cMTouchDisableInvert.Items.Count; i < arlen; i++) for (int i = 0, arlen = cMTouchDisableInvert.Items.Count; i < arlen; i++)
@ -1049,7 +1049,7 @@ namespace DS4Windows.Forms
btnSATrackS.Visible = on; btnSATrackS.Visible = on;
} }
private void ResetGyroTriggers() private void ResetGyroTriggers(bool loadstate = false)
{ {
loading = true; loading = true;
for (int i = 0, arlen = cMGyroTriggers.Items.Count; i < arlen; i++) for (int i = 0, arlen = cMGyroTriggers.Items.Count; i < arlen; i++)
@ -1057,7 +1057,7 @@ namespace DS4Windows.Forms
((ToolStripMenuItem)cMGyroTriggers.Items[i]).Checked = false; ((ToolStripMenuItem)cMGyroTriggers.Items[i]).Checked = false;
} }
loading = false; loading = loadstate;
} }
private string GetGyroTriggerActionString(ref string[] satriggers) private string GetGyroTriggerActionString(ref string[] satriggers)
@ -1093,7 +1093,7 @@ namespace DS4Windows.Forms
return result; return result;
} }
private void MarkCurrentGyroTriggers(ref string[] satriggers) private void MarkCurrentGyroTriggers(ref string[] satriggers, bool loadstate = false)
{ {
loading = true; loading = true;
int gyroTriggerCount = cMGyroTriggers.Items.Count; int gyroTriggerCount = cMGyroTriggers.Items.Count;
@ -1120,7 +1120,7 @@ namespace DS4Windows.Forms
} }
} }
loading = false; loading = loadstate;
} }
private void ControllerReadout_Tick(object sender, EventArgs e) private void ControllerReadout_Tick(object sender, EventArgs e)