diff --git a/DS4Windows/DS4Control/ScpUtil.cs b/DS4Windows/DS4Control/ScpUtil.cs index 93ecaf71d..f4667c39f 100644 --- a/DS4Windows/DS4Control/ScpUtil.cs +++ b/DS4Windows/DS4Control/ScpUtil.cs @@ -3207,6 +3207,7 @@ public class BackingStore public const int DEFAULT_DS4_BT_POLL_RATE = 4; public const int DEFAULT_RUMBLE = 100; public const double DEFAULT_ANALOG_SENS = 1.0; + public const bool DEFAULT_DINPUT_ONLY = false; // Stick output curve consts in place more as a precaution public const string DEFAULT_STICK_OUTPUT_CURVE = "linear"; @@ -3516,7 +3517,10 @@ public void setSZOutCurveMode(int index, int value) }; public string[] launchProgram = new string[Global.TEST_PROFILE_ITEM_COUNT] { string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty }; - public bool[] dinputOnly = new bool[Global.TEST_PROFILE_ITEM_COUNT] { false, false, false, false, false, false, false, false, false }; + public bool[] dinputOnly = new bool[Global.TEST_PROFILE_ITEM_COUNT] + { DEFAULT_DINPUT_ONLY, DEFAULT_DINPUT_ONLY, DEFAULT_DINPUT_ONLY, + DEFAULT_DINPUT_ONLY, DEFAULT_DINPUT_ONLY, DEFAULT_DINPUT_ONLY, + DEFAULT_DINPUT_ONLY, DEFAULT_DINPUT_ONLY, DEFAULT_DINPUT_ONLY }; public bool[] startTouchpadOff = new bool[Global.TEST_PROFILE_ITEM_COUNT] { false, false, false, false, false, false, false, false, false }; public TouchpadOutMode[] touchOutMode = new TouchpadOutMode[Global.TEST_PROFILE_ITEM_COUNT] { TouchpadOutMode.Mouse, TouchpadOutMode.Mouse, TouchpadOutMode.Mouse, TouchpadOutMode.Mouse, TouchpadOutMode.Mouse, TouchpadOutMode.Mouse, TouchpadOutMode.Mouse, TouchpadOutMode.Mouse, TouchpadOutMode.Mouse }; @@ -9295,7 +9299,7 @@ private void ResetProfile(int device) lightInfo.ledAsBattery = false; launchProgram[device] = string.Empty; - dinputOnly[device] = false; + dinputOnly[device] = DEFAULT_DINPUT_ONLY; startTouchpadOff[device] = false; touchOutMode[device] = TouchpadOutMode.Mouse; sATriggers[device] = BackingStore.DEFAULT_SA_TRIGGERS; diff --git a/DS4WindowsTests/ProfileMigrationTests.cs b/DS4WindowsTests/ProfileMigrationTests.cs index 0730244f2..6df2cfc54 100644 --- a/DS4WindowsTests/ProfileMigrationTests.cs +++ b/DS4WindowsTests/ProfileMigrationTests.cs @@ -402,6 +402,10 @@ public void CheckJaysProfileRead() Assert.AreEqual("0,0,255", $"{profileColor.red},{profileColor.green},{profileColor.blue}"); + // Test if output device type has been set properly. Uses default value from ProfileDTO + Assert.AreEqual(OutContType.X360, tempStore.outputDevType[0]); + Assert.AreEqual(BackingStore.DEFAULT_DINPUT_ONLY, tempStore.dinputOnly[0]); + // Check that profile migration worked as expected string testMigratedProfileStr = ObtainConvertedJaysXML(tempStore); Assert.AreEqual(ds4winJays2KingsExpectedMigratedProfile, testMigratedProfileStr);