From 78ef0fcd9d6e6523603375f403f2731b8010b356 Mon Sep 17 00:00:00 2001 From: Travis Nickles Date: Sat, 5 Oct 2019 21:57:20 -0500 Subject: [PATCH] Found a couple of old Jays2Kings bugs Default gyro triggers and shift action scan code check --- DS4Windows/DS4Control/ScpUtil.cs | 12 ++++++------ DS4Windows/DS4Forms/Options.cs | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/DS4Windows/DS4Control/ScpUtil.cs b/DS4Windows/DS4Control/ScpUtil.cs index 0e26dc1..b3968f9 100644 --- a/DS4Windows/DS4Control/ScpUtil.cs +++ b/DS4Windows/DS4Control/ScpUtil.cs @@ -1895,8 +1895,8 @@ namespace DS4Windows public bool[] useSAforMouse = new bool[5] { false, false, false, false, false }; public GyroOutMode[] gyroOutMode = new GyroOutMode[5] { GyroOutMode.Controls, GyroOutMode.Controls, GyroOutMode.Controls, GyroOutMode.Controls, GyroOutMode.Controls }; - public string[] sATriggers = new string[5] { string.Empty, string.Empty, string.Empty, string.Empty, string.Empty }; - public string[] sAMouseStickTriggers = new string[5] { string.Empty, string.Empty, string.Empty, string.Empty, string.Empty }; + public string[] sATriggers = new string[5] { "-1", "-1", "-1", "-1", "-1" }; + public string[] sAMouseStickTriggers = new string[5] { "-1", "-1", "-1", "-1", "-1" }; public bool[] sATriggerCond = new bool[5] { true, true, true, true, true }; public bool[] sAMouseStickTriggerCond = new bool[5] { true, true, true, true, true }; public bool[] gyroMouseStickTriggerTurns = new bool[5] { true, true, true, true, true }; @@ -3148,7 +3148,7 @@ namespace DS4Windows catch { gyroOutMode[device] = GyroOutMode.Controls; missingSetting = true; } try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/SATriggers"); sATriggers[device] = Item.InnerText; } - catch { sATriggers[device] = ""; missingSetting = true; } + catch { sATriggers[device] = "-1"; missingSetting = true; } try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/SATriggerCond"); sATriggerCond[device] = SaTriggerCondValue(Item.InnerText); } catch { sATriggerCond[device] = true; missingSetting = true; } @@ -3164,7 +3164,7 @@ namespace DS4Windows catch { PortOldGyroSettings(device); missingSetting = true; } try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/GyroMouseStickTriggers"); sAMouseStickTriggers[device] = Item.InnerText; } - catch { sAMouseStickTriggers[device] = ""; missingSetting = true; } + catch { sAMouseStickTriggers[device] = "-1"; missingSetting = true; } try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/GyroMouseStickTriggerCond"); sAMouseStickTriggerCond[device] = SaTriggerCondValue(Item.InnerText); } catch { sAMouseStickTriggerCond[device] = true; missingSetting = true; } @@ -4613,10 +4613,10 @@ namespace DS4Windows startTouchpadOff[device] = false; useTPforControls[device] = false; useSAforMouse[device] = false; - sATriggers[device] = string.Empty; + sATriggers[device] = "-1"; sATriggerCond[device] = true; gyroOutMode[device] = GyroOutMode.Controls; - sAMouseStickTriggers[device] = string.Empty; + sAMouseStickTriggers[device] = "-1"; sAMouseStickTriggerCond[device] = true; gyroMStickInfo[device].deadZone = 30; gyroMStickInfo[device].maxZone = 830; gyroMStickInfo[device].antiDeadX = 0.4; gyroMStickInfo[device].antiDeadY = 0.4; diff --git a/DS4Windows/DS4Forms/Options.cs b/DS4Windows/DS4Forms/Options.cs index 4a53222..55e8c95 100644 --- a/DS4Windows/DS4Forms/Options.cs +++ b/DS4Windows/DS4Forms/Options.cs @@ -2223,10 +2223,10 @@ namespace DS4Windows.Forms lbGyroXP.Text = UpdateButtonList(bnGyroXP); } - private string UpdateButtonList(Button button, bool shift =false) + private string UpdateButtonList(Button button, bool shift = false) { object tagO = GetDS4Action(device, button.Name, shift); - bool SC = GetDS4KeyType(device, button.Name, false).HasFlag(DS4KeyType.ScanCode); + bool SC = GetDS4KeyType(device, button.Name, shift).HasFlag(DS4KeyType.ScanCode); bool extracontrol = button.Name.Contains("Gyro") || button.Name.Contains("Swipe"); if (tagO != null) {