diff --git a/DS4Windows/DS4Control/ControlService.cs b/DS4Windows/DS4Control/ControlService.cs index 9999089..859cecf 100644 --- a/DS4Windows/DS4Control/ControlService.cs +++ b/DS4Windows/DS4Control/ControlService.cs @@ -23,7 +23,7 @@ namespace DS4Windows public DS4StateExposed[] ExposedState = new DS4StateExposed[DS4_CONTROLLER_COUNT]; public bool recordingMacro = false; public event EventHandler Debug = null; - bool[] buttonsdown = { false, false, false, false }; + bool[] buttonsdown = new bool[4] { false, false, false, false }; List dcs = new List(); bool[] held = new bool[DS4_CONTROLLER_COUNT]; int[] oldmouse = new int[DS4_CONTROLLER_COUNT] { -1, -1, -1, -1 }; @@ -249,7 +249,7 @@ namespace DS4Windows DS4LightBar.updateLightBar(DS4Controllers[i], i, CurrentState[i], ExposedState[i], touchPad[i]); tempDevice.IsRemoved = true; - System.Threading.Thread.Sleep(50); + Thread.Sleep(50); } CurrentState[i].Battery = PreviousState[i].Battery = 0; // Reset for the next connection's initial status change. @@ -264,7 +264,7 @@ namespace DS4Windows } if (anyUnplugged) - System.Threading.Thread.Sleep(XINPUT_UNPLUG_SETTLE_TIME); + Thread.Sleep(XINPUT_UNPLUG_SETTLE_TIME); x360Bus.UnplugAll(); x360Bus.Stop(); @@ -691,10 +691,10 @@ namespace DS4Windows } } - public bool[] lag = { false, false, false, false }; - public bool[] inWarnMonitor = { false, false, false, false }; - private byte[] currentBattery = { 0, 0, 0, 0 }; - private bool[] charging = { false, false, false, false }; + public bool[] lag = new bool[4] { false, false, false, false }; + public bool[] inWarnMonitor = new bool[4] { false, false, false, false }; + private byte[] currentBattery = new byte[4] { 0, 0, 0, 0 }; + private bool[] charging = new bool[4] { false, false, false, false }; // Called every time a new input report has arrived protected virtual void On_Report(object sender, EventArgs e) @@ -747,7 +747,7 @@ namespace DS4Windows } } - device.getExposedState(ExposedState[ind], CurrentState[ind]); + device.getCurrentState(CurrentState[ind]); DS4State cState = CurrentState[ind]; device.getPreviousState(PreviousState[ind]); DS4State pState = PreviousState[ind]; @@ -963,9 +963,11 @@ namespace DS4Windows return result; } - public bool[] touchreleased = { true, true, true, true }, touchslid = { false, false, false, false }; - public byte[] oldtouchvalue = { 0, 0, 0, 0 }; - public int[] oldscrollvalue = { 0, 0, 0, 0 }; + public bool[] touchreleased = new bool[4] { true, true, true, true }, + touchslid = new bool[4] { false, false, false, false }; + + public byte[] oldtouchvalue = new byte[4] { 0, 0, 0, 0 }; + public int[] oldscrollvalue = new int[4] { 0, 0, 0, 0 }; protected virtual void CheckForTouchToggle(int deviceID, DS4State cState, DS4State pState) { diff --git a/DS4Windows/DS4Control/DS4LightBar.cs b/DS4Windows/DS4Control/DS4LightBar.cs index 78899e1..1e33ec9 100644 --- a/DS4Windows/DS4Control/DS4LightBar.cs +++ b/DS4Windows/DS4Control/DS4LightBar.cs @@ -18,13 +18,18 @@ namespace DS4Windows { 140, 140 }, { 168, 112 }, { 196, 84 }, - { 224, 56}, // on 80% of the time at 80, etc. + { 224, 56 }, // on 80% of the time at 80, etc. { 252, 28 } // on 90% of the time at 90 }; + static double[] counters = new double[4] { 0, 0, 0, 0 }; - public static Stopwatch[] fadewatches = { new Stopwatch(), new Stopwatch(), new Stopwatch(), new Stopwatch() }; + public static Stopwatch[] fadewatches = new Stopwatch[4] + { new Stopwatch(), new Stopwatch(), new Stopwatch(), new Stopwatch() }; + static bool[] fadedirection = new bool[4] { false, false, false, false }; - static DateTime[] oldnow = { DateTime.UtcNow, DateTime.UtcNow, DateTime.UtcNow, DateTime.UtcNow }; + static DateTime[] oldnow = new DateTime[4] + { DateTime.UtcNow, DateTime.UtcNow, DateTime.UtcNow, DateTime.UtcNow }; + public static bool[] forcelight = new bool[4] { false, false, false, false }; public static DS4Color[] forcedColor = new DS4Color[4]; public static byte[] forcedFlash = new byte[4]; @@ -291,10 +296,6 @@ namespace DS4Windows if (tempLightBarOnDuration != haptics.LightBarFlashDurationOn && tempLightBarOnDuration != 1 && haptics.LightBarFlashDurationOn == 0) haptics.LightBarFlashDurationOff = haptics.LightBarFlashDurationOn = 1; - // Comment out code for now. This condition gets hit too often and bogs down the GUI - //if (device.LightBarOnDuration == 1) //helps better reset the color - // System.Threading.Thread.Sleep(5); - device.pushHapticState(haptics); } diff --git a/DS4Windows/DS4Control/DS4StateFieldMapping.cs b/DS4Windows/DS4Control/DS4StateFieldMapping.cs index e345e50..e8d88c7 100644 --- a/DS4Windows/DS4Control/DS4StateFieldMapping.cs +++ b/DS4Windows/DS4Control/DS4StateFieldMapping.cs @@ -90,13 +90,13 @@ namespace DS4Windows buttons[(int)DS4Controls.TouchUpper] = tp != null ? (!priorMouse ? tp.upperDown : tp.priorUpperDown) : false; buttons[(int)DS4Controls.TouchMulti] = tp != null ? (!priorMouse ? tp.multiDown : tp.priorMultiDown) : false; - int gyroX = exposeState.getGyroX(); - gryodirs[(int)DS4Controls.GyroXPos] = gyroX > 0 ? gyroX : 0; - gryodirs[(int)DS4Controls.GyroXNeg] = gyroX < 0 ? gyroX : 0; + int sixAxisX = -exposeState.getAccelX(); + gryodirs[(int)DS4Controls.GyroXPos] = sixAxisX > 0 ? sixAxisX : 0; + gryodirs[(int)DS4Controls.GyroXNeg] = sixAxisX < 0 ? sixAxisX : 0; - int gyroZ = exposeState.getGyroZ(); - gryodirs[(int)DS4Controls.GyroZPos] = gyroZ > 0 ? gyroZ : 0; - gryodirs[(int)DS4Controls.GyroZNeg] = gyroZ < 0 ? gyroZ : 0; + int sixAxisZ = exposeState.getAccelZ(); + gryodirs[(int)DS4Controls.GyroZPos] = sixAxisZ > 0 ? sixAxisZ : 0; + gryodirs[(int)DS4Controls.GyroZNeg] = sixAxisZ < 0 ? sixAxisZ : 0; swipedirs[(int)DS4Controls.SwipeLeft] = tp != null ? (!priorMouse ? tp.swipeLeftB : tp.priorSwipeLeftB): (byte)0; swipedirs[(int)DS4Controls.SwipeRight] = tp != null ? (!priorMouse ? tp.swipeRightB : tp.priorSwipeRightB) : (byte)0; diff --git a/DS4Windows/DS4Control/Mapping.cs b/DS4Windows/DS4Control/Mapping.cs index cdcfb5f..8d858cb 100644 --- a/DS4Windows/DS4Control/Mapping.cs +++ b/DS4Windows/DS4Control/Mapping.cs @@ -59,7 +59,9 @@ namespace DS4Windows } public static SyntheticState globalState = new SyntheticState(); - public static SyntheticState[] deviceState = { new SyntheticState(), new SyntheticState(), new SyntheticState(), new SyntheticState() }; + public static SyntheticState[] deviceState = new SyntheticState[4] + { new SyntheticState(), new SyntheticState(), new SyntheticState(), + new SyntheticState() }; // TODO When we disconnect, process a null/dead state to release any keys or buttons. public static DateTime oldnow = DateTime.UtcNow; @@ -71,25 +73,24 @@ namespace DS4Windows static bool[] macroControl = new bool[25]; //actions - public static int[] fadetimer = { 0, 0, 0, 0 }; - public static int[] prevFadetimer = { 0, 0, 0, 0 }; + public static int[] fadetimer = new int[4] { 0, 0, 0, 0 }; + public static int[] prevFadetimer = new int[4] { 0, 0, 0, 0 }; public static DS4Color[] lastColor = new DS4Color[4]; public static List actionDone = new List(); - //public static List[] actionDone = { new List(), new List(), new List(), new List() }; - //public static bool[,] actionDone = new bool[4, 50]; public static SpecialAction[] untriggeraction = new SpecialAction[4]; public static DateTime[] nowAction = { DateTime.MinValue, DateTime.MinValue, DateTime.MinValue, DateTime.MinValue }; public static DateTime[] oldnowAction = { DateTime.MinValue, DateTime.MinValue, DateTime.MinValue, DateTime.MinValue }; - public static int[] untriggerindex = { -1, -1, -1, -1 }; - public static DateTime[] oldnowKeyAct = { DateTime.MinValue, DateTime.MinValue, DateTime.MinValue, DateTime.MinValue }; - //private static bool tappedOnce = false, firstTouch = false, secondtouchbegin = false; - //private static DateTime pastTime, firstTap, TimeofEnd; + public static int[] untriggerindex = new int[4] { -1, -1, -1, -1 }; + public static DateTime[] oldnowKeyAct = new DateTime[4] { DateTime.MinValue, + DateTime.MinValue, DateTime.MinValue, DateTime.MinValue }; + private static DS4Controls[] shiftTriggerMapping = { DS4Controls.None, DS4Controls.Cross, DS4Controls.Circle, DS4Controls.Square, DS4Controls.Triangle, DS4Controls.Options, DS4Controls.Share, DS4Controls.DpadUp, DS4Controls.DpadDown, DS4Controls.DpadLeft, DS4Controls.DpadRight, DS4Controls.PS, DS4Controls.L1, DS4Controls.R1, DS4Controls.L2, DS4Controls.R2, DS4Controls.L3, DS4Controls.R3, DS4Controls.TouchLeft, DS4Controls.TouchUpper, DS4Controls.TouchMulti, DS4Controls.TouchRight, DS4Controls.GyroZNeg, DS4Controls.GyroZPos, DS4Controls.GyroXPos, DS4Controls.GyroXNeg }; + private static int[] ds4ControlMapping = { 0, // DS4Control.None 16, // DS4Controls.LXNeg 20, // DS4Controls.LXPos @@ -128,13 +129,16 @@ namespace DS4Windows // Define here to save some time processing. // It is enough to feel a difference during gameplay. - private static int[] rsOutCurveModeArray = { 0, 0, 0, 0 }; - private static int[] lsOutCurveModeArray = { 0, 0, 0, 0 }; + private static int[] rsOutCurveModeArray = new int[4] { 0, 0, 0, 0 }; + private static int[] lsOutCurveModeArray = new int[4] { 0, 0, 0, 0 }; static bool tempBool = false; + private static double[] tempDoubleArray = new double[4] { 0.0, 0.0, 0.0, 0.0 }; + private static int[] tempIntArray = new int[4] { 0, 0, 0, 0 }; // Special macros static bool altTabDone = true; - static DateTime altTabNow = DateTime.UtcNow, oldAltTabNow = DateTime.UtcNow - TimeSpan.FromSeconds(1); + static DateTime altTabNow = DateTime.UtcNow, + oldAltTabNow = DateTime.UtcNow - TimeSpan.FromSeconds(1); // Mouse public static int mcounter = 34; @@ -347,6 +351,7 @@ namespace DS4Windows } state.SavePrevious(true); } + public enum Click { None, Left, Middle, Right, Fourth, Fifth, WUP, WDOWN }; public static void MapClick(int device, Click mouseClick) { @@ -394,31 +399,19 @@ namespace DS4Windows return value1 * percent + value2 * (1 - percent); } - /*static double Clamp(double min, double value, double max) - { - if (value > max) - return max; - else if (value < min) - return min; - else - return value; - } - */ - private static int ClampInt(int min, int value, int max) { return (value < min) ? min : (value > max) ? max : value; } - private static double[] tempDoubleArray = { 0.0, 0.0, 0.0, 0.0 }; public static DS4State SetCurveAndDeadzone(int device, DS4State cState) { double rotation = tempDoubleArray[device] = getLSRotation(device); - if (rotation != 0.0) + if (rotation > 0.0 || rotation < 0.0) cState.rotateLSCoordinates(rotation); double rotationRS = tempDoubleArray[device] = getRSRotation(device); - if (rotationRS != 0.0) + if (rotationRS > 0.0 || rotationRS < 0.0) cState.rotateRSCoordinates(rotationRS); DS4State dState = new DS4State(cState); @@ -442,7 +435,6 @@ namespace DS4Windows { curvex = (x > 127.5f ? Math.Min(x, (x / max) * multimax) : Math.Max(x, (x / max) * multimin)); curvey = (y > 127.5f ? Math.Min(y, (y / max) * multimax) : Math.Max(y, (y / max) * multimin)); - //btnLSTrack.Location = new Point((int)(dpix * curvex / 2.09 + lbLSTrack.Location.X), (int)(dpiy * curvey / 2.09 + lbLSTrack.Location.Y)); } else { @@ -511,17 +503,17 @@ namespace DS4Windows } else if ((lsDeadzone > 0 && lsSquared > lsDeadzoneSquared) || lsAntiDead > 0 || lsMaxZone != 100) { - double r = Math.Atan2(-(dState.LY - 127.5f), (dState.LX - 127.5f)); + double r = Math.Atan2(-(dState.LY - 127.5), (dState.LX - 127.5)); double maxXValue = dState.LX >= 127.5 ? 127.5 : -127.5; double maxYValue = dState.LY >= 127.5 ? 127.5 : -127.5; double ratio = lsMaxZone / 100.0; - double maxZoneXNegValue = (ratio * -127.5f) + 127.5f; - double maxZoneXPosValue = (ratio * 127.5f) + 127.5f; + double maxZoneXNegValue = (ratio * -127.5) + 127.5; + double maxZoneXPosValue = (ratio * 127.5) + 127.5; double maxZoneYNegValue = maxZoneXNegValue; double maxZoneYPosValue = maxZoneXPosValue; - double maxZoneX = dState.LX >= 127.5 ? (maxZoneXPosValue - 127.5f) : (maxZoneXNegValue - 127.5f); - double maxZoneY = dState.LY >= 127.5 ? (maxZoneYPosValue - 127.5f) : (maxZoneYNegValue - 127.5f); + double maxZoneX = dState.LX >= 127.5 ? (maxZoneXPosValue - 127.5) : (maxZoneXNegValue - 127.5); + double maxZoneY = dState.LY >= 127.5 ? (maxZoneYPosValue - 127.5) : (maxZoneYNegValue - 127.5); double tempLsXDead = 0.0, tempLsYDead = 0.0; double tempOutputX = 0.0, tempOutputY = 0.0; @@ -534,18 +526,16 @@ namespace DS4Windows { double currentX = Global.Clamp(maxZoneXNegValue, dState.LX, maxZoneXPosValue); double currentY = Global.Clamp(maxZoneYNegValue, dState.LY, maxZoneYPosValue); - //currentX = (byte)((dState.LX >= 127.5f) ? Math.Min(dState.LX, maxZoneX) : Math.Max(dState.LX, maxZoneX)); - //currentY = (byte)((dState.LY >= 127.5f) ? Math.Min(dState.LY, maxZoneY) : Math.Max(dState.LY, maxZoneY)); - tempOutputX = ((currentX - 127.5f - tempLsXDead) / (double)(maxZoneX - tempLsXDead)); - tempOutputY = ((currentY - 127.5f - tempLsYDead) / (double)(maxZoneY - tempLsYDead)); + tempOutputX = ((currentX - 127.5 - tempLsXDead) / (maxZoneX - tempLsXDead)); + tempOutputY = ((currentY - 127.5 - tempLsYDead) / (maxZoneY - tempLsYDead)); } } else { double currentX = Global.Clamp(maxZoneXNegValue, dState.LX, maxZoneXPosValue); double currentY = Global.Clamp(maxZoneYNegValue, dState.LY, maxZoneYPosValue); - tempOutputX = (currentX - 127.5f) / (double)(maxZoneX); - tempOutputY = (currentY - 127.5f) / (double)(maxZoneY); + tempOutputX = (currentX - 127.5) / maxZoneX; + tempOutputY = (currentY - 127.5) / maxZoneY; } double tempLsXAntiDeadPercent = 0.0, tempLsYAntiDeadPercent = 0.0; @@ -557,7 +547,7 @@ namespace DS4Windows if (tempOutputX > 0.0) { - dState.LX = (byte)((((1.0 - tempLsXAntiDeadPercent) * tempOutputX + tempLsXAntiDeadPercent)) * maxXValue + 127.5f); + dState.LX = (byte)((((1.0 - tempLsXAntiDeadPercent) * tempOutputX + tempLsXAntiDeadPercent)) * maxXValue + 127.5); } else { @@ -566,7 +556,7 @@ namespace DS4Windows if (tempOutputY > 0.0) { - dState.LY = (byte)((((1.0 - tempLsYAntiDeadPercent) * tempOutputY + tempLsYAntiDeadPercent)) * maxYValue + 127.5f); + dState.LY = (byte)((((1.0 - tempLsYAntiDeadPercent) * tempOutputY + tempLsYAntiDeadPercent)) * maxYValue + 127.5); } else { @@ -580,7 +570,7 @@ namespace DS4Windows int rsMaxZone = getRSMaxzone(device); if (rsDeadzone > 0 || rsAntiDead > 0 || rsMaxZone != 100) { - double rsSquared = Math.Pow(cState.RX - 127.5f, 2) + Math.Pow(cState.RY - 127.5f, 2); + double rsSquared = Math.Pow(cState.RX - 127.5, 2) + Math.Pow(cState.RY - 127.5, 2); double rsDeadzoneSquared = Math.Pow(rsDeadzone, 2); if (rsDeadzone > 0 && rsSquared <= rsDeadzoneSquared) { @@ -589,17 +579,17 @@ namespace DS4Windows } else if ((rsDeadzone > 0 && rsSquared > rsDeadzoneSquared) || rsAntiDead > 0 || rsMaxZone != 100) { - double r = Math.Atan2(-(dState.RY - 127.5f), (dState.RX - 127.5f)); + double r = Math.Atan2(-(dState.RY - 127.5), (dState.RX - 127.5)); double maxXValue = dState.RX >= 127.5 ? 127.5 : -127.5; double maxYValue = dState.RY >= 127.5 ? 127.5 : -127.5; double ratio = rsMaxZone / 100.0; - double maxZoneXNegValue = (ratio * -127.5f) + 127.5f; - double maxZoneXPosValue = (ratio * 127.5f) + 127.5f; + double maxZoneXNegValue = (ratio * -127.5) + 127.5; + double maxZoneXPosValue = (ratio * 127.5) + 127.5; double maxZoneYNegValue = maxZoneXNegValue; double maxZoneYPosValue = maxZoneXPosValue; - double maxZoneX = dState.RX >= 127.5 ? (maxZoneXPosValue - 127.5f) : (maxZoneXNegValue - 127.5f); - double maxZoneY = dState.RY >= 127.5 ? (maxZoneYPosValue - 127.5f) : (maxZoneYNegValue - 127.5f); + double maxZoneX = dState.RX >= 127.5 ? (maxZoneXPosValue - 127.5) : (maxZoneXNegValue - 127.5); + double maxZoneY = dState.RY >= 127.5 ? (maxZoneYPosValue - 127.5) : (maxZoneYNegValue - 127.5); double tempRsXDead = 0.0, tempRsYDead = 0.0; double tempOutputX = 0.0, tempOutputY = 0.0; @@ -613,10 +603,8 @@ namespace DS4Windows double currentX = Global.Clamp(maxZoneXNegValue, dState.RX, maxZoneXPosValue); double currentY = Global.Clamp(maxZoneYNegValue, dState.RY, maxZoneYPosValue); - tempOutputX = ((currentX - 127.5f - tempRsXDead) / (double)(maxZoneX - tempRsXDead)); - tempOutputY = ((currentY - 127.5f - tempRsYDead) / (double)(maxZoneY - tempRsYDead)); - //tempOutputX = ((dState.RX - 127.5f - tempRsXDead) / (double)(maxXValue - tempRsXDead)); - //tempOutputY = ((dState.RY - 127.5f - tempRsYDead) / (double)(maxYValue - tempRsYDead)); + tempOutputX = ((currentX - 127.5 - tempRsXDead) / (maxZoneX - tempRsXDead)); + tempOutputY = ((currentY - 127.5 - tempRsYDead) / (maxZoneY - tempRsYDead)); } } else @@ -624,10 +612,8 @@ namespace DS4Windows double currentX = Global.Clamp(maxZoneXNegValue, dState.RX, maxZoneXPosValue); double currentY = Global.Clamp(maxZoneYNegValue, dState.RY, maxZoneYPosValue); - tempOutputX = (currentX - 127.5f) / (double)(maxZoneX); - tempOutputY = (currentY - 127.5f) / (double)(maxZoneY); - //tempOutputX = ((dState.RX - 127.5f) / (double)(maxXValue)); - //tempOutputY = ((dState.RY - 127.5f) / (double)(maxYValue)); + tempOutputX = (currentX - 127.5) / maxZoneX; + tempOutputY = (currentY - 127.5) / maxZoneY; } double tempRsXAntiDeadPercent = 0.0, tempRsYAntiDeadPercent = 0.0; @@ -639,7 +625,7 @@ namespace DS4Windows if (tempOutputX > 0.0) { - dState.RX = (byte)((((1.0 - tempRsXAntiDeadPercent) * tempOutputX + tempRsXAntiDeadPercent)) * maxXValue + 127.5f); + dState.RX = (byte)((((1.0 - tempRsXAntiDeadPercent) * tempOutputX + tempRsXAntiDeadPercent)) * maxXValue + 127.5); } else { @@ -648,7 +634,7 @@ namespace DS4Windows if (tempOutputY > 0.0) { - dState.RY = (byte)((((1.0 - tempRsYAntiDeadPercent) * tempOutputY + tempRsYAntiDeadPercent)) * maxYValue + 127.5f); + dState.RY = (byte)((((1.0 - tempRsYAntiDeadPercent) * tempOutputY + tempRsYAntiDeadPercent)) * maxYValue + 127.5); } else { @@ -662,17 +648,17 @@ namespace DS4Windows int l2Maxzone = getL2Maxzone(device); if (l2Deadzone > 0 || l2AntiDeadzone > 0 || l2Maxzone != 100) { - double tempL2Output = (cState.L2 / 255.0); + double tempL2Output = cState.L2 / 255.0; double tempL2AntiDead = 0.0; - double ratio = (l2Maxzone / 100.0); - double maxValue = 255 * ratio; + double ratio = l2Maxzone / 100.0; + double maxValue = 255.0 * ratio; if (l2Deadzone > 0) { if (cState.L2 > l2Deadzone) { double current = Global.Clamp(0, dState.L2, maxValue); - tempL2Output = ((current - l2Deadzone) / (double)(maxValue - l2Deadzone)); + tempL2Output = (current - l2Deadzone) / (maxValue - l2Deadzone); } else { @@ -687,7 +673,7 @@ namespace DS4Windows if (tempL2Output > 0.0) { - dState.L2 = (byte)(((1.0 - tempL2AntiDead) * tempL2Output + tempL2AntiDead) * 255); + dState.L2 = (byte)(((1.0 - tempL2AntiDead) * tempL2Output + tempL2AntiDead) * 255.0); } else { @@ -700,9 +686,9 @@ namespace DS4Windows int r2Maxzone = getR2Maxzone(device); if (r2Deadzone > 0 || r2AntiDeadzone > 0 || r2Maxzone != 100) { - double tempR2Output = (cState.R2 / 255.0); + double tempR2Output = cState.R2 / 255.0; double tempR2AntiDead = 0.0; - double ratio = (r2Maxzone / 100.0); + double ratio = r2Maxzone / 100.0; double maxValue = 255 * ratio; if (r2Deadzone > 0) @@ -710,7 +696,7 @@ namespace DS4Windows if (cState.R2 > r2Deadzone) { double current = Global.Clamp(0, dState.R2, maxValue); - tempR2Output = ((current - r2Deadzone) / (double)(maxValue - r2Deadzone)); + tempR2Output = (current - r2Deadzone) / (maxValue - r2Deadzone); } else { @@ -725,7 +711,7 @@ namespace DS4Windows if (tempR2Output > 0.0) { - dState.R2 = (byte)(((1.0 - tempR2AntiDead) * tempR2Output + tempR2AntiDead) * 255); + dState.R2 = (byte)(((1.0 - tempR2AntiDead) * tempR2Output + tempR2AntiDead) * 255.0); } else { @@ -736,15 +722,15 @@ namespace DS4Windows double lsSens = getLSSens(device); if (lsSens != 1.0) { - dState.LX = (byte)Global.Clamp(0, lsSens * (dState.LX - 127.5f) + 127.5f, 255); - dState.LY = (byte)Global.Clamp(0, lsSens * (dState.LY - 127.5f) + 127.5f, 255); + dState.LX = (byte)Global.Clamp(0, lsSens * (dState.LX - 127.5) + 127.5, 255); + dState.LY = (byte)Global.Clamp(0, lsSens * (dState.LY - 127.5) + 127.5, 255); } double rsSens = getRSSens(device); if (rsSens != 1.0) { - dState.RX = (byte)Global.Clamp(0, rsSens * (dState.RX - 127.5f) + 127.5f, 255); - dState.RY = (byte)Global.Clamp(0, rsSens * (dState.RY - 127.5f) + 127.5f, 255); + dState.RX = (byte)Global.Clamp(0, rsSens * (dState.RX - 127.5) + 127.5, 255); + dState.RY = (byte)Global.Clamp(0, rsSens * (dState.RY - 127.5) + 127.5, 255); } double l2Sens = getL2Sens(device); @@ -756,10 +742,10 @@ namespace DS4Windows dState.R2 = (byte)Global.Clamp(0, r2Sens * dState.R2, 255); int lsOutCurveMode = lsOutCurveModeArray[device] = getLsOutCurveMode(device); - if (lsOutCurveMode != 0) + if (lsOutCurveMode > 0) { - double tempX = (dState.LX - 127.5f) / 127.5; - double tempY = (dState.LY - 127.5f) / 127.5; + double tempX = (dState.LX - 127.5) / 127.5; + double tempY = (dState.LY - 127.5) / 127.5; double signX = tempX >= 0.0 ? 1.0 : -1.0; double signY = tempY >= 0.0 ? 1.0 : -1.0; @@ -796,30 +782,30 @@ namespace DS4Windows outputY = (absY * 1.992) - 0.992; } - dState.LX = (byte)(outputX * signX * 127.5f + 127.5f); - dState.LY = (byte)(outputY * signY * 127.5f + 127.5f); + dState.LX = (byte)(outputX * signX * 127.5 + 127.5); + dState.LY = (byte)(outputY * signY * 127.5 + 127.5); } else if (lsOutCurveMode == 2) { double outputX = tempX * tempX; double outputY = tempY * tempY; - dState.LX = (byte)(outputX * signX * 127.5f + 127.5f); - dState.LY = (byte)(outputY * signY * 127.5f + 127.5f); + dState.LX = (byte)(outputX * signX * 127.5 + 127.5); + dState.LY = (byte)(outputY * signY * 127.5 + 127.5); } else if (lsOutCurveMode == 3) { double outputX = tempX * tempX * tempX; double outputY = tempY * tempY * tempY; - dState.LX = (byte)(outputX * 127.5f + 127.5f); - dState.LY = (byte)(outputY * 127.5f + 127.5f); + dState.LX = (byte)(outputX * 127.5 + 127.5); + dState.LY = (byte)(outputY * 127.5 + 127.5); } } int rsOutCurveMode = rsOutCurveModeArray[device] = getRsOutCurveMode(device); - if (rsOutCurveMode != 0) + if (rsOutCurveMode > 0) { - double tempX = (dState.RX - 127.5f) / 127.5; - double tempY = (dState.RY - 127.5f) / 127.5; + double tempX = (dState.RX - 127.5) / 127.5; + double tempY = (dState.RY - 127.5) / 127.5; double signX = tempX >= 0.0 ? 1.0 : -1.0; double signY = tempY >= 0.0 ? 1.0 : -1.0; @@ -856,22 +842,144 @@ namespace DS4Windows outputY = (absY * 1.992) - 0.992; } - dState.RX = (byte)(outputX * signX * 127.5f + 127.5f); - dState.RY = (byte)(outputY * signY * 127.5f + 127.5f); + dState.RX = (byte)(outputX * signX * 127.5 + 127.5); + dState.RY = (byte)(outputY * signY * 127.5 + 127.5); } else if (rsOutCurveMode == 2) { double outputX = tempX * tempX; double outputY = tempY * tempY; - dState.RX = (byte)(outputX * signX * 127.5f + 127.5f); - dState.RY = (byte)(outputY * signY * 127.5f + 127.5f); + dState.RX = (byte)(outputX * signX * 127.5 + 127.5); + dState.RY = (byte)(outputY * signY * 127.5 + 127.5); } else if (rsOutCurveMode == 3) { double outputX = tempX * tempX * tempX; double outputY = tempY * tempY * tempY; - dState.RX = (byte)(outputX * 127.5f + 127.5f); - dState.RY = (byte)(outputY * 127.5f + 127.5f); + dState.RX = (byte)(outputX * 127.5 + 127.5); + dState.RY = (byte)(outputY * 127.5 + 127.5); + } + } + + int l2OutCurveMode = tempIntArray[device] = getL2OutCurveMode(device); + if (l2OutCurveMode > 0) + { + double temp = dState.L2 / 255.0; + if (l2OutCurveMode == 1) + { + double output = temp * temp; + dState.L2 = (byte)(output * 255.0); + } + else if (l2OutCurveMode == 2) + { + double output = temp * temp * temp; + dState.L2 = (byte)(output * 255.0); + } + } + + int r2OutCurveMode = tempIntArray[device] = getR2OutCurveMode(device); + if (r2OutCurveMode > 0) + { + double temp = dState.R2 / 255.0; + if (r2OutCurveMode == 1) + { + double output = temp * temp; + dState.R2 = (byte)(output * 255.0); + } + else if (r2OutCurveMode == 2) + { + double output = temp * temp * temp; + dState.R2 = (byte)(output * 255.0); + } + } + + bool sOff = tempBool = isUsingSAforMouse(device); + if (sOff == false) + { + int SXD = (int)(10d * getSXDeadzone(device)); + int SZD = (int)(10d * getSZDeadzone(device)); + double SXMax = getSXMaxzone(device); + double SZMax = getSZMaxzone(device); + double sxAntiDead = getSXAntiDeadzone(device); + double szAntiDead = getSZAntiDeadzone(device); + double sxsens = getSXSens(device); + double szsens = getSZSens(device); + + int gyroX = cState.Motion.accelX, gyroZ = cState.Motion.accelZ; + int absx = Math.Abs(gyroX), absz = Math.Abs(gyroZ); + + if (SXD > 0 || SXMax < 1.0 || sxAntiDead > 0) + { + int maxValue = (int)(SXMax * 128d); + if (absx > SXD) + { + double ratioX = absx < maxValue ? (absx - SXD) / (double)(maxValue - SXD) : 1.0; + dState.Motion.accelX = Math.Sign(gyroX) * + (int)Math.Min(128d, sxsens * 128d * ((1.0 - sxAntiDead) * ratioX + sxAntiDead)); + } + else + { + dState.Motion.accelX = 0; + } + } + else + { + dState.Motion.accelX = Math.Sign(gyroX) * + (int)Math.Min(128d, sxsens * 128d * (absx / 128d)); + } + + if (SZD > 0 || SZMax < 1.0 || szAntiDead > 0) + { + int maxValue = (int)(SZMax * 128d); + if (absz > SZD) + { + double ratioZ = absz < maxValue ? (absz - SZD) / (double)(maxValue - SZD) : 1.0; + dState.Motion.accelZ = Math.Sign(gyroZ) * + (int)Math.Min(128d, szsens * 128d * ((1.0 - szAntiDead) * ratioZ + szAntiDead)); + } + else + { + dState.Motion.accelZ = 0; + } + } + else + { + dState.Motion.accelZ = Math.Sign(gyroZ) * + (int)Math.Min(128d, szsens * 128d * (absz / 128d)); + } + + int sxOutCurveMode = tempIntArray[device] = getSXOutCurveMode(device); + if (sxOutCurveMode > 0) + { + double temp = Math.Abs(dState.Motion.accelX) / 128.0; + double sign = Math.Sign(temp); + if (sxOutCurveMode == 1) + { + double output = temp * temp; + dState.Motion.accelX = (byte)(output * sign * 128.0); + } + else if (sxOutCurveMode == 2) + { + double output = temp * temp * temp; + dState.Motion.accelX = (byte)(output * 128.0); + } + } + + int szOutCurveMode = tempIntArray[device] = getSZOutCurveMode(device); + if (szOutCurveMode > 0) + { + double temp = Math.Abs(dState.Motion.accelZ) / 128.0; + double sign = Math.Sign(temp); + if (szOutCurveMode == 1) + { + double output = temp * temp; + dState.Motion.accelZ = (byte)(output * sign * 128.0); + } + else if (szOutCurveMode == 2) + { + double output = temp * temp * temp; + dState.Motion.accelZ = (byte)(output * 128.0); + } } } @@ -916,6 +1024,7 @@ namespace DS4Windows X360Controls x3c; if (Enum.TryParse(key, true, out x3c)) return x3c; + switch (key) { case "Back": return X360Controls.Back; @@ -959,8 +1068,9 @@ namespace DS4Windows case "Mouse Left": return X360Controls.MouseLeft; case "Mouse Right": return X360Controls.MouseRight; case "Unbound": return X360Controls.Unbound; - + default: break; } + return X360Controls.Unbound; } @@ -1036,7 +1146,6 @@ namespace DS4Windows } else if (actionType == DS4ControlSettings.ActionType.Key) { - //ushort value = ushort.Parse(action.ToString()); ushort value = Convert.ToUInt16(action); if (getBoolActionMapping2(device, dcs.control, cState, eState, tp, fieldMapping)) { @@ -1331,28 +1440,28 @@ namespace DS4Windows if (macroControl[24]) MappedState.RY = 0; if (IfAxisIsNotModified(device, ShiftTrigger2(GetDS4STrigger(device, DS4Controls.LXNeg), device, cState, eState, tp, fieldMapping), DS4Controls.LXNeg)) - tempControlDict.Add(DS4Controls.LXNeg, DS4Controls.LXNeg); + tempControlDict[DS4Controls.LXNeg] = DS4Controls.LXNeg; if (IfAxisIsNotModified(device, ShiftTrigger2(GetDS4STrigger(device, DS4Controls.LXPos), device, cState, eState, tp, fieldMapping), DS4Controls.LXPos)) - tempControlDict.Add(DS4Controls.LXPos, DS4Controls.LXPos); + tempControlDict[DS4Controls.LXPos] = DS4Controls.LXPos; if (IfAxisIsNotModified(device, ShiftTrigger2(GetDS4STrigger(device, DS4Controls.LYNeg), device, cState, eState, tp, fieldMapping), DS4Controls.LYNeg)) - tempControlDict.Add(DS4Controls.LYNeg, DS4Controls.LYNeg); + tempControlDict[DS4Controls.LYNeg] = DS4Controls.LYNeg; if (IfAxisIsNotModified(device, ShiftTrigger2(GetDS4STrigger(device, DS4Controls.LYPos), device, cState, eState, tp, fieldMapping), DS4Controls.LYPos)) - tempControlDict.Add(DS4Controls.LYPos, DS4Controls.LYPos); + tempControlDict[DS4Controls.LYPos] = DS4Controls.LYPos; if (IfAxisIsNotModified(device, ShiftTrigger2(GetDS4STrigger(device, DS4Controls.RXNeg), device, cState, eState, tp, fieldMapping), DS4Controls.RXNeg)) - tempControlDict.Add(DS4Controls.RXNeg, DS4Controls.RXNeg); + tempControlDict[DS4Controls.RXNeg] = DS4Controls.RXNeg; if (IfAxisIsNotModified(device, ShiftTrigger2(GetDS4STrigger(device, DS4Controls.RXPos), device, cState, eState, tp, fieldMapping), DS4Controls.RXPos)) - tempControlDict.Add(DS4Controls.RXPos, DS4Controls.RXPos); + tempControlDict[DS4Controls.RXPos] = DS4Controls.RXPos; if (IfAxisIsNotModified(device, ShiftTrigger2(GetDS4STrigger(device, DS4Controls.RYNeg), device, cState, eState, tp, fieldMapping), DS4Controls.RYNeg)) - tempControlDict.Add(DS4Controls.RYNeg, DS4Controls.RYNeg); + tempControlDict[DS4Controls.RYNeg] = DS4Controls.RYNeg; if (IfAxisIsNotModified(device, ShiftTrigger2(GetDS4STrigger(device, DS4Controls.RYPos), device, cState, eState, tp, fieldMapping), DS4Controls.RYPos)) - tempControlDict.Add(DS4Controls.RYPos, DS4Controls.RYPos); + tempControlDict[DS4Controls.RYPos] = DS4Controls.RYPos; Dictionary.KeyCollection controlKeys = tempControlDict.Keys; //Dictionary>.KeyCollection controlKeys = tempControlDict.Keys; @@ -2483,33 +2592,33 @@ namespace DS4Windows } else if (controlType == DS4StateFieldMapping.ControlType.GyroDir) { - double SXD = getSXDeadzone(device); - double SZD = getSZDeadzone(device); + //double SXD = getSXDeadzone(device); + //double SZD = getSZDeadzone(device); switch (control) { case DS4Controls.GyroXPos: { int gyroX = fieldMapping.gryodirs[controlNum]; - value = (byte)(gyroX > SXD * 10 ? Math.Pow(root + speed / divide, gyroX) : 0); + value = (byte)(gyroX > 0 ? Math.Pow(root + speed / divide, gyroX) : 0); break; } case DS4Controls.GyroXNeg: { int gyroX = fieldMapping.gryodirs[controlNum]; - value = (byte)(gyroX < -SXD * 10 ? Math.Pow(root + speed / divide, -gyroX) : 0); + value = (byte)(gyroX < 0 ? Math.Pow(root + speed / divide, -gyroX) : 0); break; } case DS4Controls.GyroZPos: { int gyroZ = fieldMapping.gryodirs[controlNum]; - value = (byte)(gyroZ > SZD * 10 ? Math.Pow(root + speed / divide, gyroZ) : 0); + value = (byte)(gyroZ > 0 ? Math.Pow(root + speed / divide, gyroZ) : 0); break; } case DS4Controls.GyroZNeg: { int gyroZ = fieldMapping.gryodirs[controlNum]; - value = (byte)(gyroZ < -SZD * 10 ? Math.Pow(root + speed / divide, -gyroZ) : 0); + value = (byte)(gyroZ < 0 ? Math.Pow(root + speed / divide, -gyroZ) : 0); break; } default: break; @@ -2535,7 +2644,7 @@ namespace DS4Windows mcounter = 34; } - value *= 1 + (double)Math.Min(20000, (mouseaccel)) / 10000d; + value *= 1 + Math.Min(20000, (mouseaccel)) / 10000d; prevmouseaccel = mouseaccel; } @@ -2633,36 +2742,32 @@ namespace DS4Windows } else if (controlType == DS4StateFieldMapping.ControlType.GyroDir) { - double SXD = getSXDeadzone(device); - double SZD = getSZDeadzone(device); bool sOff = isUsingSAforMouse(device); - double sxsens = getSXSens(device); - double szsens = getSZSens(device); switch (control) { case DS4Controls.GyroXPos: { int gyroX = fieldMap.gryodirs[controlNum]; - result = (byte)(!sOff && sxsens * gyroX > SXD * 10 ? Math.Min(255, sxsens * gyroX * 2) : 0); + result = (byte)(sOff == false ? Math.Min(255, gyroX * 2) : 0); break; } case DS4Controls.GyroXNeg: { int gyroX = fieldMap.gryodirs[controlNum]; - result = (byte)(!sOff && sxsens * gyroX < -SXD * 10 ? Math.Min(255, sxsens * -gyroX * 2) : 0); + result = (byte)(sOff == false ? Math.Min(255, -gyroX * 2) : 0); break; } case DS4Controls.GyroZPos: { int gyroZ = fieldMap.gryodirs[controlNum]; - result = (byte)(!sOff && szsens * gyroZ > SZD * 10 ? Math.Min(255, szsens * gyroZ * 2) : 0); + result = (byte)(sOff == false ? Math.Min(255, gyroZ * 2) : 0); break; } case DS4Controls.GyroZNeg: { int gyroZ = fieldMap.gryodirs[controlNum]; - result = (byte)(!sOff && szsens * gyroZ < -SZD * 10 ? Math.Min(255, szsens * -gyroZ * 2) : 0); + result = (byte)(sOff == false ? Math.Min(255, -gyroZ * 2) : 0); break; } default: break; @@ -2760,25 +2865,25 @@ namespace DS4Windows { case DS4Controls.GyroXPos: { - int gyroX = eState.GyroX; + int gyroX = -eState.AccelX; result = (byte)(!sOff && sxsens * gyroX > SXD * 10 ? Math.Min(255, sxsens * gyroX * 2) : 0); break; } case DS4Controls.GyroXNeg: { - int gyroX = eState.GyroX; + int gyroX = -eState.AccelX; result = (byte)(!sOff && sxsens * gyroX < -SXD * 10 ? Math.Min(255, sxsens * -gyroX * 2) : 0); break; } case DS4Controls.GyroZPos: { - int gyroZ = eState.GyroZ; + int gyroZ = eState.AccelZ; result = (byte)(!sOff && szsens * gyroZ > SZD * 10 ? Math.Min(255, szsens * gyroZ * 2) : 0); break; } case DS4Controls.GyroZNeg: { - int gyroZ = eState.GyroZ; + int gyroZ = eState.AccelZ; result = (byte)(!sOff && szsens * gyroZ < -SZD * 10 ? Math.Min(255, szsens * -gyroZ * 2) : 0); break; } @@ -2882,10 +2987,10 @@ namespace DS4Windows switch (control) { - case DS4Controls.GyroXPos: result = !sOff ? SXSens[device] * eState.GyroX > 67 : false; break; - case DS4Controls.GyroXNeg: result = !sOff ? SXSens[device] * eState.GyroX < -67 : false; break; - case DS4Controls.GyroZPos: result = !sOff ? SZSens[device] * eState.GyroZ > 67 : false; break; - case DS4Controls.GyroZNeg: result = !sOff ? SZSens[device] * eState.GyroZ < -67 : false; break; + case DS4Controls.GyroXPos: result = !sOff ? SXSens[device] * -eState.AccelX > 67 : false; break; + case DS4Controls.GyroXNeg: result = !sOff ? SXSens[device] * -eState.AccelX < -67 : false; break; + case DS4Controls.GyroZPos: result = !sOff ? SZSens[device] * eState.AccelZ > 67 : false; break; + case DS4Controls.GyroZNeg: result = !sOff ? SZSens[device] * eState.AccelZ < -67 : false; break; default: break; } } @@ -2946,14 +3051,14 @@ namespace DS4Windows switch (control) { - case DS4Controls.GyroXPos: safeTest = SXSens[device] * fieldMap.gryodirs[controlNum] > 67; break; - case DS4Controls.GyroXNeg: safeTest = SXSens[device] * fieldMap.gryodirs[controlNum] < -67; break; - case DS4Controls.GyroZPos: safeTest = SZSens[device] * fieldMap.gryodirs[controlNum] > 67; break; - case DS4Controls.GyroZNeg: safeTest = SZSens[device] * fieldMap.gryodirs[controlNum] < -67; break; + case DS4Controls.GyroXPos: safeTest = fieldMap.gryodirs[controlNum] > 67; break; + case DS4Controls.GyroXNeg: safeTest = fieldMap.gryodirs[controlNum] < -67; break; + case DS4Controls.GyroZPos: safeTest = fieldMap.gryodirs[controlNum] > 67; break; + case DS4Controls.GyroZNeg: safeTest = fieldMap.gryodirs[controlNum] < -67; break; default: break; } - result = !sOff ? safeTest : false; + result = sOff == false ? safeTest : false; } return result; @@ -2975,117 +3080,117 @@ namespace DS4Windows switch (control) { case DS4Controls.LXNeg: + { + if (!analog) { - if (!analog) - { - double angle = cState.LSAngle; - result = cState.LX < 127 && (angle >= 210 && angle <= 330); - } - else - { - result = cState.LX < 127; - } - - break; + double angle = cState.LSAngle; + result = cState.LX < 127 && (angle >= 210 && angle <= 330); } + else + { + result = cState.LX < 127; + } + + break; + } case DS4Controls.LYNeg: + { + if (!analog) { - if (!analog) - { - double angle = cState.LSAngle; - result = cState.LY < 127 && (angle >= 300 || angle <= 60); - } - else - { - result = cState.LY < 127; - } - - break; + double angle = cState.LSAngle; + result = cState.LY < 127 && (angle >= 300 || angle <= 60); } + else + { + result = cState.LY < 127; + } + + break; + } case DS4Controls.RXNeg: + { + if (!analog) { - if (!analog) - { - double angle = cState.RSAngle; - result = cState.RX < 127 && (angle >= 210 && angle <= 330); - } - else - { - result = cState.RX < 127; - } - - break; + double angle = cState.RSAngle; + result = cState.RX < 127 && (angle >= 210 && angle <= 330); } + else + { + result = cState.RX < 127; + } + + break; + } case DS4Controls.RYNeg: + { + if (!analog) { - if (!analog) - { - double angle = cState.RSAngle; - result = cState.RY < 127 && (angle >= 300 || angle <= 60); - } - else - { - result = cState.RY < 127; - } - - break; + double angle = cState.RSAngle; + result = cState.RY < 127 && (angle >= 300 || angle <= 60); } + else + { + result = cState.RY < 127; + } + + break; + } case DS4Controls.LXPos: + { + if (!analog) { - if (!analog) - { - double angle = cState.LSAngle; - result = cState.LX > 127 && (angle >= 30 && angle <= 150); - } - else - { - result = cState.LX > 127; - } - - break; + double angle = cState.LSAngle; + result = cState.LX > 127 && (angle >= 30 && angle <= 150); } + else + { + result = cState.LX > 127; + } + + break; + } case DS4Controls.LYPos: + { + if (!analog) { - if (!analog) - { - double angle = cState.LSAngle; - result = cState.LY > 127 && (angle >= 120 && angle <= 240); - } - else - { - result = cState.LY > 127; - } - - break; + double angle = cState.LSAngle; + result = cState.LY > 127 && (angle >= 120 && angle <= 240); } + else + { + result = cState.LY > 127; + } + + break; + } case DS4Controls.RXPos: + { + if (!analog) { - if (!analog) - { - double angle = cState.RSAngle; - result = cState.RX > 127 && (angle >= 30 && angle <= 150); - } - else - { - result = cState.RX > 127; - } - - break; + double angle = cState.RSAngle; + result = cState.RX > 127 && (angle >= 30 && angle <= 150); } + else + { + result = cState.RX > 127; + } + + break; + } case DS4Controls.RYPos: + { + if (!analog) { - if (!analog) - { - double angle = cState.RSAngle; - result = cState.RY > 127 && (angle >= 120 && angle <= 240); - } - else - { - result = cState.RY > 127; - } - - break; + double angle = cState.RSAngle; + result = cState.RY > 127 && (angle >= 120 && angle <= 240); } + else + { + result = cState.RY > 127; + } + + break; + } default: break; } } @@ -3108,14 +3213,14 @@ namespace DS4Windows switch (control) { - case DS4Controls.GyroXPos: safeTest = SXSens[device] * fieldMap.gryodirs[controlNum] > 67; break; - case DS4Controls.GyroXNeg: safeTest = SXSens[device] * fieldMap.gryodirs[controlNum] < -67; break; - case DS4Controls.GyroZPos: safeTest = SZSens[device] * fieldMap.gryodirs[controlNum] > 67; break; - case DS4Controls.GyroZNeg: safeTest = SZSens[device] * fieldMap.gryodirs[controlNum] < -67; break; + case DS4Controls.GyroXPos: safeTest = fieldMap.gryodirs[controlNum] > 67; break; + case DS4Controls.GyroXNeg: safeTest = fieldMap.gryodirs[controlNum] < -67; break; + case DS4Controls.GyroZPos: safeTest = fieldMap.gryodirs[controlNum] > 67; break; + case DS4Controls.GyroZNeg: safeTest = fieldMap.gryodirs[controlNum] < -67; break; default: break; } - result = !sOff ? safeTest : false; + result = sOff == false ? safeTest : false; } return result; @@ -3309,10 +3414,10 @@ namespace DS4Windows switch (control) { - case DS4Controls.GyroXPos: result = !sOff ? SXSens[device] * eState.GyroX > 67 : false; break; - case DS4Controls.GyroXNeg: result = !sOff ? SXSens[device] * eState.GyroX < -67 : false; break; - case DS4Controls.GyroZPos: result = !sOff ? SZSens[device] * eState.GyroZ > 67 : false; break; - case DS4Controls.GyroZNeg: result = !sOff ? SZSens[device] * eState.GyroZ < -67 : false; break; + case DS4Controls.GyroXPos: result = !sOff ? SXSens[device] * eState.AccelX > 67 : false; break; + case DS4Controls.GyroXNeg: result = !sOff ? SXSens[device] * eState.AccelX < -67 : false; break; + case DS4Controls.GyroZPos: result = !sOff ? SZSens[device] * eState.AccelZ > 67 : false; break; + case DS4Controls.GyroZNeg: result = !sOff ? SZSens[device] * eState.AccelZ < -67 : false; break; default: break; } } @@ -3365,7 +3470,7 @@ namespace DS4Windows if (controlType == DS4StateFieldMapping.ControlType.Button) { - result = (byte)(fieldMap.buttons[controlNum] ? trueVal : falseVal); + result = fieldMap.buttons[controlNum] ? trueVal : falseVal; } else if (controlType == DS4StateFieldMapping.ControlType.AxisDir) { @@ -3393,7 +3498,7 @@ namespace DS4Windows } else if (controlType == DS4StateFieldMapping.ControlType.Touch) { - result = (byte)(fieldMap.buttons[controlNum] ? trueVal : falseVal); + result = fieldMap.buttons[controlNum] ? trueVal : falseVal; } else if (controlType == DS4StateFieldMapping.ControlType.SwipeDir) { @@ -3408,44 +3513,42 @@ namespace DS4Windows } else if (controlType == DS4StateFieldMapping.ControlType.GyroDir) { - double SXD = getSXDeadzone(device); - double SZD = getSZDeadzone(device); bool sOff = isUsingSAforMouse(device); switch (control) { case DS4Controls.GyroXPos: { - if (!sOff && fieldMap.gryodirs[controlNum] > SXD * 10) + if (sOff == false && fieldMap.gryodirs[controlNum] > 0) { - if (alt) result = (byte)Math.Min(255, 127 + SXSens[device] * fieldMap.gryodirs[controlNum]); else result = (byte)Math.Max(0, 127 - SXSens[device] * fieldMap.gryodirs[controlNum]); + if (alt) result = (byte)Math.Min(255, 127 + fieldMap.gryodirs[controlNum]); else result = (byte)Math.Max(0, 127 - fieldMap.gryodirs[controlNum]); } else result = falseVal; break; } case DS4Controls.GyroXNeg: { - if (!sOff && fieldMap.gryodirs[controlNum] < -SXD * 10) + if (sOff == false && fieldMap.gryodirs[controlNum] < 0) { - if (alt) result = (byte)Math.Min(255, 127 + SXSens[device] * -fieldMap.gryodirs[controlNum]); else result = (byte)Math.Max(0, 127 - SXSens[device] * -fieldMap.gryodirs[controlNum]); + if (alt) result = (byte)Math.Min(255, 127 + -fieldMap.gryodirs[controlNum]); else result = (byte)Math.Max(0, 127 - -fieldMap.gryodirs[controlNum]); } else result = falseVal; break; } case DS4Controls.GyroZPos: { - if (!sOff && fieldMap.gryodirs[controlNum] > SZD * 10) + if (sOff == false && fieldMap.gryodirs[controlNum] > 0) { - if (alt) result = (byte)Math.Min(255, 127 + SZSens[device] * fieldMap.gryodirs[controlNum]); else result = (byte)Math.Max(0, 127 - SZSens[device] * fieldMap.gryodirs[controlNum]); + if (alt) result = (byte)Math.Min(255, 127 + fieldMap.gryodirs[controlNum]); else result = (byte)Math.Max(0, 127 - fieldMap.gryodirs[controlNum]); } else return falseVal; break; } case DS4Controls.GyroZNeg: { - if (!sOff && fieldMap.gryodirs[controlNum] < -SZD * 10) + if (sOff == false && fieldMap.gryodirs[controlNum] < 0) { - if (alt) result = (byte)Math.Min(255, 127 + SZSens[device] * -fieldMap.gryodirs[controlNum]); else result = (byte)Math.Max(0, 127 - SZSens[device] * -fieldMap.gryodirs[controlNum]); + if (alt) result = (byte)Math.Min(255, 127 + -fieldMap.gryodirs[controlNum]); else result = (byte)Math.Max(0, 127 - -fieldMap.gryodirs[controlNum]); } else result = falseVal; break; @@ -3548,36 +3651,36 @@ namespace DS4Windows { case DS4Controls.GyroXPos: { - if (!sOff && eState.GyroX > SXD * 10) + if (!sOff && -eState.AccelX > SXD * 10) { - if (alt) result = (byte)Math.Min(255, 127 + SXSens[device] * eState.GyroX); else result = (byte)Math.Max(0, 127 - SXSens[device] * eState.GyroX); + if (alt) result = (byte)Math.Min(255, 127 + SXSens[device] * -eState.AccelX); else result = (byte)Math.Max(0, 127 - SXSens[device] * -eState.AccelX); } else result = falseVal; break; } case DS4Controls.GyroXNeg: { - if (!sOff && eState.GyroX < -SXD * 10) + if (!sOff && -eState.AccelX < -SXD * 10) { - if (alt) result = (byte)Math.Min(255, 127 + SXSens[device] * -eState.GyroX); else result = (byte)Math.Max(0, 127 - SXSens[device] * -eState.GyroX); + if (alt) result = (byte)Math.Min(255, 127 + SXSens[device] * eState.AccelX); else result = (byte)Math.Max(0, 127 - SXSens[device] * eState.AccelX); } else result = falseVal; break; } case DS4Controls.GyroZPos: { - if (!sOff && eState.GyroZ > SZD * 10) + if (!sOff && eState.AccelZ > SZD * 10) { - if (alt) result = (byte)Math.Min(255, 127 + SZSens[device] * eState.GyroZ); else result = (byte)Math.Max(0, 127 - SZSens[device] * eState.GyroZ); + if (alt) result = (byte)Math.Min(255, 127 + SZSens[device] * eState.AccelZ); else result = (byte)Math.Max(0, 127 - SZSens[device] * eState.AccelZ); } else return falseVal; break; } case DS4Controls.GyroZNeg: { - if (!sOff && eState.GyroZ < -SZD * 10) + if (!sOff && eState.AccelZ < -SZD * 10) { - if (alt) result = (byte)Math.Min(255, 127 + SZSens[device] * -eState.GyroZ); else result = (byte)Math.Max(0, 127 - SZSens[device] * -eState.GyroZ); + if (alt) result = (byte)Math.Min(255, 127 + SZSens[device] * -eState.AccelZ); else result = (byte)Math.Max(0, 127 - SZSens[device] * -eState.AccelZ); } else result = falseVal; break; diff --git a/DS4Windows/DS4Control/MouseCursor.cs b/DS4Windows/DS4Control/MouseCursor.cs index 2ad11da..60835e8 100644 --- a/DS4Windows/DS4Control/MouseCursor.cs +++ b/DS4Windows/DS4Control/MouseCursor.cs @@ -15,13 +15,14 @@ namespace DS4Windows /** Indicate x/y direction for doing jitter compensation, etc. */ public enum Direction { Negative, Neutral, Positive } // Track direction vector separately and very trivially for now. - private Direction horizontalDirection = Direction.Neutral, verticalDirection = Direction.Neutral; + private Direction horizontalDirection = Direction.Neutral, + verticalDirection = Direction.Neutral; private Direction hDirection = Direction.Neutral, vDirection = Direction.Neutral; private double GYRO_MOUSE_COEFFICIENT = 0.0095; private int GYRO_MOUSE_DEADZONE = 12; private double GYRO_MOUSE_OFFSET = 0.1463; - private double GYRO_SMOOTH_MOUSE_OFFSET = 0.14698; + private double GYRO_SMOOTH_MOUSE_OFFSET = 0.14696; private const int SMOOTH_BUFFER_LEN = 3; private double[] xSmoothBuffer = new double[SMOOTH_BUFFER_LEN]; @@ -31,14 +32,17 @@ namespace DS4Windows double coefficient = 0.0; double verticalScale = 0.0; bool gyroSmooth = false; - //double gyroSmoothWeight = 0.0; + + int tempInt = 0; + double tempDouble = 0.0; public virtual void sixaxisMoved(SixAxisEventArgs arg) { int deltaX = 0, deltaY = 0; - deltaX = -arg.sixAxis.gyroXFull; - deltaY = -arg.sixAxis.gyroYFull; - //Console.WriteLine(arg.sixAxis.deltaX); + deltaX = Global.getGyroMouseHorizontalAxis(deviceNumber) == 0 ? arg.sixAxis.gyroYawFull : + arg.sixAxis.gyroRollFull; + deltaY = -arg.sixAxis.gyroPitchFull; + tempDouble = arg.sixAxis.elapsed * 0.001 * 250.0; // Base default speed on 4 ms gyroSmooth = Global.getGyroSmoothing(deviceNumber); double gyroSmoothWeight = 0.0; @@ -60,12 +64,12 @@ namespace DS4Windows int signX = System.Math.Sign(deltaX); int signY = System.Math.Sign(deltaY); - if ((hRemainder > 0) != (deltaX > 0)) + if (deltaX == 0 || (hRemainder > 0 != deltaX > 0)) { hRemainder = 0.0; } - if ((vRemainder > 0) != (deltaY > 0)) + if (deltaY == 0 || (vRemainder > 0 != deltaY > 0)) { vRemainder = 0.0; } @@ -93,32 +97,23 @@ namespace DS4Windows deltaY = 0; } - double xMotion = deltaX != 0 ? coefficient * deltaX + (normX * (offset * signX)) : 0; + double xMotion = deltaX != 0 ? coefficient * (deltaX * tempDouble) + + (normX * (offset * signX)) : 0; + int xAction = 0; if (xMotion != 0.0) { xMotion += hRemainder; - //xAction = (int)xMotion; - //hRemainder = xMotion - xAction; - } - else - { - //hRemainder = 0.0; } - //hRemainder -= (int)hRemainder; verticalScale = Global.getGyroSensVerticalScale(deviceNumber) * 0.01; - double yMotion = deltaY != 0 ? (coefficient * verticalScale) * deltaY + (normY * (offset * signY)) : 0; + double yMotion = deltaY != 0 ? (coefficient * verticalScale) * (deltaY * tempDouble) + + (normY * (offset * signY)) : 0; + int yAction = 0; if (yMotion != 0.0) { yMotion += vRemainder; - //yAction = (int)yMotion; - //vRemainder = yMotion - yAction; - } - else - { - //vRemainder = 0.0; } if (gyroSmooth) @@ -131,9 +126,10 @@ namespace DS4Windows 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++) { - int idx = System.Math.Abs(smoothBufferTail - i - 1) % SMOOTH_BUFFER_LEN; + idx = System.Math.Abs(smoothBufferTail - i - 1) % SMOOTH_BUFFER_LEN; x_out += xSmoothBuffer[idx] * currentWeight; y_out += ySmoothBuffer[idx] * currentWeight; finalWeight += currentWeight; @@ -166,13 +162,11 @@ namespace DS4Windows vRemainder = 0.0; } - //vRemainder -= (int)vRemainder; - int gyroInvert = Global.getGyroInvert(deviceNumber); - if (gyroInvert == 2 || gyroInvert == 3) + if ((gyroInvert & 0x02) == 2) xAction *= -1; - if (gyroInvert == 1 || gyroInvert == 3) + if ((gyroInvert & 0x01) == 1) yAction *= -1; if (yAction != 0 || xAction != 0) @@ -279,7 +273,7 @@ namespace DS4Windows } } - double coefficient = Global.TouchSensitivity[deviceNumber] / 100.0; + double coefficient = Global.TouchSensitivity[deviceNumber] * 0.01; // Collect rounding errors instead of losing motion. double xMotion = coefficient * deltaX; if (xMotion > 0.0) @@ -309,6 +303,13 @@ namespace DS4Windows int yAction = (int)yMotion; verticalRemainder = yMotion - yAction; + int touchpadInvert = tempInt = Global.getTouchpadInvert(deviceNumber); + if ((touchpadInvert & 0x02) == 2) + xAction *= -1; + + if ((touchpadInvert & 0x01) == 1) + yAction *= -1; + if (yAction != 0 || xAction != 0) InputMethods.MoveCursorBy(xAction, yAction); diff --git a/DS4Windows/DS4Control/ScpUtil.cs b/DS4Windows/DS4Control/ScpUtil.cs index aff4d60..3fa265c 100644 --- a/DS4Windows/DS4Control/ScpUtil.cs +++ b/DS4Windows/DS4Control/ScpUtil.cs @@ -608,6 +608,12 @@ namespace DS4Windows return m_Config.gyroSmoothWeight[index]; } + public static int[] GyroMouseHorizontalAxis => m_Config.gyroMouseHorizontalAxis; + public static int getGyroMouseHorizontalAxis(int index) + { + return m_Config.gyroMouseHorizontalAxis[index]; + } + public static DS4Color[] MainColor => m_Config.m_Leds; public static DS4Color getMainColor(int index) { @@ -658,7 +664,13 @@ namespace DS4Windows } public static bool[] LowerRCOn => m_Config.lowerRCOn; - public static bool[] TouchpadJitterCompensation => m_Config.touchpadJitterCompensation; + public static bool[] TouchpadJitterCompensation => m_Config.touchpadJitterCompensation; + + public static int[] TouchpadInvert => m_Config.touchpadInvert; + public static int getTouchpadInvert(int index) + { + return m_Config.touchpadInvert[index]; + } public static byte[] L2Deadzone => m_Config.l2Deadzone; public static byte getL2Deadzone(int index) @@ -708,6 +720,18 @@ namespace DS4Windows return m_Config.RSAntiDeadzone[index]; } + public static double[] SXAntiDeadzone => m_Config.SXAntiDeadzone; + public static double getSXAntiDeadzone(int index) + { + return m_Config.SXAntiDeadzone[index]; + } + + public static double[] SZAntiDeadzone => m_Config.SZAntiDeadzone; + public static double getSZAntiDeadzone(int index) + { + return m_Config.SZAntiDeadzone[index]; + } + public static int[] LSMaxzone => m_Config.LSMaxzone; public static int getLSMaxzone(int index) { @@ -720,6 +744,18 @@ namespace DS4Windows return m_Config.RSMaxzone[index]; } + public static double[] SXMaxzone => m_Config.SXMaxzone; + public static double getSXMaxzone(int index) + { + return m_Config.SXMaxzone[index]; + } + + public static double[] SZMaxzone => m_Config.SZMaxzone; + public static double getSZMaxzone(int index) + { + return m_Config.SZMaxzone[index]; + } + public static int[] L2AntiDeadzone => m_Config.l2AntiDeadzone; public static int getL2AntiDeadzone(int index) { @@ -828,6 +864,30 @@ namespace DS4Windows return m_Config.rsOutCurveMode[index]; } + public static int[] l2OutCurveMode => m_Config.l2OutCurveMode; + public static int getL2OutCurveMode(int index) + { + return m_Config.l2OutCurveMode[index]; + } + + public static int[] r2OutCurveMode => m_Config.r2OutCurveMode; + public static int getR2OutCurveMode(int index) + { + return m_Config.r2OutCurveMode[index]; + } + + public static int[] sxOutCurveMode => m_Config.sxOutCurveMode; + public static int getSXOutCurveMode(int index) + { + return m_Config.sxOutCurveMode[index]; + } + + public static int[] szOutCurveMode => m_Config.szOutCurveMode; + public static int getSZOutCurveMode(int index) + { + return m_Config.szOutCurveMode[index]; + } + public static string[] LaunchProgram => m_Config.launchProgram; public static string[] ProfilePath => m_Config.profilePath; public static bool[] DistanceProfiles = m_Config.distanceProfiles; @@ -1158,18 +1218,27 @@ namespace DS4Windows public int[] l2Maxzone = { 100, 100, 100, 100, 100 }, r2Maxzone = { 100, 100, 100, 100, 100 }; public double[] LSRotation = { 0.0, 0.0, 0.0, 0.0, 0.0 }, RSRotation = { 0.0, 0.0, 0.0, 0.0, 0.0 }; public double[] SXDeadzone = { 0.25, 0.25, 0.25, 0.25, 0.25 }, SZDeadzone = { 0.25, 0.25, 0.25, 0.25, 0.25 }; + public double[] SXMaxzone = new double[5] { 1.0, 1.0, 1.0, 1.0, 1.0 }, + SZMaxzone = new double[5] { 1.0, 1.0, 1.0, 1.0, 1.0 }; + public double[] SXAntiDeadzone = new double[5] { 0.0, 0.0, 0.0, 0.0, 0.0 }, + SZAntiDeadzone = new double[5] { 0.0, 0.0, 0.0, 0.0, 0.0 }; public double[] l2Sens = { 1, 1, 1, 1, 1 }, r2Sens = { 1, 1, 1, 1, 1 }; public double[] LSSens = { 1, 1, 1, 1, 1 }, RSSens = { 1, 1, 1, 1, 1 }; public double[] SXSens = { 1, 1, 1, 1, 1 }, SZSens = { 1, 1, 1, 1, 1 }; public Byte[] tapSensitivity = { 0, 0, 0, 0, 0 }; public bool[] doubleTap = { false, false, false, false, false }; public int[] scrollSensitivity = { 0, 0, 0, 0, 0 }; + public int[] touchpadInvert = { 0, 0, 0, 0, 0 }; public double[] rainbow = { 0, 0, 0, 0, 0 }; public int[] flashAt = { 0, 0, 0, 0, 0 }; public bool[] mouseAccel = { true, true, true, true, true }; - public int[] btPollRate = { 0, 0, 0, 0, 0 }; + public int[] btPollRate = { 4, 4, 4, 4, 4 }; public int[] lsOutCurveMode = { 0, 0, 0, 0, 0 }; public int[] rsOutCurveMode = { 0, 0, 0, 0, 0 }; + public int[] l2OutCurveMode = new int[5] { 0, 0, 0, 0, 0 }; + public int[] r2OutCurveMode = new int[5] { 0, 0, 0, 0, 0 }; + public int[] sxOutCurveMode = new int[5] { 0, 0, 0, 0, 0 }; + public int[] szOutCurveMode = new int[5] { 0, 0, 0, 0, 0 }; public DS4Color[] m_LowLeds = new DS4Color[] { @@ -1267,6 +1336,7 @@ namespace DS4Windows public bool[] gyroTriggerTurns = { true, true, true, true, true }; public bool[] gyroSmoothing = { false, false, false, false, false }; public double[] gyroSmoothWeight = { 0.5, 0.5, 0.5, 0.5, 0.5 }; + public int[] gyroMouseHorizontalAxis = new int[5] { 0, 0, 0, 0, 0 }; bool tempBool = false; @@ -1368,7 +1438,7 @@ namespace DS4Windows catch { return 0; } }*/ - private string outputCurveString(int id) + private string stickOutputCurveString(int id) { string result = "linear"; switch (id) @@ -1383,7 +1453,7 @@ namespace DS4Windows return result; } - private int outputCurveId(string name) + private int stickOutputCurveId(string name) { int id = 0; switch (name) @@ -1398,6 +1468,34 @@ namespace DS4Windows return id; } + private string axisOutputCurveString(int id) + { + string result = "linear"; + switch (id) + { + case 0: break; + case 1: result = "quadratic"; break; + case 2: result = "cubic"; break; + default: break; + } + + return result; + } + + private int axisOutputCurveId(string name) + { + int id = 0; + switch (name) + { + case "linear": id = 0; break; + case "quadratic": id = 1; break; + case "cubic": id = 2; break; + default: break; + } + + return id; + } + public bool SaveProfile(int device, string propath) { bool Saved = true; @@ -1447,6 +1545,7 @@ namespace DS4Windows XmlNode xmlScrollSensitivity = m_Xdoc.CreateNode(XmlNodeType.Element, "scrollSensitivity", null); xmlScrollSensitivity.InnerText = scrollSensitivity[device].ToString(); Node.AppendChild(xmlScrollSensitivity); XmlNode xmlLeftTriggerMiddle = m_Xdoc.CreateNode(XmlNodeType.Element, "LeftTriggerMiddle", null); xmlLeftTriggerMiddle.InnerText = l2Deadzone[device].ToString(); Node.AppendChild(xmlLeftTriggerMiddle); XmlNode xmlRightTriggerMiddle = m_Xdoc.CreateNode(XmlNodeType.Element, "RightTriggerMiddle", null); xmlRightTriggerMiddle.InnerText = r2Deadzone[device].ToString(); Node.AppendChild(xmlRightTriggerMiddle); + XmlNode xmlTouchpadInvert = m_Xdoc.CreateNode(XmlNodeType.Element, "TouchpadInvert", null); xmlTouchpadInvert.InnerText = touchpadInvert[device].ToString(); Node.AppendChild(xmlTouchpadInvert); XmlNode xmlL2AD = m_Xdoc.CreateNode(XmlNodeType.Element, "L2AntiDeadZone", null); xmlL2AD.InnerText = l2AntiDeadzone[device].ToString(); Node.AppendChild(xmlL2AD); XmlNode xmlR2AD = m_Xdoc.CreateNode(XmlNodeType.Element, "R2AntiDeadZone", null); xmlR2AD.InnerText = r2AntiDeadzone[device].ToString(); Node.AppendChild(xmlR2AD); XmlNode xmlL2Maxzone = m_Xdoc.CreateNode(XmlNodeType.Element, "L2MaxZone", null); xmlL2Maxzone.InnerText = l2Maxzone[device].ToString(); Node.AppendChild(xmlL2Maxzone); @@ -1465,6 +1564,12 @@ namespace DS4Windows XmlNode xmlSXD = m_Xdoc.CreateNode(XmlNodeType.Element, "SXDeadZone", null); xmlSXD.InnerText = SXDeadzone[device].ToString(); Node.AppendChild(xmlSXD); XmlNode xmlSZD = m_Xdoc.CreateNode(XmlNodeType.Element, "SZDeadZone", null); xmlSZD.InnerText = SZDeadzone[device].ToString(); Node.AppendChild(xmlSZD); + XmlNode xmlSXMaxzone = m_Xdoc.CreateNode(XmlNodeType.Element, "SXMaxZone", null); xmlSXMaxzone.InnerText = Convert.ToInt32(SXMaxzone[device] * 100.0).ToString(); Node.AppendChild(xmlSXMaxzone); + XmlNode xmlSZMaxzone = m_Xdoc.CreateNode(XmlNodeType.Element, "SZMaxZone", null); xmlSZMaxzone.InnerText = Convert.ToInt32(SZMaxzone[device] * 100.0).ToString(); Node.AppendChild(xmlSZMaxzone); + + XmlNode xmlSXAntiDeadzone = m_Xdoc.CreateNode(XmlNodeType.Element, "SXAntiDeadZone", null); xmlSXAntiDeadzone.InnerText = Convert.ToInt32(SXAntiDeadzone[device] * 100.0).ToString(); Node.AppendChild(xmlSXAntiDeadzone); + XmlNode xmlSZAntiDeadzone = m_Xdoc.CreateNode(XmlNodeType.Element, "SZAntiDeadZone", null); xmlSZAntiDeadzone.InnerText = Convert.ToInt32(SZAntiDeadzone[device] * 100.0).ToString(); Node.AppendChild(xmlSZAntiDeadzone); + XmlNode xmlSens = m_Xdoc.CreateNode(XmlNodeType.Element, "Sensitivity", null); xmlSens.InnerText = $"{LSSens[device]}|{RSSens[device]}|{l2Sens[device]}|{r2Sens[device]}|{SXSens[device]}|{SZSens[device]}"; Node.AppendChild(xmlSens); @@ -1484,12 +1589,19 @@ namespace DS4Windows XmlNode xmlGyroTriggerTurns = m_Xdoc.CreateNode(XmlNodeType.Element, "GyroTriggerTurns", null); xmlGyroTriggerTurns.InnerText = gyroTriggerTurns[device].ToString(); Node.AppendChild(xmlGyroTriggerTurns); XmlNode xmlGyroSmoothWeight = m_Xdoc.CreateNode(XmlNodeType.Element, "GyroSmoothingWeight", null); xmlGyroSmoothWeight.InnerText = Convert.ToInt32(gyroSmoothWeight[device] * 100).ToString(); Node.AppendChild(xmlGyroSmoothWeight); XmlNode xmlGyroSmoothing = m_Xdoc.CreateNode(XmlNodeType.Element, "GyroSmoothing", null); xmlGyroSmoothing.InnerText = gyroSmoothing[device].ToString(); Node.AppendChild(xmlGyroSmoothing); + XmlNode xmlGyroMouseHAxis = m_Xdoc.CreateNode(XmlNodeType.Element, "GyroMouseHAxis", null); xmlGyroMouseHAxis.InnerText = gyroMouseHorizontalAxis[device].ToString(); Node.AppendChild(xmlGyroMouseHAxis); 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); XmlNode xmlBTPollRate = m_Xdoc.CreateNode(XmlNodeType.Element, "BTPollRate", null); xmlBTPollRate.InnerText = btPollRate[device].ToString(); Node.AppendChild(xmlBTPollRate); - XmlNode xmlLsOutputCurveMode = m_Xdoc.CreateNode(XmlNodeType.Element, "LSOutputCurveMode", null); xmlLsOutputCurveMode.InnerText = outputCurveString(lsOutCurveMode[device]); Node.AppendChild(xmlLsOutputCurveMode); - XmlNode xmlRsOutputCurveMode = m_Xdoc.CreateNode(XmlNodeType.Element, "RSOutputCurveMode", null); xmlRsOutputCurveMode.InnerText = outputCurveString(rsOutCurveMode[device]); Node.AppendChild(xmlRsOutputCurveMode); + XmlNode xmlLsOutputCurveMode = m_Xdoc.CreateNode(XmlNodeType.Element, "LSOutputCurveMode", null); xmlLsOutputCurveMode.InnerText = stickOutputCurveString(lsOutCurveMode[device]); Node.AppendChild(xmlLsOutputCurveMode); + XmlNode xmlRsOutputCurveMode = m_Xdoc.CreateNode(XmlNodeType.Element, "RSOutputCurveMode", null); xmlRsOutputCurveMode.InnerText = stickOutputCurveString(rsOutCurveMode[device]); Node.AppendChild(xmlRsOutputCurveMode); + + XmlNode xmlL2OutputCurveMode = m_Xdoc.CreateNode(XmlNodeType.Element, "L2OutputCurveMode", null); xmlL2OutputCurveMode.InnerText = axisOutputCurveString(l2OutCurveMode[device]); Node.AppendChild(xmlL2OutputCurveMode); + XmlNode xmlR2OutputCurveMode = m_Xdoc.CreateNode(XmlNodeType.Element, "R2OutputCurveMode", null); xmlR2OutputCurveMode.InnerText = axisOutputCurveString(r2OutCurveMode[device]); Node.AppendChild(xmlR2OutputCurveMode); + + XmlNode xmlSXOutputCurveMode = m_Xdoc.CreateNode(XmlNodeType.Element, "SXOutputCurveMode", null); xmlSXOutputCurveMode.InnerText = axisOutputCurveString(sxOutCurveMode[device]); Node.AppendChild(xmlSXOutputCurveMode); + XmlNode xmlSZOutputCurveMode = m_Xdoc.CreateNode(XmlNodeType.Element, "SZOutputCurveMode", null); xmlSZOutputCurveMode.InnerText = axisOutputCurveString(szOutCurveMode[device]); Node.AppendChild(xmlSZOutputCurveMode); XmlNode NodeControl = m_Xdoc.CreateNode(XmlNodeType.Element, "Control", null); XmlNode Key = m_Xdoc.CreateNode(XmlNodeType.Element, "Key", null); @@ -2190,12 +2302,18 @@ namespace DS4Windows catch { missingSetting = true; } try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/scrollSensitivity"); int.TryParse(Item.InnerText, out scrollSensitivity[device]); } catch { missingSetting = true; } + + try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/TouchpadInvert"); int temp = 0; int.TryParse(Item.InnerText, out temp); touchpadInvert[device] = Math.Min(Math.Max(temp, 0), 3); } + catch { touchpadInvert[device] = 0; missingSetting = true; } + try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/LeftTriggerMiddle"); byte.TryParse(Item.InnerText, out l2Deadzone[device]); } catch { missingSetting = true; } try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/RightTriggerMiddle"); byte.TryParse(Item.InnerText, out r2Deadzone[device]); } catch { missingSetting = true; } + try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/L2AntiDeadZone"); int.TryParse(Item.InnerText, out l2AntiDeadzone[device]); } catch { l2AntiDeadzone[device] = 0; missingSetting = true; } + try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/R2AntiDeadZone"); int.TryParse(Item.InnerText, out r2AntiDeadzone[device]); } catch { r2AntiDeadzone[device] = 0; missingSetting = true; } @@ -2259,9 +2377,37 @@ namespace DS4Windows catch { RSMaxzone[device] = 100; missingSetting = true; } try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/SXDeadZone"); double.TryParse(Item.InnerText, out SXDeadzone[device]); } - catch { missingSetting = true; } + catch { SXDeadzone[device] = 0.25; missingSetting = true; } try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/SZDeadZone"); double.TryParse(Item.InnerText, out SZDeadzone[device]); } - catch { missingSetting = true; } + catch { SZDeadzone[device] = 0.25; missingSetting = true; } + + try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/SXMaxZone"); + int temp = 0; + int.TryParse(Item.InnerText, out temp); + SXMaxzone[device] = Math.Min(Math.Max(temp * 0.01, 0.0), 1.0); + } + catch { SXMaxzone[device] = 1.0; missingSetting = true; } + + try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/SZMaxZone"); + int temp = 0; + int.TryParse(Item.InnerText, out temp); + SZMaxzone[device] = Math.Min(Math.Max(temp * 0.01, 0.0), 1.0); + } + catch { SZMaxzone[device] = 1.0; missingSetting = true; } + + try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/SXAntiDeadZone"); + int temp = 0; + int.TryParse(Item.InnerText, out temp); + SXAntiDeadzone[device] = Math.Min(Math.Max(temp * 0.01, 0.0), 1.0); + } + catch { SXAntiDeadzone[device] = 0.0; missingSetting = true; } + + try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/SZAntiDeadZone"); + int temp = 0; + int.TryParse(Item.InnerText, out temp); + SZAntiDeadzone[device] = Math.Min(Math.Max(temp * 0.01, 0.0), 1.0); + } + catch { SZAntiDeadzone[device] = 0.0; missingSetting = true; } try { @@ -2428,6 +2574,9 @@ namespace DS4Windows try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/GyroSmoothingWeight"); int temp = 0; int.TryParse(Item.InnerText, out temp); gyroSmoothWeight[device] = Math.Min(Math.Max(0.0, Convert.ToDouble(temp * 0.01)), 1.0); } catch { gyroSmoothWeight[device] = 0.5; missingSetting = true; } + try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/GyroMouseHAxis"); int temp = 0; int.TryParse(Item.InnerText, out temp); gyroMouseHorizontalAxis[device] = Math.Min(Math.Max(0, temp), 1); } + catch { gyroMouseHorizontalAxis[device] = 0; missingSetting = true; } + try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/LSCurve"); int.TryParse(Item.InnerText, out lsCurve[device]); } catch { lsCurve[device] = 0; missingSetting = true; } @@ -2440,14 +2589,26 @@ namespace DS4Windows int.TryParse(Item.InnerText, out temp); btPollRate[device] = (temp >= 0 && temp <= 16) ? temp : 0; } - catch { btPollRate[device] = 0; missingSetting = true; } + catch { btPollRate[device] = 4; missingSetting = true; } - try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/LSOutputCurveMode"); lsOutCurveMode[device] = outputCurveId(Item.InnerText); } + try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/LSOutputCurveMode"); lsOutCurveMode[device] = stickOutputCurveId(Item.InnerText); } catch { lsOutCurveMode[device] = 0; missingSetting = true; } - try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/RSOutputCurveMode"); rsOutCurveMode[device] = outputCurveId(Item.InnerText); } + try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/RSOutputCurveMode"); rsOutCurveMode[device] = stickOutputCurveId(Item.InnerText); } catch { rsOutCurveMode[device] = 0; missingSetting = true; } + try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/L2OutputCurveMode"); l2OutCurveMode[device] = axisOutputCurveId(Item.InnerText); } + catch { l2OutCurveMode[device] = 0; missingSetting = true; } + + try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/R2OutputCurveMode"); r2OutCurveMode[device] = axisOutputCurveId(Item.InnerText); } + catch { r2OutCurveMode[device] = 0; missingSetting = true; } + + try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/SXOutputCurveMode"); sxOutCurveMode[device] = axisOutputCurveId(Item.InnerText); } + catch { sxOutCurveMode[device] = 0; missingSetting = true; } + + try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/SZOutputCurveMode"); szOutCurveMode[device] = axisOutputCurveId(Item.InnerText); } + catch { szOutCurveMode[device] = 0; missingSetting = true; } + try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/ProfileActions"); @@ -3440,16 +3601,19 @@ namespace DS4Windows LSRotation[device] = 0.0; RSRotation[device] = 0.0; SXDeadzone[device] = SZDeadzone[device] = 0.25; + SXMaxzone[device] = SZMaxzone[device] = 1.0; + SXAntiDeadzone[device] = SZAntiDeadzone[device] = 0.0; l2Sens[device] = r2Sens[device] = 1; LSSens[device] = RSSens[device] = 1; SXSens[device] = SZSens[device] = 1; tapSensitivity[device] = 0; doubleTap[device] = false; scrollSensitivity[device] = 0; + touchpadInvert[device] = 0; rainbow[device] = 0; flashAt[device] = 0; mouseAccel[device] = true; - btPollRate[device] = 0; + btPollRate[device] = 4; m_LowLeds[device] = new DS4Color(Color.Black); @@ -3484,8 +3648,12 @@ namespace DS4Windows gyroTriggerTurns[device] = true; gyroSmoothing[device] = false; gyroSmoothWeight[device] = 0.5; + gyroMouseHorizontalAxis[device] = 0; lsOutCurveMode[device] = 0; rsOutCurveMode[device] = 0; + l2OutCurveMode[device] = 0; + r2OutCurveMode[device] = 0; + sxOutCurveMode[device] = szOutCurveMode[device] = 0; } } diff --git a/DS4Windows/DS4Forms/DS4Form.cs b/DS4Windows/DS4Forms/DS4Form.cs index b60cbb1..3d5f323 100644 --- a/DS4Windows/DS4Forms/DS4Form.cs +++ b/DS4Windows/DS4Forms/DS4Form.cs @@ -56,10 +56,8 @@ namespace DS4Windows public bool mAllowVisible; bool contextclose; string logFile = appdatapath + @"\DS4Service.log"; - //StreamWriter logWriter; bool turnOffTemp; bool runningBat; - //bool outputlog = false; Dictionary hoverTextDict = new Dictionary(); // 0 index is used for application version text. 1 - 4 indices are used for controller status string[] notifyText = { "DS4Windows v" + FileVersionInfo.GetVersionInfo(Assembly.GetExecutingAssembly().Location).FileVersion, @@ -114,6 +112,7 @@ namespace DS4Windows (ToolStripMenuItem)notifyIcon1.ContextMenuStrip.Items[1], (ToolStripMenuItem)notifyIcon1.ContextMenuStrip.Items[2], (ToolStripMenuItem)notifyIcon1.ContextMenuStrip.Items[3] }; + SystemEvents.PowerModeChanged += OnPowerChange; tSOptions.Visible = false; bool firstrun = false; @@ -184,16 +183,14 @@ namespace DS4Windows Log.GuiLog += On_Debug; logFile = appdatapath + "\\DS4Windows.log"; - //logWriter = File.AppendText(logFile); Log.TrayIconLog += ShowNotification; - // tmrUpdate.Enabled = true; TODO remove tmrUpdate and leave tick() Directory.CreateDirectory(appdatapath); Global.Load(); if (!Save()) //if can't write to file { if (MessageBox.Show("Cannot write at current location\nCopy Settings to appdata?", "DS4Windows", - MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == System.Windows.Forms.DialogResult.Yes) + MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes) { try { @@ -270,12 +267,14 @@ namespace DS4Windows if (Path.GetExtension(s) == ".xml") { xDoc.Load(s); - XmlNode el = xDoc.SelectSingleNode("DS4Windows/ProfileActions"); //.CreateElement("Action"); + XmlNode el = xDoc.SelectSingleNode("DS4Windows/ProfileActions"); if (el != null) + { if (string.IsNullOrEmpty(el.InnerText)) el.InnerText = "Disconnect Controller"; else el.InnerText += "/Disconnect Controller"; + } else { XmlNode Node = xDoc.SelectSingleNode("DS4Windows"); @@ -283,6 +282,7 @@ namespace DS4Windows el.InnerText = "Disconnect Controller"; Node.AppendChild(el); } + xDoc.Save(s); LoadActions(); } @@ -312,11 +312,10 @@ namespace DS4Windows Form_Resize(null, null); RefreshProfiles(); opt = new Options(this); - //opt.Text = "Options for Controller " + (devID + 1); opt.Icon = this.Icon; opt.TopLevel = false; opt.Dock = DockStyle.Fill; - opt.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; + opt.FormBorderStyle = FormBorderStyle.None; tabProfiles.Controls.Add(opt); for (int i = 0; i < 4; i++) @@ -1374,7 +1373,7 @@ namespace DS4Windows private void pBStatus_MouseClick(object sender, MouseEventArgs e) { - int i = Int32.Parse(((PictureBox)sender).Tag.ToString()); + int i = Convert.ToInt32(((PictureBox)sender).Tag); DS4Device d = Program.rootHub.DS4Controllers[i]; if (d != null) { @@ -1412,8 +1411,6 @@ namespace DS4Windows protected void On_Debug(object sender, DebugEventArgs e) { - //logWriter.WriteLine(e.Time + ":\t" + e.Data); - //logWriter.Flush(); LogDebug(e.Time, e.Data, e.Warning); } @@ -1613,7 +1610,7 @@ namespace DS4Windows this.Show(); WindowState = FormWindowState.Normal; ToolStripMenuItem em = (ToolStripMenuItem)sender; - int i = Int32.Parse(em.Tag.ToString()); + int i = Convert.ToInt32(em.Tag); if (em.Text == Properties.Resources.ContextNew.Replace("*number*", (i + 1).ToString())) ShowOptions(i, ""); else @@ -1668,7 +1665,7 @@ namespace DS4Windows private void Profile_Changed(object sender, EventArgs e) //cbs[i] changed { ComboBox cb = (ComboBox)sender; - int tdevice = Int32.Parse(cb.Tag.ToString()); + int tdevice = Convert.ToInt32(cb.Tag); if (cb.Items[cb.Items.Count - 1].ToString() == "+" + Properties.Resources.PlusNewProfile) { if (cb.SelectedIndex < cb.Items.Count - 1) @@ -1701,7 +1698,7 @@ namespace DS4Windows private void Profile_Changed_Menu(object sender, ToolStripItemClickedEventArgs e) { ToolStripMenuItem tS = (ToolStripMenuItem)sender; - int tdevice = Int32.Parse(tS.Tag.ToString()); + int tdevice = Convert.ToInt32(tS.Tag); if (!(e.ClickedItem is ToolStripSeparator)) { if (e.ClickedItem != tS.DropDownItems[tS.DropDownItems.Count - 1]) //if +New Profile not selected @@ -1835,12 +1832,6 @@ namespace DS4Windows lbLastMessage.Text = lvDebug.Items[lvDebug.Items.Count - 1].SubItems[1].Text; else lbLastMessage.Text = ""; - - /*if (tabMain.SelectedIndex != 1 || !opt.Visible) - opt.inputtimer.Stop(); - else if (opt.Visible && tabMain.SelectedIndex == 1) - opt.inputtimer.Start(); - */ } private void Items_MouseHover(object sender, EventArgs e) @@ -1853,23 +1844,6 @@ namespace DS4Windows } lbLastMessage.Text = hoverText; - - /*switch (((System.Windows.Forms.Control)sender).Name) - { - //if (File.Exists(appdatapath + "\\Auto Profiles.xml")) - case "linkUninstall": lbLastMessage.Text = Properties.Resources.IfRemovingDS4Windows; break; - case "cBSwipeProfiles": lbLastMessage.Text = Properties.Resources.TwoFingerSwipe; break; - case "cBQuickCharge": lbLastMessage.Text = Properties.Resources.QuickCharge; break; - case "pnlXIPorts": lbLastMessage.Text = Properties.Resources.XinputPorts; break; - case "lbUseXIPorts": lbLastMessage.Text = Properties.Resources.XinputPorts; break; - case "nUDXIPorts": lbLastMessage.Text = Properties.Resources.XinputPorts; break; - case "lbLastXIPort": lbLastMessage.Text = Properties.Resources.XinputPorts; break; - case "cBCloseMini": lbLastMessage.Text = Properties.Resources.CloseMinimize; break; - default: lbLastMessage.Text = Properties.Resources.HoverOverItems; break; - } - */ - - //if (lbLastMessage.Text != Properties.Resources.HoverOverItems) if (hoverText != Properties.Resources.HoverOverItems) lbLastMessage.ForeColor = Color.Black; else @@ -2223,6 +2197,9 @@ namespace DS4Windows blankControllerTab(); Program.rootHub.Stop(); } + + // Make sure to stop event generation routines. Should fix odd crashes on shutdown + Application.Exit(); } private void cBSwipeProfiles_CheckedChanged(object sender, EventArgs e) @@ -2296,7 +2273,7 @@ namespace DS4Windows private void Pads_MouseHover(object sender, EventArgs e) { Label lb = (Label)sender; - int i = Int32.Parse(lb.Tag.ToString()); + int i = Convert.ToInt32(lb.Tag); DS4Device d = Program.rootHub.DS4Controllers[i]; if (d != null && d.ConnectionType == ConnectionType.BT) { @@ -2331,10 +2308,12 @@ namespace DS4Windows int currentCustomLed; private void EditCustomLed(object sender, EventArgs e) { - currentCustomLed = int.Parse(((Button)sender).Tag.ToString()); - useCustomColorToolStripMenuItem.Checked = UseCustomLed[currentCustomLed]; - useProfileColorToolStripMenuItem.Checked = !UseCustomLed[currentCustomLed]; - cMCustomLed.Show((Button)sender, new Point(0, ((Button)sender).Height)); + Button btn = (Button)sender; + currentCustomLed = Convert.ToInt32(btn.Tag); + bool customLedChecked = UseCustomLed[currentCustomLed]; + useCustomColorToolStripMenuItem.Checked = customLedChecked; + useProfileColorToolStripMenuItem.Checked = !customLedChecked; + cMCustomLed.Show(btn, new Point(0, btn.Height)); } private void useProfileColorToolStripMenuItem_Click(object sender, EventArgs e) @@ -2422,7 +2401,7 @@ namespace DS4Windows if (principal.IsInRole(WindowsBuiltInRole.Administrator)) { TaskService ts = new TaskService(); - Microsoft.Win32.TaskScheduler.Task tasker = ts.FindTask("RunDS4Windows"); + Task tasker = ts.FindTask("RunDS4Windows"); if (tasker != null) { ts.RootFolder.DeleteTask("RunDS4Windows"); @@ -2444,7 +2423,7 @@ namespace DS4Windows if (principal.IsInRole(WindowsBuiltInRole.Administrator)) { TaskService ts = new TaskService(); - Microsoft.Win32.TaskScheduler.Task tasker = ts.FindTask("RunDS4Windows"); + Task tasker = ts.FindTask("RunDS4Windows"); if (tasker != null) { ts.RootFolder.DeleteTask("RunDS4Windows"); diff --git a/DS4Windows/DS4Forms/Options.Designer.cs b/DS4Windows/DS4Forms/Options.Designer.cs index 9403069..40e057b 100644 --- a/DS4Windows/DS4Forms/Options.Designer.cs +++ b/DS4Windows/DS4Forms/Options.Designer.cs @@ -76,6 +76,8 @@ this.nUDL2 = new System.Windows.Forms.NumericUpDown(); this.gBTouchpad = new System.Windows.Forms.GroupBox(); this.pnlTPMouse = new System.Windows.Forms.Panel(); + this.label15 = new System.Windows.Forms.Label(); + this.touchpadInvertComboBox = new System.Windows.Forms.ComboBox(); this.cbStartTouchpadOff = new System.Windows.Forms.CheckBox(); this.rBTPControls = new System.Windows.Forms.RadioButton(); this.rBTPMouse = new System.Windows.Forms.RadioButton(); @@ -253,6 +255,10 @@ this.tCSens = new System.Windows.Forms.TabControl(); this.tPDeadzone = new System.Windows.Forms.TabPage(); this.antiDeadzoneTabPage = new System.Windows.Forms.TabPage(); + this.nUDSixaxisZAntiDead = new System.Windows.Forms.NumericUpDown(); + this.nUDSixaxisXAntiDead = new System.Windows.Forms.NumericUpDown(); + this.label20 = new System.Windows.Forms.Label(); + this.label19 = new System.Windows.Forms.Label(); this.nUDR2AntiDead = new System.Windows.Forms.NumericUpDown(); this.label3 = new System.Windows.Forms.Label(); this.nUDL2AntiDead = new System.Windows.Forms.NumericUpDown(); @@ -262,6 +268,10 @@ this.nUDLSAntiDead = new System.Windows.Forms.NumericUpDown(); this.label1 = new System.Windows.Forms.Label(); this.maxZoneTabPage = new System.Windows.Forms.TabPage(); + this.nUDSixAxisZMaxZone = new System.Windows.Forms.NumericUpDown(); + this.nUDSixAxisXMaxZone = new System.Windows.Forms.NumericUpDown(); + this.label18 = new System.Windows.Forms.Label(); + this.label17 = new System.Windows.Forms.Label(); this.nUDR2Maxzone = new System.Windows.Forms.NumericUpDown(); this.nUDL2Maxzone = new System.Windows.Forms.NumericUpDown(); this.label8 = new System.Windows.Forms.Label(); @@ -270,6 +280,19 @@ this.label6 = new System.Windows.Forms.Label(); this.nUDLSMaxZone = new System.Windows.Forms.NumericUpDown(); this.label5 = new System.Windows.Forms.Label(); + this.tPOutCurve = new System.Windows.Forms.TabPage(); + this.cBSixaxisZOutputCurve = new System.Windows.Forms.ComboBox(); + this.cBSixaxisXOutputCurve = new System.Windows.Forms.ComboBox(); + this.label24 = new System.Windows.Forms.Label(); + this.label23 = new System.Windows.Forms.Label(); + this.cBR2OutputCurve = new System.Windows.Forms.ComboBox(); + this.cBL2OutputCurve = new System.Windows.Forms.ComboBox(); + this.label22 = new System.Windows.Forms.Label(); + this.label21 = new System.Windows.Forms.Label(); + this.rsOutCurveComboBox = new System.Windows.Forms.ComboBox(); + this.lsOutCurveComboBox = new System.Windows.Forms.ComboBox(); + this.label10 = new System.Windows.Forms.Label(); + this.label9 = new System.Windows.Forms.Label(); this.tPCurve = new System.Windows.Forms.TabPage(); this.nUDLSCurve = new System.Windows.Forms.NumericUpDown(); this.nUDRSCurve = new System.Windows.Forms.NumericUpDown(); @@ -277,16 +300,18 @@ this.lbRSCurvePercent = new System.Windows.Forms.Label(); this.lbLSCurvePercent = new System.Windows.Forms.Label(); this.lbLSCurve = new System.Windows.Forms.Label(); - this.tPOutCurve = new System.Windows.Forms.TabPage(); - this.rsOutCurveComboBox = new System.Windows.Forms.ComboBox(); - this.lsOutCurveComboBox = new System.Windows.Forms.ComboBox(); - this.label10 = new System.Windows.Forms.Label(); - this.label9 = new System.Windows.Forms.Label(); + this.tpRotation = new System.Windows.Forms.TabPage(); + this.nUDRSRotation = new System.Windows.Forms.NumericUpDown(); + this.label14 = new System.Windows.Forms.Label(); + this.nUDLSRotation = new System.Windows.Forms.NumericUpDown(); + this.label13 = new System.Windows.Forms.Label(); this.fLPSettings = new System.Windows.Forms.FlowLayoutPanel(); this.gBGyro = new System.Windows.Forms.GroupBox(); this.rBSAControls = new System.Windows.Forms.RadioButton(); this.rBSAMouse = new System.Windows.Forms.RadioButton(); this.pnlSAMouse = new System.Windows.Forms.Panel(); + this.cBGyroMouseXAxis = new System.Windows.Forms.ComboBox(); + this.label16 = new System.Windows.Forms.Label(); this.lbGyroSmooth = new System.Windows.Forms.Label(); this.cBGyroSmooth = new System.Windows.Forms.CheckBox(); this.lbSmoothWeight = new System.Windows.Forms.Label(); @@ -337,11 +362,6 @@ this.pSToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.alwaysOnToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.advColorDialog = new DS4Windows.AdvancedColorDialog(); - this.tpRotation = new System.Windows.Forms.TabPage(); - this.label13 = new System.Windows.Forms.Label(); - this.nUDLSRotation = new System.Windows.Forms.NumericUpDown(); - this.label14 = new System.Windows.Forms.Label(); - this.nUDRSRotation = new System.Windows.Forms.NumericUpDown(); ((System.ComponentModel.ISupportInitialize)(this.nUDRainbow)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.tBBlueBar)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.tBGreenBar)).BeginInit(); @@ -399,19 +419,26 @@ this.tCSens.SuspendLayout(); this.tPDeadzone.SuspendLayout(); this.antiDeadzoneTabPage.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.nUDSixaxisZAntiDead)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.nUDSixaxisXAntiDead)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.nUDR2AntiDead)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.nUDL2AntiDead)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.nUDRSAntiDead)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.nUDLSAntiDead)).BeginInit(); this.maxZoneTabPage.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.nUDSixAxisZMaxZone)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.nUDSixAxisXMaxZone)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.nUDR2Maxzone)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.nUDL2Maxzone)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.nUDRSMaxZone)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.nUDLSMaxZone)).BeginInit(); + this.tPOutCurve.SuspendLayout(); this.tPCurve.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.nUDLSCurve)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.nUDRSCurve)).BeginInit(); - this.tPOutCurve.SuspendLayout(); + this.tpRotation.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.nUDRSRotation)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.nUDLSRotation)).BeginInit(); this.fLPSettings.SuspendLayout(); this.gBGyro.SuspendLayout(); this.pnlSAMouse.SuspendLayout(); @@ -426,9 +453,6 @@ ((System.ComponentModel.ISupportInitialize)(this.nUDSXS)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.nUDSZS)).BeginInit(); this.cMGyroTriggers.SuspendLayout(); - this.tpRotation.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.nUDLSRotation)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.nUDRSRotation)).BeginInit(); this.SuspendLayout(); // // lowColorChooserButton @@ -887,6 +911,8 @@ // // pnlTPMouse // + this.pnlTPMouse.Controls.Add(this.label15); + this.pnlTPMouse.Controls.Add(this.touchpadInvertComboBox); this.pnlTPMouse.Controls.Add(this.nUDScroll); this.pnlTPMouse.Controls.Add(this.cBDoubleTap); this.pnlTPMouse.Controls.Add(this.cBScroll); @@ -900,6 +926,24 @@ resources.ApplyResources(this.pnlTPMouse, "pnlTPMouse"); this.pnlTPMouse.Name = "pnlTPMouse"; // + // label15 + // + resources.ApplyResources(this.label15, "label15"); + this.label15.Name = "label15"; + // + // touchpadInvertComboBox + // + this.touchpadInvertComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.touchpadInvertComboBox.FormattingEnabled = true; + this.touchpadInvertComboBox.Items.AddRange(new object[] { + resources.GetString("touchpadInvertComboBox.Items"), + resources.GetString("touchpadInvertComboBox.Items1"), + resources.GetString("touchpadInvertComboBox.Items2"), + resources.GetString("touchpadInvertComboBox.Items3")}); + resources.ApplyResources(this.touchpadInvertComboBox, "touchpadInvertComboBox"); + this.touchpadInvertComboBox.Name = "touchpadInvertComboBox"; + this.touchpadInvertComboBox.SelectedIndexChanged += new System.EventHandler(this.touchpadInvertComboBox_SelectedIndexChanged); + // // cbStartTouchpadOff // resources.ApplyResources(this.cbStartTouchpadOff, "cbStartTouchpadOff"); @@ -2639,8 +2683,8 @@ this.tCSens.Controls.Add(this.tPDeadzone); this.tCSens.Controls.Add(this.antiDeadzoneTabPage); this.tCSens.Controls.Add(this.maxZoneTabPage); - this.tCSens.Controls.Add(this.tPCurve); this.tCSens.Controls.Add(this.tPOutCurve); + this.tCSens.Controls.Add(this.tPCurve); this.tCSens.Controls.Add(this.tpRotation); resources.ApplyResources(this.tCSens, "tCSens"); this.tCSens.Name = "tCSens"; @@ -2666,6 +2710,10 @@ // // antiDeadzoneTabPage // + this.antiDeadzoneTabPage.Controls.Add(this.nUDSixaxisZAntiDead); + this.antiDeadzoneTabPage.Controls.Add(this.nUDSixaxisXAntiDead); + this.antiDeadzoneTabPage.Controls.Add(this.label20); + this.antiDeadzoneTabPage.Controls.Add(this.label19); this.antiDeadzoneTabPage.Controls.Add(this.nUDR2AntiDead); this.antiDeadzoneTabPage.Controls.Add(this.label3); this.antiDeadzoneTabPage.Controls.Add(this.nUDL2AntiDead); @@ -2678,6 +2726,50 @@ this.antiDeadzoneTabPage.Name = "antiDeadzoneTabPage"; this.antiDeadzoneTabPage.UseVisualStyleBackColor = true; // + // nUDSixaxisZAntiDead + // + this.nUDSixaxisZAntiDead.DecimalPlaces = 2; + this.nUDSixaxisZAntiDead.Increment = new decimal(new int[] { + 1, + 0, + 0, + 65536}); + resources.ApplyResources(this.nUDSixaxisZAntiDead, "nUDSixaxisZAntiDead"); + this.nUDSixaxisZAntiDead.Maximum = new decimal(new int[] { + 1, + 0, + 0, + 0}); + this.nUDSixaxisZAntiDead.Name = "nUDSixaxisZAntiDead"; + this.nUDSixaxisZAntiDead.ValueChanged += new System.EventHandler(this.nUDSixaxisZAntiDead_ValueChanged); + // + // nUDSixaxisXAntiDead + // + this.nUDSixaxisXAntiDead.DecimalPlaces = 2; + this.nUDSixaxisXAntiDead.Increment = new decimal(new int[] { + 1, + 0, + 0, + 65536}); + resources.ApplyResources(this.nUDSixaxisXAntiDead, "nUDSixaxisXAntiDead"); + this.nUDSixaxisXAntiDead.Maximum = new decimal(new int[] { + 1, + 0, + 0, + 0}); + this.nUDSixaxisXAntiDead.Name = "nUDSixaxisXAntiDead"; + this.nUDSixaxisXAntiDead.ValueChanged += new System.EventHandler(this.nUDSixaxisXAntiDead_ValueChanged); + // + // label20 + // + resources.ApplyResources(this.label20, "label20"); + this.label20.Name = "label20"; + // + // label19 + // + resources.ApplyResources(this.label19, "label19"); + this.label19.Name = "label19"; + // // nUDR2AntiDead // this.nUDR2AntiDead.DecimalPlaces = 2; @@ -2768,6 +2860,10 @@ // // maxZoneTabPage // + this.maxZoneTabPage.Controls.Add(this.nUDSixAxisZMaxZone); + this.maxZoneTabPage.Controls.Add(this.nUDSixAxisXMaxZone); + this.maxZoneTabPage.Controls.Add(this.label18); + this.maxZoneTabPage.Controls.Add(this.label17); this.maxZoneTabPage.Controls.Add(this.nUDR2Maxzone); this.maxZoneTabPage.Controls.Add(this.nUDL2Maxzone); this.maxZoneTabPage.Controls.Add(this.label8); @@ -2780,6 +2876,60 @@ this.maxZoneTabPage.Name = "maxZoneTabPage"; this.maxZoneTabPage.UseVisualStyleBackColor = true; // + // nUDSixAxisZMaxZone + // + this.nUDSixAxisZMaxZone.DecimalPlaces = 2; + this.nUDSixAxisZMaxZone.Increment = new decimal(new int[] { + 1, + 0, + 0, + 65536}); + resources.ApplyResources(this.nUDSixAxisZMaxZone, "nUDSixAxisZMaxZone"); + this.nUDSixAxisZMaxZone.Maximum = new decimal(new int[] { + 1, + 0, + 0, + 0}); + this.nUDSixAxisZMaxZone.Name = "nUDSixAxisZMaxZone"; + this.nUDSixAxisZMaxZone.Value = new decimal(new int[] { + 1, + 0, + 0, + 0}); + this.nUDSixAxisZMaxZone.ValueChanged += new System.EventHandler(this.nUDSixAxisZMaxZone_ValueChanged); + // + // nUDSixAxisXMaxZone + // + this.nUDSixAxisXMaxZone.DecimalPlaces = 2; + this.nUDSixAxisXMaxZone.Increment = new decimal(new int[] { + 1, + 0, + 0, + 65536}); + resources.ApplyResources(this.nUDSixAxisXMaxZone, "nUDSixAxisXMaxZone"); + this.nUDSixAxisXMaxZone.Maximum = new decimal(new int[] { + 1, + 0, + 0, + 0}); + this.nUDSixAxisXMaxZone.Name = "nUDSixAxisXMaxZone"; + this.nUDSixAxisXMaxZone.Value = new decimal(new int[] { + 1, + 0, + 0, + 0}); + this.nUDSixAxisXMaxZone.ValueChanged += new System.EventHandler(this.nUDSixAxisXMaxZone_ValueChanged); + // + // label18 + // + resources.ApplyResources(this.label18, "label18"); + this.label18.Name = "label18"; + // + // label17 + // + resources.ApplyResources(this.label17, "label17"); + this.label17.Name = "label17"; + // // nUDR2Maxzone // this.nUDR2Maxzone.DecimalPlaces = 2; @@ -2888,6 +3038,134 @@ resources.ApplyResources(this.label5, "label5"); this.label5.Name = "label5"; // + // tPOutCurve + // + this.tPOutCurve.Controls.Add(this.cBSixaxisZOutputCurve); + this.tPOutCurve.Controls.Add(this.cBSixaxisXOutputCurve); + this.tPOutCurve.Controls.Add(this.label24); + this.tPOutCurve.Controls.Add(this.label23); + this.tPOutCurve.Controls.Add(this.cBR2OutputCurve); + this.tPOutCurve.Controls.Add(this.cBL2OutputCurve); + this.tPOutCurve.Controls.Add(this.label22); + this.tPOutCurve.Controls.Add(this.label21); + this.tPOutCurve.Controls.Add(this.rsOutCurveComboBox); + this.tPOutCurve.Controls.Add(this.lsOutCurveComboBox); + this.tPOutCurve.Controls.Add(this.label10); + this.tPOutCurve.Controls.Add(this.label9); + resources.ApplyResources(this.tPOutCurve, "tPOutCurve"); + this.tPOutCurve.Name = "tPOutCurve"; + this.tPOutCurve.UseVisualStyleBackColor = true; + // + // cBSixaxisZOutputCurve + // + this.cBSixaxisZOutputCurve.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.cBSixaxisZOutputCurve.DropDownWidth = 70; + this.cBSixaxisZOutputCurve.FormattingEnabled = true; + this.cBSixaxisZOutputCurve.Items.AddRange(new object[] { + resources.GetString("cBSixaxisZOutputCurve.Items"), + resources.GetString("cBSixaxisZOutputCurve.Items1"), + resources.GetString("cBSixaxisZOutputCurve.Items2")}); + resources.ApplyResources(this.cBSixaxisZOutputCurve, "cBSixaxisZOutputCurve"); + this.cBSixaxisZOutputCurve.Name = "cBSixaxisZOutputCurve"; + this.cBSixaxisZOutputCurve.SelectedIndexChanged += new System.EventHandler(this.cBSixaxisZOutputCurve_SelectedIndexChanged); + // + // cBSixaxisXOutputCurve + // + this.cBSixaxisXOutputCurve.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.cBSixaxisXOutputCurve.DropDownWidth = 70; + this.cBSixaxisXOutputCurve.FormattingEnabled = true; + this.cBSixaxisXOutputCurve.Items.AddRange(new object[] { + resources.GetString("cBSixaxisXOutputCurve.Items"), + resources.GetString("cBSixaxisXOutputCurve.Items1"), + resources.GetString("cBSixaxisXOutputCurve.Items2")}); + resources.ApplyResources(this.cBSixaxisXOutputCurve, "cBSixaxisXOutputCurve"); + this.cBSixaxisXOutputCurve.Name = "cBSixaxisXOutputCurve"; + this.cBSixaxisXOutputCurve.SelectedIndexChanged += new System.EventHandler(this.cBSixaxisXOutputCurve_SelectedIndexChanged); + // + // label24 + // + resources.ApplyResources(this.label24, "label24"); + this.label24.Name = "label24"; + // + // label23 + // + resources.ApplyResources(this.label23, "label23"); + this.label23.Name = "label23"; + // + // cBR2OutputCurve + // + this.cBR2OutputCurve.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.cBR2OutputCurve.DropDownWidth = 70; + this.cBR2OutputCurve.FormattingEnabled = true; + this.cBR2OutputCurve.Items.AddRange(new object[] { + resources.GetString("cBR2OutputCurve.Items"), + resources.GetString("cBR2OutputCurve.Items1"), + resources.GetString("cBR2OutputCurve.Items2")}); + resources.ApplyResources(this.cBR2OutputCurve, "cBR2OutputCurve"); + this.cBR2OutputCurve.Name = "cBR2OutputCurve"; + this.cBR2OutputCurve.SelectedIndexChanged += new System.EventHandler(this.cBR2OutputCurve_SelectedIndexChanged); + // + // cBL2OutputCurve + // + this.cBL2OutputCurve.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.cBL2OutputCurve.DropDownWidth = 70; + this.cBL2OutputCurve.FormattingEnabled = true; + this.cBL2OutputCurve.Items.AddRange(new object[] { + resources.GetString("cBL2OutputCurve.Items"), + resources.GetString("cBL2OutputCurve.Items1"), + resources.GetString("cBL2OutputCurve.Items2")}); + resources.ApplyResources(this.cBL2OutputCurve, "cBL2OutputCurve"); + this.cBL2OutputCurve.Name = "cBL2OutputCurve"; + this.cBL2OutputCurve.SelectedIndexChanged += new System.EventHandler(this.cBL2OutputCurve_SelectedIndexChanged); + // + // label22 + // + resources.ApplyResources(this.label22, "label22"); + this.label22.Name = "label22"; + // + // label21 + // + resources.ApplyResources(this.label21, "label21"); + this.label21.Name = "label21"; + // + // rsOutCurveComboBox + // + this.rsOutCurveComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.rsOutCurveComboBox.DropDownWidth = 120; + this.rsOutCurveComboBox.FormattingEnabled = true; + this.rsOutCurveComboBox.Items.AddRange(new object[] { + resources.GetString("rsOutCurveComboBox.Items"), + resources.GetString("rsOutCurveComboBox.Items1"), + resources.GetString("rsOutCurveComboBox.Items2"), + resources.GetString("rsOutCurveComboBox.Items3")}); + resources.ApplyResources(this.rsOutCurveComboBox, "rsOutCurveComboBox"); + this.rsOutCurveComboBox.Name = "rsOutCurveComboBox"; + this.rsOutCurveComboBox.SelectedIndexChanged += new System.EventHandler(this.rsOutCurveComboBox_SelectedIndexChanged); + // + // lsOutCurveComboBox + // + this.lsOutCurveComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.lsOutCurveComboBox.DropDownWidth = 120; + this.lsOutCurveComboBox.FormattingEnabled = true; + this.lsOutCurveComboBox.Items.AddRange(new object[] { + resources.GetString("lsOutCurveComboBox.Items"), + resources.GetString("lsOutCurveComboBox.Items1"), + resources.GetString("lsOutCurveComboBox.Items2"), + resources.GetString("lsOutCurveComboBox.Items3")}); + resources.ApplyResources(this.lsOutCurveComboBox, "lsOutCurveComboBox"); + this.lsOutCurveComboBox.Name = "lsOutCurveComboBox"; + this.lsOutCurveComboBox.SelectedIndexChanged += new System.EventHandler(this.lsOutCurveComboBox_SelectedIndexChanged); + // + // label10 + // + resources.ApplyResources(this.label10, "label10"); + this.label10.Name = "label10"; + // + // label9 + // + resources.ApplyResources(this.label9, "label9"); + this.label9.Name = "label9"; + // // tPCurve // this.tPCurve.BackColor = System.Drawing.Color.WhiteSmoke; @@ -2942,53 +3220,57 @@ resources.ApplyResources(this.lbLSCurve, "lbLSCurve"); this.lbLSCurve.Name = "lbLSCurve"; // - // tPOutCurve + // tpRotation // - this.tPOutCurve.Controls.Add(this.rsOutCurveComboBox); - this.tPOutCurve.Controls.Add(this.lsOutCurveComboBox); - this.tPOutCurve.Controls.Add(this.label10); - this.tPOutCurve.Controls.Add(this.label9); - resources.ApplyResources(this.tPOutCurve, "tPOutCurve"); - this.tPOutCurve.Name = "tPOutCurve"; - this.tPOutCurve.UseVisualStyleBackColor = true; + this.tpRotation.Controls.Add(this.nUDRSRotation); + this.tpRotation.Controls.Add(this.label14); + this.tpRotation.Controls.Add(this.nUDLSRotation); + this.tpRotation.Controls.Add(this.label13); + resources.ApplyResources(this.tpRotation, "tpRotation"); + this.tpRotation.Name = "tpRotation"; + this.tpRotation.UseVisualStyleBackColor = true; // - // rsOutCurveComboBox + // nUDRSRotation // - this.rsOutCurveComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.rsOutCurveComboBox.DropDownWidth = 100; - this.rsOutCurveComboBox.FormattingEnabled = true; - this.rsOutCurveComboBox.Items.AddRange(new object[] { - resources.GetString("rsOutCurveComboBox.Items"), - resources.GetString("rsOutCurveComboBox.Items1"), - resources.GetString("rsOutCurveComboBox.Items2"), - resources.GetString("rsOutCurveComboBox.Items3")}); - resources.ApplyResources(this.rsOutCurveComboBox, "rsOutCurveComboBox"); - this.rsOutCurveComboBox.Name = "rsOutCurveComboBox"; - this.rsOutCurveComboBox.SelectedIndexChanged += new System.EventHandler(this.rsOutCurveComboBox_SelectedIndexChanged); + resources.ApplyResources(this.nUDRSRotation, "nUDRSRotation"); + this.nUDRSRotation.Maximum = new decimal(new int[] { + 180, + 0, + 0, + 0}); + this.nUDRSRotation.Minimum = new decimal(new int[] { + 180, + 0, + 0, + -2147483648}); + this.nUDRSRotation.Name = "nUDRSRotation"; + this.nUDRSRotation.ValueChanged += new System.EventHandler(this.nUDRSRotation_ValueChanged); // - // lsOutCurveComboBox + // label14 // - this.lsOutCurveComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.lsOutCurveComboBox.DropDownWidth = 100; - this.lsOutCurveComboBox.FormattingEnabled = true; - this.lsOutCurveComboBox.Items.AddRange(new object[] { - resources.GetString("lsOutCurveComboBox.Items"), - resources.GetString("lsOutCurveComboBox.Items1"), - resources.GetString("lsOutCurveComboBox.Items2"), - resources.GetString("lsOutCurveComboBox.Items3")}); - resources.ApplyResources(this.lsOutCurveComboBox, "lsOutCurveComboBox"); - this.lsOutCurveComboBox.Name = "lsOutCurveComboBox"; - this.lsOutCurveComboBox.SelectedIndexChanged += new System.EventHandler(this.lsOutCurveComboBox_SelectedIndexChanged); + resources.ApplyResources(this.label14, "label14"); + this.label14.Name = "label14"; // - // label10 + // nUDLSRotation // - resources.ApplyResources(this.label10, "label10"); - this.label10.Name = "label10"; + resources.ApplyResources(this.nUDLSRotation, "nUDLSRotation"); + this.nUDLSRotation.Maximum = new decimal(new int[] { + 180, + 0, + 0, + 0}); + this.nUDLSRotation.Minimum = new decimal(new int[] { + 180, + 0, + 0, + -2147483648}); + this.nUDLSRotation.Name = "nUDLSRotation"; + this.nUDLSRotation.ValueChanged += new System.EventHandler(this.nUDLSRotation_ValueChanged); // - // label9 + // label13 // - resources.ApplyResources(this.label9, "label9"); - this.label9.Name = "label9"; + resources.ApplyResources(this.label13, "label13"); + this.label13.Name = "label13"; // // fLPSettings // @@ -3031,6 +3313,8 @@ // // pnlSAMouse // + this.pnlSAMouse.Controls.Add(this.cBGyroMouseXAxis); + this.pnlSAMouse.Controls.Add(this.label16); this.pnlSAMouse.Controls.Add(this.lbGyroSmooth); this.pnlSAMouse.Controls.Add(this.cBGyroSmooth); this.pnlSAMouse.Controls.Add(this.lbSmoothWeight); @@ -3049,6 +3333,22 @@ resources.ApplyResources(this.pnlSAMouse, "pnlSAMouse"); this.pnlSAMouse.Name = "pnlSAMouse"; // + // cBGyroMouseXAxis + // + this.cBGyroMouseXAxis.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.cBGyroMouseXAxis.FormattingEnabled = true; + this.cBGyroMouseXAxis.Items.AddRange(new object[] { + resources.GetString("cBGyroMouseXAxis.Items"), + resources.GetString("cBGyroMouseXAxis.Items1")}); + resources.ApplyResources(this.cBGyroMouseXAxis, "cBGyroMouseXAxis"); + this.cBGyroMouseXAxis.Name = "cBGyroMouseXAxis"; + this.cBGyroMouseXAxis.SelectedIndexChanged += new System.EventHandler(this.cBGyroMouseXAxis_SelectedIndexChanged); + // + // label16 + // + resources.ApplyResources(this.label16, "label16"); + this.label16.Name = "label16"; + // // lbGyroSmooth // resources.ApplyResources(this.lbGyroSmooth, "lbGyroSmooth"); @@ -3575,58 +3875,6 @@ resources.ApplyResources(this.alwaysOnToolStripMenuItem, "alwaysOnToolStripMenuItem"); this.alwaysOnToolStripMenuItem.CheckedChanged += new System.EventHandler(this.SATrigger_CheckedChanged); // - // tpRotation - // - this.tpRotation.Controls.Add(this.nUDRSRotation); - this.tpRotation.Controls.Add(this.label14); - this.tpRotation.Controls.Add(this.nUDLSRotation); - this.tpRotation.Controls.Add(this.label13); - resources.ApplyResources(this.tpRotation, "tpRotation"); - this.tpRotation.Name = "tpRotation"; - this.tpRotation.UseVisualStyleBackColor = true; - // - // label13 - // - resources.ApplyResources(this.label13, "label13"); - this.label13.Name = "label13"; - // - // nUDLSRotation - // - resources.ApplyResources(this.nUDLSRotation, "nUDLSRotation"); - this.nUDLSRotation.Maximum = new decimal(new int[] { - 180, - 0, - 0, - 0}); - this.nUDLSRotation.Minimum = new decimal(new int[] { - 180, - 0, - 0, - -2147483648}); - this.nUDLSRotation.Name = "nUDLSRotation"; - this.nUDLSRotation.ValueChanged += new System.EventHandler(this.nUDLSRotation_ValueChanged); - // - // label14 - // - resources.ApplyResources(this.label14, "label14"); - this.label14.Name = "label14"; - // - // nUDRSRotation - // - resources.ApplyResources(this.nUDRSRotation, "nUDRSRotation"); - this.nUDRSRotation.Maximum = new decimal(new int[] { - 180, - 0, - 0, - 0}); - this.nUDRSRotation.Minimum = new decimal(new int[] { - 180, - 0, - 0, - -2147483648}); - this.nUDRSRotation.Name = "nUDRSRotation"; - this.nUDRSRotation.ValueChanged += new System.EventHandler(this.nUDRSRotation_ValueChanged); - // // Options // resources.ApplyResources(this, "$this"); @@ -3707,22 +3955,30 @@ this.tPDeadzone.PerformLayout(); this.antiDeadzoneTabPage.ResumeLayout(false); this.antiDeadzoneTabPage.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.nUDSixaxisZAntiDead)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.nUDSixaxisXAntiDead)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.nUDR2AntiDead)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.nUDL2AntiDead)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.nUDRSAntiDead)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.nUDLSAntiDead)).EndInit(); this.maxZoneTabPage.ResumeLayout(false); this.maxZoneTabPage.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.nUDSixAxisZMaxZone)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.nUDSixAxisXMaxZone)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.nUDR2Maxzone)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.nUDL2Maxzone)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.nUDRSMaxZone)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.nUDLSMaxZone)).EndInit(); + this.tPOutCurve.ResumeLayout(false); + this.tPOutCurve.PerformLayout(); this.tPCurve.ResumeLayout(false); this.tPCurve.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.nUDLSCurve)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.nUDRSCurve)).EndInit(); - this.tPOutCurve.ResumeLayout(false); - this.tPOutCurve.PerformLayout(); + this.tpRotation.ResumeLayout(false); + this.tpRotation.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.nUDRSRotation)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.nUDLSRotation)).EndInit(); this.fLPSettings.ResumeLayout(false); this.gBGyro.ResumeLayout(false); this.gBGyro.PerformLayout(); @@ -3740,10 +3996,6 @@ ((System.ComponentModel.ISupportInitialize)(this.nUDSXS)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.nUDSZS)).EndInit(); this.cMGyroTriggers.ResumeLayout(false); - this.tpRotation.ResumeLayout(false); - this.tpRotation.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.nUDLSRotation)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.nUDRSRotation)).EndInit(); this.ResumeLayout(false); } @@ -4064,5 +4316,25 @@ private System.Windows.Forms.Label label14; private System.Windows.Forms.NumericUpDown nUDLSRotation; private System.Windows.Forms.Label label13; + private System.Windows.Forms.Label label15; + private System.Windows.Forms.ComboBox touchpadInvertComboBox; + private System.Windows.Forms.ComboBox cBGyroMouseXAxis; + private System.Windows.Forms.Label label16; + private System.Windows.Forms.NumericUpDown nUDSixAxisZMaxZone; + private System.Windows.Forms.NumericUpDown nUDSixAxisXMaxZone; + private System.Windows.Forms.Label label18; + private System.Windows.Forms.Label label17; + private System.Windows.Forms.NumericUpDown nUDSixaxisZAntiDead; + private System.Windows.Forms.NumericUpDown nUDSixaxisXAntiDead; + private System.Windows.Forms.Label label20; + private System.Windows.Forms.Label label19; + private System.Windows.Forms.Label label22; + private System.Windows.Forms.Label label21; + private System.Windows.Forms.ComboBox cBR2OutputCurve; + private System.Windows.Forms.ComboBox cBL2OutputCurve; + private System.Windows.Forms.ComboBox cBSixaxisZOutputCurve; + private System.Windows.Forms.ComboBox cBSixaxisXOutputCurve; + private System.Windows.Forms.Label label24; + private System.Windows.Forms.Label label23; } } \ No newline at end of file diff --git a/DS4Windows/DS4Forms/Options.cs b/DS4Windows/DS4Forms/Options.cs index c770d06..c083b14 100644 --- a/DS4Windows/DS4Forms/Options.cs +++ b/DS4Windows/DS4Forms/Options.cs @@ -30,6 +30,9 @@ namespace DS4Windows private Dictionary hoverIndexDict = new Dictionary(); private Dictionary hoverImageDict = new Dictionary(); private Dictionary hoverLabelDict = new Dictionary(); + private int[] touchpadInvertToValue = new int[4] { 0, 2, 1, 3 }; + + int tempInt = 0; public Options(DS4Form rt) { @@ -338,6 +341,10 @@ namespace DS4Windows cBTap.Checked = TapSensitivity[device] > 0; cBDoubleTap.Checked = DoubleTap[device]; cBTouchpadJitterCompensation.Checked = TouchpadJitterCompensation[device]; + + tempInt = TouchpadInvert[device]; + touchpadInvertComboBox.SelectedIndex = touchpadInvertToValue[tempInt]; + cBlowerRCOn.Checked = LowerRCOn[device]; cBFlushHIDQueue.Checked = FlushHIDQueue[device]; enableTouchToggleCheckbox.Checked = getEnableTouchToggle(device); @@ -361,6 +368,10 @@ namespace DS4Windows btPollRateComboBox.SelectedIndex = getBTPollRate(device); lsOutCurveComboBox.SelectedIndex = getLsOutCurveMode(device); rsOutCurveComboBox.SelectedIndex = getRsOutCurveMode(device); + cBL2OutputCurve.SelectedIndex = getL2OutCurveMode(device); + cBR2OutputCurve.SelectedIndex = getR2OutCurveMode(device); + cBSixaxisXOutputCurve.SelectedIndex = getSXOutCurveMode(device); + cBSixaxisZOutputCurve.SelectedIndex = getSZOutCurveMode(device); try { @@ -490,6 +501,7 @@ namespace DS4Windows { nUDSX.Value = 0.25m; } + try { nUDSZ.Value = (decimal)SZDeadzone[device]; @@ -498,6 +510,43 @@ namespace DS4Windows { nUDSZ.Value = 0.25m; } + + try + { + nUDSixAxisXMaxZone.Value = (decimal)SXMaxzone[device]; + } + catch + { + nUDSixAxisXMaxZone.Value = 1.0m; + } + + try + { + nUDSixAxisZMaxZone.Value = (decimal)SZMaxzone[device]; + } + catch + { + nUDSixAxisZMaxZone.Value = 1.0m; + } + + try + { + nUDSixaxisXAntiDead.Value = (decimal)SXAntiDeadzone[device]; + } + catch + { + nUDSixaxisXAntiDead.Value = 0.0m; + } + + try + { + nUDSixaxisZAntiDead.Value = (decimal)SZAntiDeadzone[device]; + } + catch + { + nUDSixaxisZAntiDead.Value = 0.0m; + } + try { nUDL2S.Value = Math.Round((decimal)L2Sens[device], 2); @@ -567,27 +616,28 @@ namespace DS4Windows string[] satriggers = SATriggers[device].Split(','); List s = new List(); + int gyroTriggerCount = cMGyroTriggers.Items.Count; for (int i = 0, satrigLen = satriggers.Length; i < satrigLen; i++) { - int tr; + int tr = 0; if (int.TryParse(satriggers[i], out tr)) { - if (tr < cMGyroTriggers.Items.Count && tr > -1) + if (tr < gyroTriggerCount && tr > -1) { ((ToolStripMenuItem)cMGyroTriggers.Items[tr]).Checked = true; s.Add(cMGyroTriggers.Items[tr].Text); } else { - ((ToolStripMenuItem)cMGyroTriggers.Items[cMGyroTriggers.Items.Count - 1]).Checked = true; - s.Add(cMGyroTriggers.Items[cMGyroTriggers.Items.Count - 1].Text); + ((ToolStripMenuItem)cMGyroTriggers.Items[gyroTriggerCount - 1]).Checked = true; + s.Add(cMGyroTriggers.Items[gyroTriggerCount - 1].Text); break; } } else { - ((ToolStripMenuItem)cMGyroTriggers.Items[cMGyroTriggers.Items.Count - 1]).Checked = true; - s.Add(cMGyroTriggers.Items[cMGyroTriggers.Items.Count - 1].Text); + ((ToolStripMenuItem)cMGyroTriggers.Items[gyroTriggerCount - 1]).Checked = true; + s.Add(cMGyroTriggers.Items[gyroTriggerCount - 1].Text); break; } } @@ -595,21 +645,26 @@ namespace DS4Windows gyroTriggerBehavior.Checked = GyroTriggerTurns[device]; nUDGyroMouseVertScale.Value = GyroSensVerticalScale[device]; int invert = GyroInvert[device]; - cBGyroInvertX.Checked = invert == 2 || invert == 3; - cBGyroInvertY.Checked = invert == 1 || invert == 3; + cBGyroInvertX.Checked = (invert & 0x02) == 2; + cBGyroInvertY.Checked = (invert & 0x01) == 1; if (s.Count > 0) btnGyroTriggers.Text = string.Join(", ", s); cBGyroSmooth.Checked = nUDGyroSmoothWeight.Enabled = GyroSmoothing[device]; nUDGyroSmoothWeight.Value = (decimal)(GyroSmoothingWeight[device]); + cBGyroMouseXAxis.SelectedIndex = GyroMouseHorizontalAxis[device]; } else { cBFlashType.SelectedIndex = 0; cBWhileCharging.SelectedIndex = 0; - btPollRateComboBox.SelectedIndex = 0; + btPollRateComboBox.SelectedIndex = 4; lsOutCurveComboBox.SelectedIndex = 0; rsOutCurveComboBox.SelectedIndex = 0; + cBL2OutputCurve.SelectedIndex = 0; + cBR2OutputCurve.SelectedIndex = 0; + cBSixaxisXOutputCurve.SelectedIndex = 0; + cBSixaxisZOutputCurve.SelectedIndex = 0; rBTPMouse.Checked = true; rBSAControls.Checked = true; ToggleRainbow(false); @@ -643,6 +698,7 @@ namespace DS4Windows cBTap.Checked = false; cBDoubleTap.Checked = false; cBTouchpadJitterCompensation.Checked = true; + touchpadInvertComboBox.SelectedIndex = 0; cBlowerRCOn.Checked = false; cBFlushHIDQueue.Checked = false; enableTouchToggleCheckbox.Checked = true; @@ -667,6 +723,10 @@ namespace DS4Windows nUDRSRotation.Value = 0; nUDSX.Value = .25m; nUDSZ.Value = .25m; + nUDSixAxisXMaxZone.Value = 1.0m; + nUDSixAxisZMaxZone.Value = 1.0m; + nUDSixaxisXAntiDead.Value = 0.0m; + nUDSixaxisZAntiDead.Value = 0.0m; nUDL2S.Value = 1; nUDR2S.Value = 1; @@ -692,6 +752,7 @@ namespace DS4Windows cBGyroInvertY.Checked = false; cBGyroSmooth.Checked = false; nUDGyroSmoothWeight.Value = 0.5m; + cBGyroMouseXAxis.SelectedIndex = 0; Set(); } @@ -716,7 +777,7 @@ namespace DS4Windows case "Macro": lvi.SubItems.Add(Properties.Resources.Macro + (action.keyType.HasFlag(DS4KeyType.ScanCode) ? " (" + Properties.Resources.ScanCode + ")" : "")); break; case "Program": lvi.SubItems.Add(Properties.Resources.LaunchProgram.Replace("*program*", Path.GetFileNameWithoutExtension(action.details))); break; case "Profile": lvi.SubItems.Add(Properties.Resources.LoadProfile.Replace("*profile*", action.details)); break; - case "Key": lvi.SubItems.Add(((Keys)int.Parse(action.details)).ToString() + (action.uTrigger.Count > 0 ? " (Toggle)" : "")); break; + case "Key": lvi.SubItems.Add(((Keys)Convert.ToInt32(action.details)).ToString() + (action.uTrigger.Count > 0 ? " (Toggle)" : "")); break; case "DisconnectBT": lvi.SubItems.Add(Properties.Resources.DisconnectBT); break; @@ -754,18 +815,7 @@ namespace DS4Windows } } - /*public double Clamp(double min, double value, double max) - { - if (value > max) - return max; - else if (value < min) - return min; - else - return value; - } - */ - - void EnableReadings(bool on) + private void EnableReadings(bool on) { lbL2Track.Enabled = on; lbR2Track.Enabled = on; @@ -780,13 +830,14 @@ namespace DS4Windows btnSATrackS.Visible = on; } - void ControllerReadout_Tick(object sender, EventArgs e) + private void ControllerReadout_Tick(object sender, EventArgs e) { // MEMS gyro data is all calibrated to roughly -1G..1G for values -0x2000..0x1fff // Enough additional acceleration and we are no longer mostly measuring Earth's gravity... // We should try to indicate setpoints of the calibration when exposing this measurement.... int tempDeviceNum = (int)nUDSixaxis.Value - 1; DS4Device ds = Program.rootHub.DS4Controllers[tempDeviceNum]; + if (ds == null) { EnableReadings(false); @@ -797,15 +848,19 @@ namespace DS4Windows else { EnableReadings(true); - SetDynamicTrackBarValue(tBsixaxisGyroX, (Program.rootHub.ExposedState[tempDeviceNum].GyroX + tBsixaxisGyroX.Value * 2) / 3); - SetDynamicTrackBarValue(tBsixaxisGyroY, (Program.rootHub.ExposedState[tempDeviceNum].GyroY + tBsixaxisGyroY.Value * 2) / 3); - SetDynamicTrackBarValue(tBsixaxisGyroZ, (Program.rootHub.ExposedState[tempDeviceNum].GyroZ + tBsixaxisGyroZ.Value * 2) / 3); - SetDynamicTrackBarValue(tBsixaxisAccelX, (int)(Program.rootHub.ExposedState[tempDeviceNum].AccelX + tBsixaxisAccelX.Value * 2) / 3); - SetDynamicTrackBarValue(tBsixaxisAccelY, (int)(Program.rootHub.ExposedState[tempDeviceNum].AccelY + tBsixaxisAccelY.Value * 2) / 3); - SetDynamicTrackBarValue(tBsixaxisAccelZ, (int)(Program.rootHub.ExposedState[tempDeviceNum].AccelZ + tBsixaxisAccelZ.Value * 2) / 3); - int x = Program.rootHub.getDS4State(tempDeviceNum).LX; - int y = Program.rootHub.getDS4State(tempDeviceNum).LY; + DS4StateExposed exposeState = Program.rootHub.ExposedState[tempDeviceNum]; + DS4State baseState = Program.rootHub.getDS4State(tempDeviceNum); + + SetDynamicTrackBarValue(tBsixaxisGyroX, (exposeState.getGyroYaw() + tBsixaxisGyroX.Value * 2) / 3); + SetDynamicTrackBarValue(tBsixaxisGyroY, (exposeState.getGyroPitch() + tBsixaxisGyroY.Value * 2) / 3); + SetDynamicTrackBarValue(tBsixaxisGyroZ, (exposeState.getGyroRoll() + tBsixaxisGyroZ.Value * 2) / 3); + SetDynamicTrackBarValue(tBsixaxisAccelX, (exposeState.getAccelX() + tBsixaxisAccelX.Value * 2) / 3); + SetDynamicTrackBarValue(tBsixaxisAccelY, (exposeState.getAccelY() + tBsixaxisAccelY.Value * 2) / 3); + SetDynamicTrackBarValue(tBsixaxisAccelZ, (exposeState.getAccelZ() + tBsixaxisAccelZ.Value * 2) / 3); + + int x = baseState.LX; + int y = baseState.LY; double tempLSS = (double)nUDLSS.Value; btnLSTrackS.Visible = tempLSS != 1; @@ -849,8 +904,8 @@ namespace DS4Windows (int)(tempLSS * (btnLSTrack.Location.Y - pnlLSTrack.Size.Height / 2f) + pnlLSTrack.Size.Height / 2f)); } - x = Program.rootHub.getDS4State(tempDeviceNum).RX; - y = Program.rootHub.getDS4State(tempDeviceNum).RY; + x = baseState.RX; + y = baseState.RY; double tempRSS = (double)nUDRSS.Value; btnRSTrackS.Visible = tempRSS != 1; @@ -894,8 +949,8 @@ namespace DS4Windows (int)(tempRSS * (btnRSTrack.Location.Y - pnlRSTrack.Size.Height / 2f) + pnlRSTrack.Size.Height / 2f)); } - x = -Program.rootHub.ExposedState[tempDeviceNum].GyroX + 127; - y = Program.rootHub.ExposedState[tempDeviceNum].GyroZ + 127; + x = exposeState.getAccelX() + 127; + y = exposeState.getAccelZ() + 127; btnSATrack.Location = new Point((int)(dpix * Global.Clamp(0, x / 2.09, pnlSATrack.Size.Width)), (int)(dpiy * Global.Clamp(0, y / 2.09, pnlSATrack.Size.Height))); double tempSXS = (double)nUDSXS.Value; @@ -909,7 +964,7 @@ namespace DS4Windows double tempL2 = (double)nUDL2.Value; double tempL2S = (double)nUDL2S.Value; - tBL2.Value = Program.rootHub.getDS4State(tempDeviceNum).L2; + tBL2.Value = baseState.L2; lbL2Track.Location = new Point(tBL2.Location.X - (int)(dpix * 25), Math.Max((int)(((tBL2.Location.Y + tBL2.Size.Height) - (tBL2.Value * tempL2S) / (tBL2.Size.Height * .0209f / Math.Pow(dpix, 2))) - dpix * 20), (int)(1 * ((tBL2.Location.Y + tBL2.Size.Height) - 255 / (tBL2.Size.Height * .0209f / Math.Pow(dpix, 2))) - dpix * 20))); @@ -923,7 +978,7 @@ namespace DS4Windows double tempR2 = (double)nUDR2.Value; double tempR2S = (double)nUDR2S.Value; - tBR2.Value = Program.rootHub.getDS4State(tempDeviceNum).R2; + tBR2.Value = baseState.R2; lbR2Track.Location = new Point(tBR2.Location.X + (int)(dpix * 25), Math.Max((int)(1 * ((tBR2.Location.Y + tBR2.Size.Height) - (tBR2.Value * tempR2S) / (tBR2.Size.Height * .0209f / Math.Pow(dpix, 2))) - dpix * 20), (int)(1 * ((tBR2.Location.Y + tBR2.Size.Height) - 255 / (tBR2.Size.Height * .0209f / Math.Pow(dpix, 2))) - dpix * 20))); @@ -943,7 +998,7 @@ namespace DS4Windows lbInputDelay.BackColor = Color.Red; lbInputDelay.ForeColor = Color.White; } - else if (latency > (warnInterval / 2)) + else if (latency > (warnInterval * 0.5)) { lbInputDelay.BackColor = Color.Yellow; lbInputDelay.ForeColor = Color.Black; @@ -1301,6 +1356,10 @@ namespace DS4Windows BTPollRate[device] = btPollRateComboBox.SelectedIndex; lsOutCurveMode[device] = lsOutCurveComboBox.SelectedIndex; rsOutCurveMode[device] = rsOutCurveComboBox.SelectedIndex; + l2OutCurveMode[device] = cBL2OutputCurve.SelectedIndex; + r2OutCurveMode[device] = cBR2OutputCurve.SelectedIndex; + sxOutCurveMode[device] = cBSixaxisXOutputCurve.SelectedIndex; + szOutCurveMode[device] = cBSixaxisZOutputCurve.SelectedIndex; L2Deadzone[device] = (byte)Math.Round((nUDL2.Value * 255), 0); R2Deadzone[device] = (byte)Math.Round((nUDR2.Value * 255), 0); L2AntiDeadzone[device] = (int)(nUDL2AntiDead.Value * 100); @@ -1312,6 +1371,10 @@ namespace DS4Windows ScrollSensitivity[device] = (int)nUDScroll.Value; DoubleTap[device] = cBDoubleTap.Checked; TapSensitivity[device] = (byte)nUDTap.Value; + + tempInt = touchpadInvertComboBox.SelectedIndex; + TouchpadInvert[device] = touchpadInvertToValue[tempInt]; + IdleDisconnectTimeout[device] = (int)(nUDIdleDisconnect.Value * 60); Rainbow[device] = (int)nUDRainbow.Value; RSDeadzone[device] = (int)Math.Round((nUDRS.Value * 127), 0); @@ -1326,6 +1389,10 @@ namespace DS4Windows FlashAt[device] = (int)nUDflashLED.Value; SXDeadzone[device] = (double)nUDSX.Value; SZDeadzone[device] = (double)nUDSZ.Value; + SXMaxzone[device] = (double)nUDSixAxisXMaxZone.Value; + SZMaxzone[device] = (double)nUDSixAxisZMaxZone.Value; + SXAntiDeadzone[device] = (double)nUDSixaxisXAntiDead.Value; + SZAntiDeadzone[device] = (double)nUDSixaxisZAntiDead.Value; MouseAccel[device] = cBMouseAccel.Checked; DinputOnly[device] = cBDinput.Checked; StartTouchpadOff[device] = cbStartTouchpadOff.Checked; @@ -1355,6 +1422,7 @@ namespace DS4Windows GyroSensVerticalScale[device] = (int)nUDGyroMouseVertScale.Value; GyroSmoothing[device] = cBGyroSmooth.Checked; GyroSmoothingWeight[device] = (double)nUDGyroSmoothWeight.Value; + GyroMouseHorizontalAxis[device] = cBGyroMouseXAxis.SelectedIndex; int invert = 0; if (cBGyroInvertX.Checked) @@ -2893,6 +2961,87 @@ namespace DS4Windows } } + private void touchpadInvertComboBox_SelectedIndexChanged(object sender, EventArgs e) + { + if (!loading) + { + tempInt = touchpadInvertToValue[touchpadInvertComboBox.SelectedIndex]; + TouchpadInvert[device] = tempInt; + } + } + + private void cBGyroMouseXAxis_SelectedIndexChanged(object sender, EventArgs e) + { + if (!loading) + { + GyroMouseHorizontalAxis[device] = cBGyroMouseXAxis.SelectedIndex; + } + } + + private void nUDSixAxisXMaxZone_ValueChanged(object sender, EventArgs e) + { + if (!loading) + { + SXMaxzone[device] = (double)nUDSixAxisXMaxZone.Value; + } + } + + private void nUDSixAxisZMaxZone_ValueChanged(object sender, EventArgs e) + { + if (!loading) + { + SZMaxzone[device] = (double)nUDSixAxisZMaxZone.Value; + } + } + + private void nUDSixaxisXAntiDead_ValueChanged(object sender, EventArgs e) + { + if (loading == false) + { + SXAntiDeadzone[device] = (double)nUDSixaxisXAntiDead.Value; + } + } + + private void nUDSixaxisZAntiDead_ValueChanged(object sender, EventArgs e) + { + if (loading == false) + { + SZAntiDeadzone[device] = (double)nUDSixaxisZAntiDead.Value; + } + } + + private void cBL2OutputCurve_SelectedIndexChanged(object sender, EventArgs e) + { + if (loading == false) + { + l2OutCurveMode[device] = cBL2OutputCurve.SelectedIndex; + } + } + + private void cBR2OutputCurve_SelectedIndexChanged(object sender, EventArgs e) + { + if (loading == false) + { + r2OutCurveMode[device] = cBR2OutputCurve.SelectedIndex; + } + } + + private void cBSixaxisXOutputCurve_SelectedIndexChanged(object sender, EventArgs e) + { + if (loading == false) + { + sxOutCurveMode[device] = cBSixaxisXOutputCurve.SelectedIndex; + } + } + + private void cBSixaxisZOutputCurve_SelectedIndexChanged(object sender, EventArgs e) + { + if (loading == false) + { + szOutCurveMode[device] = cBSixaxisZOutputCurve.SelectedIndex; + } + } + private void Options_Resize(object sender, EventArgs e) { fLPSettings.AutoScroll = false; diff --git a/DS4Windows/DS4Forms/Options.resx b/DS4Windows/DS4Forms/Options.resx index 8cddb5c..7aa233b 100644 --- a/DS4Windows/DS4Forms/Options.resx +++ b/DS4Windows/DS4Forms/Options.resx @@ -430,7 +430,7 @@ pnlTPMouse - 1 + 3 True @@ -463,7 +463,7 @@ pnlTPMouse - 6 + 8 63, 39 @@ -484,7 +484,7 @@ pnlTPMouse - 4 + 6 True @@ -517,7 +517,7 @@ pnlTPMouse - 2 + 4 True @@ -550,7 +550,7 @@ pnlTPMouse - 7 + 9 167, 9 @@ -571,7 +571,7 @@ pnlTPMouse - 0 + 2 63, 9 @@ -592,7 +592,7 @@ pnlTPMouse - 8 + 10 True @@ -658,7 +658,7 @@ pnlTPMouse - 5 + 7 True @@ -691,7 +691,7 @@ pnlTPMouse - 3 + 5 True @@ -1335,113 +1335,68 @@ 1 - + + True + + + NoControl + + + 141, 66 + + + 37, 13 + + + 235 + + + Invert: + + + label15 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + pnlTPMouse - - System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - gBTouchpad - - + 0 - - rBTPControls + + None - - System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + X Axis - - gBTouchpad + + Y Axis - - 1 + + Both X and Y Axes - - rBTPMouse + + 144, 82 - - System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 121, 21 - - gBTouchpad + + 234 - - 2 + + touchpadInvertComboBox - - fLPTouchSwipe + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - System.Windows.Forms.FlowLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - gBTouchpad - - - 3 - - - 2, 259 - - - 270, 182 - - - 246 - - - Touchpad - - - gBTouchpad - - - System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tPControls - - - 1 - - - cbStartTouchpadOff - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - + pnlTPMouse - - 9 - - - -3, 50 - - - 2, 2, 2, 2 - - - 267, 128 - - - 257 - - - pnlTPMouse - - - System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - gBTouchpad - - - 0 + + 1 True @@ -1471,7 +1426,31 @@ pnlTPMouse - 9 + 11 + + + -3, 39 + + + 2, 2, 2, 2 + + + 267, 129 + + + 257 + + + pnlTPMouse + + + System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gBTouchpad + + + 0 True @@ -1539,126 +1518,156 @@ 2 - - bnSwipeUp - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - fLPTouchSwipe - - - 0 - - - lbSwipeUp - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - fLPTouchSwipe - - - 1 - - - bnSwipeDown - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - fLPTouchSwipe - - - 2 - - - lbSwipeDown - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - fLPTouchSwipe - - - 3 - - - bnSwipeLeft - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - fLPTouchSwipe - - - 4 - - - lbSwipeLeft - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - fLPTouchSwipe - - - 5 - - - bnSwipeRight - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - fLPTouchSwipe - - - 6 - - - lbSwipeRight - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - fLPTouchSwipe - - - 7 - - - 4, 55 - - - 260, 121 - - - 256 - - - fLPTouchSwipe - - - System.Windows.Forms.FlowLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - gBTouchpad - - - 3 - 326, 13 + + False + + + 117, 22 + + + Control + + + 114, 6 + + + 117, 22 + + + Default + + + 127, 22 + + + Inverted + + + 127, 22 + + + Inverted X + + + 127, 22 + + + Inverted Y + + + 117, 22 + + + Dpad + + + 127, 22 + + + Inverted + + + 127, 22 + + + Inverted X + + + 127, 22 + + + Inverted Y + + + 117, 22 + + + Left Stick + + + 127, 22 + + + Inverted + + + 127, 22 + + + Inverted X + + + 127, 22 + + + Inverted Y + + + 117, 22 + + + Right Stick + + + 117, 22 + + + Face Buttons + + + 147, 22 + + + w/ Scan Code + + + False + + + 117, 22 + + + WASD + + + 147, 22 + + + w/ Scan Code + + + 117, 22 + + + Arrow Keys + + + 127, 22 + + + Inverted + + + 127, 22 + + + Inverted X + + + 127, 22 + + + Inverted Y + + + 117, 22 + + + Mouse + 118, 208 @@ -1698,153 +1707,6 @@ 0 - - False - - - 117, 22 - - - Control - - - 114, 6 - - - 117, 22 - - - Default - - - 117, 22 - - - Dpad - - - 127, 22 - - - Inverted - - - 127, 22 - - - Inverted X - - - 127, 22 - - - Inverted Y - - - 117, 22 - - - Left Stick - - - 127, 22 - - - Inverted - - - 127, 22 - - - Inverted X - - - 127, 22 - - - Inverted Y - - - 117, 22 - - - Right Stick - - - 127, 22 - - - Inverted - - - 127, 22 - - - Inverted X - - - 127, 22 - - - Inverted Y - - - 117, 22 - - - Face Buttons - - - False - - - 117, 22 - - - WASD - - - 147, 22 - - - w/ Scan Code - - - 117, 22 - - - Arrow Keys - - - 147, 22 - - - w/ Scan Code - - - 117, 22 - - - Mouse - - - 127, 22 - - - Inverted - - - 127, 22 - - - Inverted X - - - 127, 22 - - - Inverted Y - NoControl @@ -2067,173 +1929,50 @@ 7 - - btPollRateLabel + + 4, 55 - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 260, 121 - - gBOther + + 256 - - 0 + + fLPTouchSwipe - - btPollRateComboBox + + System.Windows.Forms.FlowLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + gBTouchpad - - gBOther - - - 1 - - - enableTouchToggleCheckbox - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - gBOther - - - 2 - - - cBDinput - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - gBOther - - + 3 - - pBProgram + + 2, 259 - - System.Windows.Forms.PictureBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 270, 182 - - gBOther + + 246 - - 4 + + Touchpad - - cBLaunchProgram + + gBTouchpad - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - gBOther - - - 5 - - - btnBrowse - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - gBOther - - - 6 - - - lbUseController - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - gBOther - - - 7 - - - cBMouseAccel - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - gBOther - - - 8 - - - nUDSixaxis - - - System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - gBOther - - - 9 - - - cBControllerInput - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - gBOther - - - 10 - - - cBIdleDisconnect - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - gBOther - - - 12 - - - 281, 221 - - - 272, 256 - - - 247 - - - Other - - - gBOther - - + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - fLPSettings + + tPControls - - 5 + + 1 True @@ -2647,149 +2386,29 @@ with profile 12 - - btnRainbow + + 281, 221 - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 272, 256 - - gBLightbar - - - 0 - - - lbRainbowB - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - gBLightbar - - - 1 - - - nUDRainbowB - - - System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - gBLightbar - - - 2 - - - cBFlashType - - - System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - gBLightbar - - - 3 - - - cBWhileCharging - - - System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - gBLightbar - - - 4 - - - btnFlashColor - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - gBLightbar - - - 5 - - - btnChargingColor - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - gBLightbar - - - 6 - - - lbWhileCharging - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - gBLightbar - - - 7 - - - lbPercentFlashBar - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - gBLightbar - - - 8 - - - nUDflashLED - - - System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - gBLightbar - - - 9 - - - 3, 3 - - - 272, 244 - - + 247 - - Lightbar + + Other - - gBLightbar + + gBOther - + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + fLPSettings - - 0 + + 5 NoControl @@ -3076,53 +2695,29 @@ with profile 9 - - lbPercentRumble + + 3, 3 - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 272, 244 - - gBRumble - - - 0 - - - btnRumbleLightTest - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - gBRumble - - - 1 - - - 281, 3 - - - 272, 46 - - + 247 - - Rumble + + Lightbar - - gBRumble + + gBLightbar - + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + fLPSettings - - 2 + + 0 True @@ -3181,6 +2776,30 @@ with profile 1 + + 281, 3 + + + 272, 46 + + + 247 + + + Rumble + + + gBRumble + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + fLPSettings + + + 2 + True @@ -3289,225 +2908,6 @@ with profile 153, 17 - - pnlSATrack - - - System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - lbL2TrackS - - - 0 - - - lbL2Track - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - lbL2TrackS - - - 1 - - - lbRSTip - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - lbL2TrackS - - - 2 - - - lbInputDelay - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - lbL2TrackS - - - 3 - - - lbR2Track - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - lbL2TrackS - - - 4 - - - lbLSTip - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - lbL2TrackS - - - 5 - - - lbSATip - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - lbL2TrackS - - - 6 - - - tBR2 - - - System.Windows.Forms.TrackBar, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - lbL2TrackS - - - 7 - - - tBL2 - - - System.Windows.Forms.TrackBar, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - lbL2TrackS - - - 8 - - - pnlSixaxis - - - System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - lbL2TrackS - - - 9 - - - pnlLSTrack - - - System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - lbL2TrackS - - - 10 - - - pnlRSTrack - - - System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - lbL2TrackS - - - 11 - - - 4, 22 - - - 3, 3, 3, 3 - - - 438, 455 - - - 2 - - - Controller Readings - - - lbL2TrackS - - - System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tCControls - - - 2 - - - btnSATrack - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - pnlSATrack - - - 0 - - - btnSATrackS - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - pnlSATrack - - - 1 - - - 300, 88 - - - 2, 2, 2, 2 - - - 125, 125 - - - 252 - - - pnlSATrack - - - System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - lbL2TrackS - - - 0 - False @@ -3571,6 +2971,30 @@ with profile 1 + + 300, 88 + + + 2, 2, 2, 2 + + + 125, 125 + + + 252 + + + pnlSATrack + + + System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + lbL2TrackS + + + 0 + True @@ -3835,123 +3259,6 @@ with profile 8 - - tBsixaxisAccelX - - - System.Windows.Forms.TrackBar, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - pnlSixaxis - - - 0 - - - lb6Accel - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - pnlSixaxis - - - 1 - - - tBsixaxisGyroX - - - System.Windows.Forms.TrackBar, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - pnlSixaxis - - - 2 - - - lb6Gryo - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - pnlSixaxis - - - 3 - - - tBsixaxisGyroY - - - System.Windows.Forms.TrackBar, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - pnlSixaxis - - - 4 - - - tBsixaxisGyroZ - - - System.Windows.Forms.TrackBar, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - pnlSixaxis - - - 5 - - - tBsixaxisAccelY - - - System.Windows.Forms.TrackBar, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - pnlSixaxis - - - 6 - - - tBsixaxisAccelZ - - - System.Windows.Forms.TrackBar, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - pnlSixaxis - - - 7 - - - 300, 233 - - - 125, 125 - - - 236 - - - pnlSixaxis - - - System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - lbL2TrackS - - - 9 - False @@ -4174,53 +3481,26 @@ with profile 7 - - btnLSTrack + + 300, 233 - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - pnlLSTrack - - - 0 - - - btnLSTrackS - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - pnlLSTrack - - - 1 - - - 5, 88 - - - 2, 2, 2, 2 - - + 125, 125 - - 250 + + 236 - - pnlLSTrack + + pnlSixaxis - + System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + lbL2TrackS - - 10 + + 9 False @@ -4285,53 +3565,29 @@ with profile 1 - - btnRSTrackS + + 5, 88 - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - pnlRSTrack - - - 0 - - - btnRSTrack - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - pnlRSTrack - - - 1 - - - 151, 88 - - + 2, 2, 2, 2 - + 125, 125 - - 251 + + 250 - - pnlRSTrack + + pnlLSTrack - + System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + lbL2TrackS - - 11 + + 10 False @@ -4396,122 +3652,56 @@ with profile 1 - - bnGyroZN + + 151, 88 - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 2, 2, 2, 2 - - fLPTiltControls + + 125, 125 - - 0 + + 251 - - lbGyroZN + + pnlRSTrack - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - fLPTiltControls + + lbL2TrackS - - 1 + + 11 - - bnGyroZP + + 4, 22 - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 3, 3, 3, 3 - - fLPTiltControls + + 438, 455 - + 2 - - lbGyroZP + + Controller Readings - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + lbL2TrackS - - fLPTiltControls + + System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 3 + + tCControls - - bnGyroXP - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - fLPTiltControls - - - 4 - - - lbGyroXP - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - fLPTiltControls - - - 5 - - - bnGyroXN - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - fLPTiltControls - - - 6 - - - lbGyroXN - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - fLPTiltControls - - - 7 - - - 6, 51 - - - 271, 167 - - - 254 - - - fLPTiltControls - - - System.Windows.Forms.FlowLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - gBGyro - - - 3 + + 2 NoControl @@ -4729,120 +3919,30 @@ with profile 7 - - tPControls + + 6, 51 - - System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 271, 167 - - tCControls + + 254 - - 0 + + fLPTiltControls - - tPSpecial + + System.Windows.Forms.FlowLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + gBGyro - - tCControls - - - 1 - - - Left - - - 0, 0 - - - 446, 481 - - - 253 - - - tCControls - - - System.Windows.Forms.TabControl, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - + 3 True - - lBControls - - - System.Windows.Forms.ListBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tPControls - - - 0 - - - lbControlTip - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tPControls - - - 2 - - - pnlController - - - System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tPControls - - - 3 - - - 4, 22 - - - 3, 3, 3, 3 - - - 438, 455 - - - 0 - - - Controls - - - tPControls - - - System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tCControls - - - 0 - Top, Bottom, Left @@ -5002,654 +4102,6 @@ with profile Zoom - - pBHoveredButton - - - System.Windows.Forms.PictureBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - pnlController - - - 0 - - - lbLRS - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - pnlController - - - 1 - - - lbLLS - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - pnlController - - - 2 - - - bnRSDown - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - pnlController - - - 3 - - - lbLTouchUpper - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - pnlController - - - 4 - - - lbLTouchRight - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - pnlController - - - 5 - - - bnL3 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - pnlController - - - 6 - - - lbLTouchLM - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - pnlController - - - 7 - - - bnRSUp - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - pnlController - - - 8 - - - lbLR2 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - pnlController - - - 9 - - - bnRSRight - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - pnlController - - - 10 - - - lbLL2 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - pnlController - - - 11 - - - bnR3 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - pnlController - - - 12 - - - lbLR1 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - pnlController - - - 13 - - - bnRSLeft - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - pnlController - - - 14 - - - lbLL1 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - pnlController - - - 15 - - - bnLSLeft - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - pnlController - - - 16 - - - lbLPS - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - pnlController - - - 17 - - - bnLSUp - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - pnlController - - - 18 - - - lbLLeft - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - pnlController - - - 19 - - - bnLSRight - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - pnlController - - - 20 - - - lbLright - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - pnlController - - - 21 - - - bnLSDown - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - pnlController - - - 22 - - - lbLDown - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - pnlController - - - 23 - - - bnR2 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - pnlController - - - 24 - - - bnUp - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - pnlController - - - 25 - - - bnDown - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - pnlController - - - 26 - - - bnTriangle - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - pnlController - - - 27 - - - bnR1 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - pnlController - - - 28 - - - bnSquare - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - pnlController - - - 29 - - - bnRight - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - pnlController - - - 30 - - - lbLUp - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - pnlController - - - 31 - - - bnLeft - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - pnlController - - - 32 - - - lbLShare - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - pnlController - - - 33 - - - bnOptions - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - pnlController - - - 34 - - - bnShare - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - pnlController - - - 35 - - - lbLOptions - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - pnlController - - - 36 - - - bnL1 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - pnlController - - - 37 - - - bnTouchRight - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - pnlController - - - 38 - - - bnL2 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - pnlController - - - 39 - - - lbLTriangle - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - pnlController - - - 40 - - - bnTouchLeft - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - pnlController - - - 41 - - - lbLSquare - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - pnlController - - - 42 - - - bnTouchMulti - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - pnlController - - - 43 - - - lbLCircle - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - pnlController - - - 44 - - - lbLCross - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - pnlController - - - 45 - - - bnTouchUpper - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - pnlController - - - 46 - - - btnLightbar - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - pnlController - - - 47 - - - bnPS - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - pnlController - - - 48 - - - bnCross - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - pnlController - - - 49 - - - bnCircle - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - pnlController - - - 50 - - - lbControlName - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - pnlController - - - 51 - - - 2, 2 - - - 2, 2, 2, 2 - - - 422, 230 - - - 282 - - - pnlController - - - System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tPControls - - - 3 - False @@ -7300,90 +5752,75 @@ with profile 51 - - pnlActions + + 2, 2 - + + 2, 2, 2, 2 + + + 422, 230 + + + 282 + + + pnlController + + System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - tPSpecial + + tPControls - - 0 - - - 4, 22 - - - 438, 455 - - + 3 - - Special Actions + + 4, 22 - - tPSpecial + + 3, 3, 3, 3 - - System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tCControls - - - 1 - - - lVActions - - - System.Windows.Forms.ListView, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - pnlActions - - - 0 - - - panel2 - - - System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - pnlActions - - - 1 - - - Fill - - - 0, 0 - - + 438, 455 - - 15 - - - pnlActions - - - System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tPSpecial - - + 0 + + Controls + + + tPControls + + + System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tCControls + + + 0 + + + Name + + + 140 + + + Trigger + + + 105 + + + Action + + + 100 + Fill @@ -7408,135 +5845,6 @@ with profile 0 - - Name - - - 140 - - - Trigger - - - 105 - - - Action - - - 100 - - - fLPActionButtons - - - System.Windows.Forms.FlowLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - panel2 - - - 0 - - - lbActionsTip - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - panel2 - - - 1 - - - Top - - - 0, 0 - - - 2, 2, 2, 2 - - - 438, 66 - - - 16 - - - panel2 - - - System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - pnlActions - - - 1 - - - btnNewAction - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - fLPActionButtons - - - 0 - - - btnEditAction - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - fLPActionButtons - - - 1 - - - btnRemAction - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - fLPActionButtons - - - 2 - - - Fill - - - 0, 28 - - - 438, 38 - - - 15 - - - fLPActionButtons - - - System.Windows.Forms.FlowLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - panel2 - - - 0 - NoControl @@ -7618,6 +5926,30 @@ with profile 2 + + Fill + + + 0, 28 + + + 438, 38 + + + 15 + + + fLPActionButtons + + + System.Windows.Forms.FlowLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel2 + + + 0 + Top @@ -7651,6 +5983,105 @@ with profile 1 + + Top + + + 0, 0 + + + 2, 2, 2, 2 + + + 438, 66 + + + 16 + + + panel2 + + + System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlActions + + + 1 + + + Fill + + + 0, 0 + + + 438, 455 + + + 15 + + + pnlActions + + + System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tPSpecial + + + 0 + + + 4, 22 + + + 438, 455 + + + 3 + + + Special Actions + + + tPSpecial + + + System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tCControls + + + 1 + + + Left + + + 0, 0 + + + 446, 481 + + + 253 + + + tCControls + + + System.Windows.Forms.TabControl, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 3 + 4, 22 @@ -7678,572 +6109,113 @@ with profile 0 - - nUDR2AntiDead + + 214, 29 - + + 47, 20 + + + 11 + + + nUDSixaxisZAntiDead + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + antiDeadzoneTabPage - + 0 - - label3 + + 215, 4 - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 46, 20 - + + 10 + + + nUDSixaxisXAntiDead + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + antiDeadzoneTabPage - + 1 - - nUDL2AntiDead - - - System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - antiDeadzoneTabPage - - - 2 - - - label4 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - antiDeadzoneTabPage - - - 3 - - - nUDRSAntiDead - - - System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - antiDeadzoneTabPage - - - 4 - - - label2 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - antiDeadzoneTabPage - - - 5 - - - nUDLSAntiDead - - - System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - antiDeadzoneTabPage - - - 6 - - - label1 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - antiDeadzoneTabPage - - - 7 - - - 4, 22 - - - 3, 3, 3, 3 - - - 264, 52 - - - 2 - - - Anti-Deadzone - - - antiDeadzoneTabPage - - - System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tCSens - - - 1 - - - nUDR2Maxzone - - - System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - maxZoneTabPage - - - 0 - - - nUDL2Maxzone - - - System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - maxZoneTabPage - - - 1 - - - label8 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - maxZoneTabPage - - - 2 - - - label7 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - maxZoneTabPage - - - 3 - - - nUDRSMaxZone - - - System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - maxZoneTabPage - - - 4 - - - label6 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - maxZoneTabPage - - - 5 - - - nUDLSMaxZone - - - System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - maxZoneTabPage - - - 6 - - - label5 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - maxZoneTabPage - - - 7 - - - 4, 22 - - - 3, 3, 3, 3 - - - 264, 52 - - - 3 - - - Max Zone - - - maxZoneTabPage - - - System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tCSens - - - 2 - - - nUDLSCurve - - - System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tPCurve - - - 0 - - - nUDRSCurve - - - System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tPCurve - - - 1 - - - lbRSCurve - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tPCurve - - - 2 - - - lbRSCurvePercent - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tPCurve - - - 3 - - - lbLSCurvePercent - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tPCurve - - - 4 - - - lbLSCurve - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tPCurve - - - 5 - - - 4, 22 - - - 3, 3, 3, 3 - - - 264, 52 - - - 1 - - - Curve (Input) - - - tPCurve - - - System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tCSens - - - 3 - - - rsOutCurveComboBox - - - System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tPOutCurve - - - 0 - - - lsOutCurveComboBox - - - System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tPOutCurve - - - 1 - - - label10 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tPOutCurve - - - 2 - - - label9 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tPOutCurve - - - 3 - - - 4, 22 - - - 264, 52 - - - 4 - - - Output Curve - - - tPOutCurve - - - System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tCSens - - - 4 - - - 160, 21 - - - 74, 20 - - - 219 - - - nUDRSRotation - - - System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tpRotation - - - 0 - - + True - - 125, 23 + + NoControl - - 25, 13 + + 160, 31 - - 218 + + 52, 13 - - RS: + + 9 - - label14 + + Sixaxis Z: - + + label20 + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - tpRotation + + antiDeadzoneTabPage - - 1 - - - 42, 20 - - - 68, 20 - - - 217 - - - nUDLSRotation - - - System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tpRotation - - + 2 - + True - - 4, 22 + + NoControl - - 23, 13 + + 160, 6 - - 216 + + 52, 13 - - LS: + + 8 - - label13 + + Sixaxis X: - + + label19 + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - tpRotation + + antiDeadzoneTabPage - - 3 - - - 4, 22 - - - 3, 3, 3, 3 - - - 264, 52 - - - 5 - - - Rotation - - - tpRotation - - - System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tCSens - - - 5 - - - 281, 55 - - - 272, 78 - - - 234 - - - tCSens - - - System.Windows.Forms.TabControl, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - fLPSettings - - + 3 - 158, 30 + 107, 29 - 68, 20 + 44, 20 7 @@ -8258,7 +6230,7 @@ with profile antiDeadzoneTabPage - 0 + 4 True @@ -8267,7 +6239,7 @@ with profile NoControl - 117, 32 + 83, 31 24, 13 @@ -8288,13 +6260,13 @@ with profile antiDeadzoneTabPage - 1 + 5 - 51, 29 + 31, 29 - 50, 20 + 42, 20 5 @@ -8309,7 +6281,7 @@ with profile antiDeadzoneTabPage - 2 + 6 True @@ -8339,13 +6311,13 @@ with profile antiDeadzoneTabPage - 3 + 7 - 157, 4 + 108, 3 - 68, 20 + 43, 20 3 @@ -8360,7 +6332,7 @@ with profile antiDeadzoneTabPage - 4 + 8 True @@ -8369,7 +6341,7 @@ with profile NoControl - 116, 6 + 82, 6 25, 13 @@ -8390,13 +6362,13 @@ with profile antiDeadzoneTabPage - 5 + 9 - 50, 3 + 31, 3 - 50, 20 + 42, 20 1 @@ -8411,7 +6383,7 @@ with profile antiDeadzoneTabPage - 6 + 10 True @@ -8441,13 +6413,142 @@ with profile antiDeadzoneTabPage - 7 + 11 + + + 4, 22 + + + 3, 3, 3, 3 + + + 264, 52 + + + 2 + + + Anti-Deadzone + + + antiDeadzoneTabPage + + + System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tCSens + + + 1 + + + 220, 29 + + + 40, 20 + + + 11 + + + nUDSixAxisZMaxZone + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + maxZoneTabPage + + + 0 + + + 220, 3 + + + 41, 20 + + + 10 + + + nUDSixAxisXMaxZone + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + maxZoneTabPage + + + 1 + + + True + + + NoControl + + + 162, 31 + + + 52, 13 + + + 9 + + + Sixaxis Z: + + + label18 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + maxZoneTabPage + + + 2 + + + True + + + NoControl + + + 162, 6 + + + 52, 13 + + + 8 + + + Sixaxis X: + + + label17 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + maxZoneTabPage + + + 3 - 161, 29 + 114, 29 - 50, 20 + 40, 20 7 @@ -8462,13 +6563,13 @@ with profile maxZoneTabPage - 0 + 4 - 42, 29 + 36, 29 - 51, 20 + 41, 20 6 @@ -8483,7 +6584,7 @@ with profile maxZoneTabPage - 1 + 5 True @@ -8492,7 +6593,7 @@ with profile NoControl - 129, 31 + 85, 31 24, 13 @@ -8513,7 +6614,7 @@ with profile maxZoneTabPage - 2 + 6 True @@ -8543,13 +6644,13 @@ with profile maxZoneTabPage - 3 + 7 - 160, 3 + 114, 4 - 51, 20 + 40, 20 3 @@ -8564,7 +6665,7 @@ with profile maxZoneTabPage - 4 + 8 True @@ -8573,7 +6674,7 @@ with profile NoControl - 129, 5 + 85, 5 25, 13 @@ -8594,13 +6695,13 @@ with profile maxZoneTabPage - 5 + 9 - 42, 3 + 37, 3 - 51, 20 + 40, 20 1 @@ -8615,7 +6716,7 @@ with profile maxZoneTabPage - 6 + 10 True @@ -8645,8 +6746,425 @@ with profile maxZoneTabPage + 11 + + + 4, 22 + + + 3, 3, 3, 3 + + + 264, 52 + + + 3 + + + Max Zone + + + maxZoneTabPage + + + System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tCSens + + + 2 + + + Linear + + + Quadratic + + + Cubic + + + 221, 28 + + + 40, 21 + + + 11 + + + cBSixaxisZOutputCurve + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tPOutCurve + + + 0 + + + Linear + + + Quadratic + + + Cubic + + + 221, 1 + + + 40, 21 + + + 10 + + + cBSixaxisXOutputCurve + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tPOutCurve + + + 1 + + + True + + + NoControl + + + 168, 31 + + + 52, 13 + + + 9 + + + Sixaxis Z: + + + label24 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tPOutCurve + + + 2 + + + True + + + NoControl + + + 168, 4 + + + 52, 13 + + + 8 + + + Sixaxis X: + + + label23 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tPOutCurve + + + 3 + + + Linear + + + Quadratic + + + Cubic + + + 111, 28 + + + 49, 21 + + 7 + + cBR2OutputCurve + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tPOutCurve + + + 4 + + + Linear + + + Quadratic + + + Cubic + + + 31, 28 + + + 46, 21 + + + 6 + + + cBL2OutputCurve + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tPOutCurve + + + 5 + + + True + + + NoControl + + + 86, 31 + + + 24, 13 + + + 5 + + + R2: + + + label22 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tPOutCurve + + + 6 + + + True + + + NoControl + + + 6, 31 + + + 22, 13 + + + 4 + + + L2: + + + label21 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tPOutCurve + + + 7 + + + Linear + + + Enhanced Precison + + + Quadratic + + + Cubic + + + 111, 3 + + + 49, 21 + + + 3 + + + rsOutCurveComboBox + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tPOutCurve + + + 8 + + + Linear + + + Enhanced Precision + + + Quadratic + + + Cubic + + + 31, 2 + + + 46, 21 + + + 2 + + + lsOutCurveComboBox + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tPOutCurve + + + 9 + + + True + + + NoControl + + + 85, 5 + + + 25, 13 + + + 1 + + + RS: + + + label10 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tPOutCurve + + + 10 + + + True + + + NoControl + + + 6, 5 + + + 23, 13 + + + 0 + + + LS: + + + label9 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tPOutCurve + + + 11 + + + 4, 22 + + + 264, 52 + + + 4 + + + Output Curve + + + tPOutCurve + + + System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tCSens + + + 3 + 36, 16 @@ -8815,393 +7333,186 @@ with profile 5 - - Linear + + 4, 22 - - Enhanced Precison + + 3, 3, 3, 3 - - Quadratic + + 264, 52 - - Cubic - - - 170, 16 - - - 71, 21 - - - 3 - - - rsOutCurveComboBox - - - System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tPOutCurve - - - 0 - - - Linear - - - Enhanced Precision - - - Quadratic - - - Cubic - - - 39, 15 - - - 71, 21 - - - 2 - - - lsOutCurveComboBox - - - System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tPOutCurve - - + 1 - + + Curve (Input) + + + tPCurve + + + System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tCSens + + + 4 + + + 160, 21 + + + 74, 20 + + + 219 + + + nUDRSRotation + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tpRotation + + + 0 + + True - + NoControl - - 135, 20 + + 125, 23 - + 25, 13 - - 1 + + 218 - + RS: - - label10 + + label14 - + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - tPOutCurve + + tpRotation - + + 1 + + + 42, 20 + + + 68, 20 + + + 217 + + + nUDLSRotation + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tpRotation + + 2 - + True - + NoControl - - 10, 19 + + 4, 22 - + 23, 13 - - 0 + + 216 - + LS: - - label9 + + label13 - + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - tPOutCurve + + tpRotation - + + 3 + + + 4, 22 + + + 3, 3, 3, 3 + + + 264, 52 + + + 5 + + + Rotation + + + tpRotation + + + System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tCSens + + + 5 + + + 281, 55 + + + 272, 78 + + + 234 + + + tCSens + + + System.Windows.Forms.TabControl, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + fLPSettings + + 3 True - - rBSAControls - - - System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - gBGyro - - - 0 - - - rBSAMouse - - - System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - gBGyro - - - 1 - - - pnlSAMouse - - - System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - gBGyro - - - 2 - - - 3, 253 - - - 272, 224 - - - 248 - - - Gyro - - - gBGyro - - - System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - fLPSettings - - - 1 - - - lbL2S - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - gBSensitivity - - - 0 - - - nUDL2S - - - System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - gBSensitivity - - - 1 - - - nUDLSS - - - System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - gBSensitivity - - - 2 - - - lbSixaxisXS - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - gBSensitivity - - - 3 - - - nUDR2S - - - System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - gBSensitivity - - - 4 - - - lbSixaxisZS - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - gBSensitivity - - - 5 - - - nUDRSS - - - System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - gBSensitivity - - - 6 - - - lbR2LS - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - gBSensitivity - - - 7 - - - nUDSXS - - - System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - gBSensitivity - - - 8 - - - lbRSS - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - gBSensitivity - - - 9 - - - lbLSS - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - gBSensitivity - - - 10 - - - nUDSZS - - - System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - gBSensitivity - - - 11 - - - 281, 139 - - - 272, 76 - - - 257 - - - Sensitivity - - - gBSensitivity - - - System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - fLPSettings - - - 4 - - - Fill - - - TopDown - - - 446, 0 - - - 2, 2, 2, 2 - - - 564, 481 - - - 254 - - - fLPSettings - - - System.Windows.Forms.FlowLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 2 - True @@ -9268,213 +7579,69 @@ with profile 1 - - lbGyroSmooth + + Yaw - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + Roll - + + 170, 93 + + + 74, 21 + + + 271 + + + cBGyroMouseXAxis + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + pnlSAMouse - + 0 - - cBGyroSmooth + + True - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + NoControl - + + 167, 74 + + + 39, 13 + + + 270 + + + X Axis: + + + label16 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + pnlSAMouse - + 1 - - lbSmoothWeight - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - pnlSAMouse - - - 2 - - - nUDGyroSmoothWeight - - - System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - pnlSAMouse - - - 3 - - - label12 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - pnlSAMouse - - - 4 - - - nUDGyroMouseVertScale - - - System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - pnlSAMouse - - - 5 - - - label11 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - pnlSAMouse - - - 6 - - - gyroTriggerBehavior - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - pnlSAMouse - - - 7 - - - cBGyroInvertY - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - pnlSAMouse - - - 8 - - - cBGyroInvertX - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - pnlSAMouse - - - 9 - - - lbGyroInvert - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - pnlSAMouse - - - 10 - - - lbGyroTriggers - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - pnlSAMouse - - - 11 - - - btnGyroTriggers - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - pnlSAMouse - - - 12 - - - nUDGyroSensitivity - - - System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - pnlSAMouse - - - 13 - - - lbGyroSens - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - pnlSAMouse - - - 14 - - - 6, 43 - - - 2, 2, 2, 2 - - - 263, 170 - - - 259 - - - pnlSAMouse - - - System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - gBGyro - - - 2 - True + + NoControl + 8, 145 @@ -9497,7 +7664,7 @@ with profile pnlSAMouse - 0 + 2 True @@ -9527,7 +7694,7 @@ with profile pnlSAMouse - 1 + 3 True @@ -9557,7 +7724,7 @@ with profile pnlSAMouse - 2 + 4 False @@ -9581,7 +7748,7 @@ with profile pnlSAMouse - 3 + 5 True @@ -9611,7 +7778,7 @@ with profile pnlSAMouse - 4 + 6 96, 93 @@ -9632,7 +7799,7 @@ with profile pnlSAMouse - 5 + 7 True @@ -9662,7 +7829,7 @@ with profile pnlSAMouse - 6 + 8 True @@ -9695,7 +7862,7 @@ with profile pnlSAMouse - 7 + 9 True @@ -9728,7 +7895,7 @@ with profile pnlSAMouse - 8 + 10 True @@ -9761,7 +7928,7 @@ with profile pnlSAMouse - 9 + 11 True @@ -9794,7 +7961,7 @@ with profile pnlSAMouse - 10 + 12 True @@ -9827,7 +7994,7 @@ with profile pnlSAMouse - 11 + 13 NoControl @@ -9857,7 +8024,7 @@ with profile pnlSAMouse - 12 + 14 96, 67 @@ -9878,7 +8045,7 @@ with profile pnlSAMouse - 13 + 15 True @@ -9911,7 +8078,55 @@ with profile pnlSAMouse - 14 + 16 + + + 6, 43 + + + 2, 2, 2, 2 + + + 263, 170 + + + 259 + + + pnlSAMouse + + + System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gBGyro + + + 2 + + + 3, 253 + + + 272, 224 + + + 248 + + + Gyro + + + gBGyro + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + fLPSettings + + + 1 True @@ -10231,18 +8446,63 @@ with profile 11 + + 281, 139 + + + 272, 76 + + + 257 + + + Sensitivity + + + gBSensitivity + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + fLPSettings + + + 4 + + + Fill + + + TopDown + + + 446, 0 + + + 2, 2, 2, 2 + + + 565, 481 + + + 254 + + + fLPSettings + + + System.Windows.Forms.FlowLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 2 + 482, 17 - - 195, 444 - - - cMGyroTriggers - - - System.Windows.Forms.ContextMenuStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - 194, 22 @@ -10363,6 +8623,15 @@ with profile Always on + + 195, 444 + + + cMGyroTriggers + + + System.Windows.Forms.ContextMenuStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + 647, 17 @@ -10376,7 +8645,7 @@ with profile True - 1010, 481 + 1011, 481 4, 4, 4, 4 @@ -10682,7 +8951,7 @@ with profile advColorDialog - DS4Windows.AdvancedColorDialog, DS4Windows, Version=1.4.82.0, Culture=neutral, PublicKeyToken=null + DS4Windows.AdvancedColorDialog, DS4Windows, Version=1.4.85.0, Culture=neutral, PublicKeyToken=null Options diff --git a/DS4Windows/DS4Library/DS4Device.cs b/DS4Windows/DS4Library/DS4Device.cs index d4fa8cf..abcbf64 100644 --- a/DS4Windows/DS4Library/DS4Device.cs +++ b/DS4Windows/DS4Library/DS4Device.cs @@ -133,7 +133,6 @@ namespace DS4Windows private byte[] accel = new byte[6]; private byte[] gyro = new byte[6]; private byte[] inputReport; - //private byte[] inputReport2; private byte[] btInputReport = null; private byte[] outputReportBuffer, outputReport; private readonly DS4Touchpad touchpad = null; @@ -164,7 +163,7 @@ namespace DS4Windows public event EventHandler Removal = null; public event EventHandler SyncChange = null; public event EventHandler SerialChange = null; - public event EventHandler PublishRemoval = null; + //public event EventHandler PublishRemoval = null; public HidDevice HidDevice => hDevice; public bool IsExclusive => HidDevice.IsExclusive; @@ -415,7 +414,6 @@ namespace DS4Windows if (conType == ConnectionType.USB || conType == ConnectionType.SONYWA) { inputReport = new byte[64]; - //inputReport2 = new byte[64]; outputReport = new byte[hDevice.Capabilities.OutputReportByteLength]; outputReportBuffer = new byte[hDevice.Capabilities.OutputReportByteLength]; if (conType == ConnectionType.USB) @@ -668,8 +666,6 @@ namespace DS4Windows { oldCharging = charging; currerror = string.Empty; - curTimeDouble = sw.Elapsed.TotalMilliseconds; - curtime = sw.ElapsedMilliseconds; if (tempLatencyCount >= 50) { @@ -677,12 +673,9 @@ namespace DS4Windows tempLatencyCount--; } - lastTimeElapsed = curtime - oldtime; - lastTimeElapsedDouble = (curTimeDouble - oldTimeDouble); latencyQueue.Enqueue(this.lastTimeElapsed); tempLatencyCount++; - oldtime = curtime; - oldTimeDouble = curTimeDouble; + Latency = latencyQueue.Average(); if (conType == ConnectionType.BT) @@ -691,7 +684,6 @@ namespace DS4Windows //HidDevice.ReadStatus res = hDevice.ReadAsyncWithFileStream(btInputReport, READ_STREAM_TIMEOUT); HidDevice.ReadStatus res = hDevice.ReadWithFileStream(btInputReport); timeoutEvent = false; - //HidDevice.ReadStatus res = hDevice.ReadFileOverlapped(btInputReport, READ_STREAM_TIMEOUT); if (res == HidDevice.ReadStatus.Success) { Array.Copy(btInputReport, 2, inputReport, 0, inputReport.Length); @@ -705,7 +697,7 @@ namespace DS4Windows else { int winError = Marshal.GetLastWin32Error(); - Console.WriteLine(Mac.ToString() + " " + System.DateTime.UtcNow.ToString("o") + "> disconnect due to read failure: " + winError); + Console.WriteLine(Mac.ToString() + " " + DateTime.UtcNow.ToString("o") + "> disconnect due to read failure: " + winError); //Log.LogToGui(Mac.ToString() + " disconnected due to read failure: " + winError, true); } @@ -730,7 +722,6 @@ namespace DS4Windows //Array.Clear(inputReport, 0, inputReport.Length); //HidDevice.ReadStatus res = hDevice.ReadAsyncWithFileStream(inputReport, READ_STREAM_TIMEOUT); HidDevice.ReadStatus res = hDevice.ReadWithFileStream(inputReport); - //HidDevice.ReadStatus res = hDevice.ReadFileOverlapped(inputReport, READ_STREAM_TIMEOUT); if (res != HidDevice.ReadStatus.Success) { if (res == HidDevice.ReadStatus.WaitTimedOut) @@ -740,7 +731,7 @@ namespace DS4Windows else { int winError = Marshal.GetLastWin32Error(); - Console.WriteLine(Mac.ToString() + " " + System.DateTime.UtcNow.ToString("o") + "> disconnect due to read failure: " + winError); + Console.WriteLine(Mac.ToString() + " " + DateTime.UtcNow.ToString("o") + "> disconnect due to read failure: " + winError); //Log.LogToGui(Mac.ToString() + " disconnected due to read failure: " + winError, true); } @@ -757,12 +748,17 @@ namespace DS4Windows timeoutExecuted = true; return; } - else - { - //Array.Copy(inputReport2, 0, inputReport, 0, inputReport.Length); - } } + curTimeDouble = sw.Elapsed.TotalMilliseconds; + curtime = sw.ElapsedMilliseconds; + + lastTimeElapsed = curtime - oldtime; + lastTimeElapsedDouble = (curTimeDouble - oldTimeDouble); + + oldtime = curtime; + oldTimeDouble = curTimeDouble; + if (conType == ConnectionType.BT && btInputReport[0] != 0x11) { //Received incorrect report, skip it @@ -855,7 +851,7 @@ namespace DS4Windows // Store Gyro and Accel values Array.Copy(inputReport, 13, gyro, 0, 6); Array.Copy(inputReport, 19, accel, 0, 6); - sixAxis.handleSixaxis(gyro, accel, cState); + sixAxis.handleSixaxis(gyro, accel, cState, lastTimeElapsedDouble); /* Debug output of incoming HID data: if (cState.L2 == 0xff && cState.R2 == 0xff) @@ -996,7 +992,7 @@ namespace DS4Windows //outputReportBuffer[1] = 0x80; //outputReportBuffer[1] = 0x84; outputReportBuffer[1] = (byte)(0x80 | btPollRate); // input report rate - // enable lightbar, rumble, flash + // enable rumble (0x01), lightbar (0x02), flash (0x04) outputReportBuffer[3] = 0xf7; outputReportBuffer[6] = rightLightFastRumble; // fast motor outputReportBuffer[7] = leftHeavySlowRumble; // slow motor @@ -1009,7 +1005,7 @@ namespace DS4Windows else { outputReportBuffer[0] = 0x05; - // enable lightbar, rumble, flash + // enable rumble (0x01), lightbar (0x02), flash (0x04) outputReportBuffer[1] = 0xf7; outputReportBuffer[4] = rightLightFastRumble; // fast motor outputReportBuffer[5] = leftHeavySlowRumble; // slow motor @@ -1200,13 +1196,6 @@ namespace DS4Windows return pState.Clone(); } - public void getExposedState(DS4StateExposed expState, DS4State state) - { - cState.CopyTo(state); - expState.setAccel(accel); - expState.setGyro(gyro); - } - public void getCurrentState(DS4State state) { cState.CopyTo(state); diff --git a/DS4Windows/DS4Library/DS4Sixaxis.cs b/DS4Windows/DS4Library/DS4Sixaxis.cs index a715c8b..b9093a3 100644 --- a/DS4Windows/DS4Library/DS4Sixaxis.cs +++ b/DS4Windows/DS4Library/DS4Sixaxis.cs @@ -15,100 +15,79 @@ namespace DS4Windows public class SixAxis { - public readonly int gyroX, gyroY, gyroZ, deltaX, deltaY, deltaZ, accelX, accelY, accelZ; - public readonly int gyroXFull, gyroYFull, gyroZFull; - public readonly int accelXFull, accelYFull, accelZFull; + public int gyroYaw, gyroPitch, gyroRoll, accelX, accelY, accelZ; + public readonly int gyroYawFull, gyroPitchFull, gyroRollFull; + public int accelXFull, accelYFull, accelZFull; public readonly byte touchID; - public readonly SixAxis previousAxis; - public SixAxis(int X, int Y, int Z, int aX, int aY, int aZ, SixAxis prevAxis = null) + public readonly double elapsed; + public readonly SixAxis previousAxis = null; + public SixAxis(int X, int Y, int Z, int aX, int aY, int aZ, + double milliseconds, SixAxis prevAxis = null) { - gyroX = X / 256; - gyroY = Y / 256; - gyroZ = Z / 256; - gyroXFull = X; - gyroYFull = Y; - gyroZFull = Z; + gyroYaw = -X / 256; + gyroPitch = Y / 256; + gyroRoll = -Z / 256; + gyroYawFull = -X; + gyroPitchFull = Y; + gyroRollFull = -Z; - accelX = aX / 64; - accelY = aY / 64; + // Put accel ranges between 0 - 128 abs + accelX = -aX / 64; + accelY = -aY / 64; accelZ = aZ / 64; - accelXFull = aX; - accelYFull = aY; + + accelXFull = -aX; + accelYFull = -aY; accelZFull = aZ; + elapsed = milliseconds; previousAxis = prevAxis; - if (previousAxis != null) - { - deltaX = gyroX - previousAxis.gyroX; - deltaY = gyroY - previousAxis.gyroY; - deltaZ = gyroZ - previousAxis.gyroZ; - } } } public class DS4SixAxis { - //public event EventHandler SixAxisMoved = null; // deltaX/deltaY are set because one or both fingers were already down on a prior sensor reading - public event EventHandler SixAccelMoved = null; // no status change for the touchpad itself... but other sensors may have changed, or you may just want to do some processing + public event EventHandler SixAccelMoved = null; - internal int lastGyroX, lastGyroY, lastGyroZ, lastAX, lastAY, lastAZ; // tracks 0, 1 or 2 touches; we maintain touch 1 and 2 separately + internal int lastGyroYaw, lastGyroPitch, lastGyroRoll, + lastAX, lastAY, lastAZ; + + internal double lastMilliseconds; internal byte[] previousPacket = new byte[8]; - public void handleSixaxis(byte[] gyro, byte[] accel, DS4State state) + public void handleSixaxis(byte[] gyro, byte[] accel, DS4State state, double milliseconds) { - //bool touchPadIsDown = sensors.TouchButton; - /*if (!PacketChanged(data, touchPacketOffset) && touchPadIsDown == lastTouchPadIsDown) - { - if (SixAxisUnchanged != null) - SixAxisUnchanged(this, EventArgs.Empty); - return; - }*/ - /* byte touchID1 = (byte)(data[0 + TOUCHPAD_DATA_OFFSET + touchPacketOffset] & 0x7F); - byte touchID2 = (byte)(data[4 + TOUCHPAD_DATA_OFFSET + touchPacketOffset] & 0x7F);*/ + int currentYaw = (short)((ushort)(gyro[3] << 8) | gyro[2]); + int currentPitch = (short)((ushort)(gyro[1] << 8) | gyro[0]); + int currentRoll = (short)((ushort)(gyro[5] << 8) | gyro[4]); + int AccelX = (short)((ushort)(accel[1] << 8) | accel[0]); + int AccelY = (short)((ushort)(accel[3] << 8) | accel[2]); + int AccelZ = (short)((ushort)(accel[5] << 8) | accel[4]); - int currentX = (short)((ushort)(gyro[3] << 8) | gyro[2]); // Gyro Pitch - int currentY = (short)((ushort)(gyro[1] << 8) | gyro[0]); // Gyro Yaw - int currentZ = (short)((ushort)(gyro[5] << 8) | gyro[4]); // Gyro Roll - int AccelX = (short)((ushort)(accel[1] << 8) | accel[0]); // Accel Pitch - int AccelY = (short)((ushort)(accel[3] << 8) | accel[2]); // Accel Roll - int AccelZ = (short)((ushort)(accel[5] << 8) | accel[4]); // Accel Yaw - - SixAxisEventArgs args; - //if (sensors.Touch1 || sensors.Touch2) - { - /* if (SixAxisMoved != null) - { - SixAxis sPrev, now; - sPrev = new SixAxis(lastGyroX, lastGyroY, lastGyroZ, lastAX,lastAY,lastAZ); - now = new SixAxis(currentX, currentY, currentZ, AccelX, AccelY, AccelZ, sPrev); - args = new SixAxisEventArgs(state.ReportTimeStamp, now); - SixAxisMoved(this, args); - } - - lastGyroX = currentX; - lastGyroY = currentY; - lastGyroZ = currentZ; - lastAX = AccelX; - lastAY = AccelY; - lastAZ = AccelZ;*/ - } + SixAxisEventArgs args = null; if (AccelX != 0 || AccelY != 0 || AccelZ != 0) { if (SixAccelMoved != null) { - SixAxis sPrev, now; - sPrev = new SixAxis(lastGyroX, lastGyroY, lastGyroZ, lastAX, lastAY, lastAZ); - now = new SixAxis(currentX, currentY, currentZ, AccelX, AccelY, AccelZ, sPrev); + SixAxis sPrev = null, now = null; + sPrev = new SixAxis(lastGyroYaw, lastGyroPitch, lastGyroRoll, + lastAX, lastAY, lastAZ, lastMilliseconds); + + now = new SixAxis(currentYaw, currentPitch, currentRoll, + AccelX, AccelY, AccelZ, milliseconds, sPrev); + args = new SixAxisEventArgs(state.ReportTimeStamp, now); + state.Motion = now; SixAccelMoved(this, args); } - lastGyroX = currentX; - lastGyroY = currentY; - lastGyroZ = currentZ; + lastGyroYaw = currentYaw; + lastGyroPitch = currentPitch; + lastGyroRoll = currentRoll; lastAX = AccelX; lastAY = AccelY; lastAZ = AccelZ; + lastMilliseconds = milliseconds; } } } diff --git a/DS4Windows/DS4Library/DS4State.cs b/DS4Windows/DS4Library/DS4State.cs index 9971291..d7fb3de 100644 --- a/DS4Windows/DS4Library/DS4State.cs +++ b/DS4Windows/DS4Library/DS4State.cs @@ -8,7 +8,8 @@ namespace DS4Windows public bool Square, Triangle, Circle, Cross; public bool DpadUp, DpadDown, DpadLeft, DpadRight; public bool L1, L3, R1, R3; - public bool Share, Options, PS, Touch1, Touch2, TouchButton, TouchRight, TouchLeft, Touch1Finger, Touch2Fingers; + public bool Share, Options, PS, Touch1, Touch2, TouchButton, TouchRight, + TouchLeft, Touch1Finger, Touch2Fingers; public byte Touch1Identifier, Touch2Identifier; public byte LX, RX, LY, RY, L2, R2; public byte FrameCounter; // 0, 1, 2...62, 63, 0.... @@ -22,6 +23,7 @@ namespace DS4Windows public double LYUnit; public double RXUnit; public double RYUnit; + public SixAxis Motion = null; public static readonly int DEFAULT_AXISDIR_VALUE = 127; public DS4State() @@ -44,6 +46,7 @@ namespace DS4Windows LYUnit = 0.0; RXUnit = 0.0; RYUnit = 0.0; + Motion = new SixAxis(0, 0, 0, 0, 0, 0, 0.0); } public DS4State(DS4State state) @@ -90,6 +93,7 @@ namespace DS4Windows LYUnit = state.LYUnit; RXUnit = state.RXUnit; RYUnit = state.RYUnit; + Motion = state.Motion; } public DS4State Clone() @@ -141,6 +145,7 @@ namespace DS4Windows state.LYUnit = LYUnit; state.RXUnit = RXUnit; state.RYUnit = RYUnit; + state.Motion = Motion; } public void calculateStickAngles() @@ -164,20 +169,16 @@ namespace DS4Windows { double sinAngle = Math.Sin(rotation), cosAngle = Math.Cos(rotation); double tempLX = LX - 127.5, tempLY = LY - 127.5; - Byte tempx = (Byte)(tempLX * cosAngle - tempLY * sinAngle + 127.5); - Byte tempy = (Byte)(tempLX * sinAngle + tempLY * cosAngle + 127.5); - LX = tempx; - LY = tempy; + LX = (Byte)(Global.Clamp(-127.5, (tempLX * cosAngle - tempLY * sinAngle), 127.5) + 127.5); + LY = (Byte)(Global.Clamp(-127.5, (tempLX * sinAngle + tempLY * cosAngle), 127.5) + 127.5); } public void rotateRSCoordinates(double rotation) { double sinAngle = Math.Sin(rotation), cosAngle = Math.Cos(rotation); double tempRX = RX - 127.5, tempRY = RY - 127.5; - Byte tempx = (Byte)(tempRX * cosAngle - tempRY * sinAngle + 127.5); - Byte tempy = (Byte)(tempRX * sinAngle + tempRY * cosAngle + 127.5); - RX = tempx; - RY = tempy; + RX = (Byte)(Global.Clamp(-127.5, (tempRX * cosAngle - tempRY * sinAngle), 127.5) + 127.5); + RY = (Byte)(Global.Clamp(-127.5, (tempRX * sinAngle + tempRY * cosAngle), 127.5) + 127.5); } } } diff --git a/DS4Windows/DS4Library/DS4StateExposed.cs b/DS4Windows/DS4Library/DS4StateExposed.cs index 924cc4a..56361d4 100644 --- a/DS4Windows/DS4Library/DS4StateExposed.cs +++ b/DS4Windows/DS4Library/DS4StateExposed.cs @@ -4,115 +4,79 @@ namespace DS4Windows public class DS4StateExposed { private DS4State _state; - private byte[] accel = new byte[] { 0, 0, 0, 0, 0, 0 }, - gyro = new byte[] { 0, 0, 0, 0, 0, 0 }; public DS4StateExposed() { _state = new DS4State(); } + public DS4StateExposed(DS4State state) { _state = state; } - bool Square { get { return _state.Square; } } - bool Triangle { get { return _state.Triangle; } } - bool Circle { get { return _state.Circle; } } - bool Cross { get { return _state.Cross; } } - bool DpadUp { get { return _state.DpadUp; } } - bool DpadDown { get { return _state.DpadDown; } } - bool DpadLeft { get { return _state.DpadLeft; } } - bool DpadRight { get { return _state.DpadRight; } } - bool L1 { get { return _state.L1; } } - bool L3 { get { return _state.L3; } } - bool R1 { get { return _state.R1; } } - bool R3 { get { return _state.R3; } } - bool Share { get { return _state.Share; } } - bool Options { get { return _state.Options; } } - bool PS { get { return _state.PS; } } - bool Touch1 { get { return _state.Touch1; } } - bool Touch2 { get { return _state.Touch2; } } - bool TouchButton { get { return _state.TouchButton; } } - bool Touch1Finger { get { return _state.Touch1Finger; } } + bool Square { get { return _state.Square; } } + bool Triangle { get { return _state.Triangle; } } + bool Circle { get { return _state.Circle; } } + bool Cross { get { return _state.Cross; } } + bool DpadUp { get { return _state.DpadUp; } } + bool DpadDown { get { return _state.DpadDown; } } + bool DpadLeft { get { return _state.DpadLeft; } } + bool DpadRight { get { return _state.DpadRight; } } + bool L1 { get { return _state.L1; } } + bool L3 { get { return _state.L3; } } + bool R1 { get { return _state.R1; } } + bool R3 { get { return _state.R3; } } + bool Share { get { return _state.Share; } } + bool Options { get { return _state.Options; } } + bool PS { get { return _state.PS; } } + bool Touch1 { get { return _state.Touch1; } } + bool Touch2 { get { return _state.Touch2; } } + bool TouchButton { get { return _state.TouchButton; } } + bool Touch1Finger { get { return _state.Touch1Finger; } } bool Touch2Fingers { get { return _state.Touch2Fingers; } } - byte LX { get { return _state.LX; } } - byte RX { get { return _state.RX; } } - byte LY { get { return _state.LY; } } - byte RY { get { return _state.RY; } } - byte L2 { get { return _state.L2; } } - byte R2 { get { return _state.R2; } } + byte LX { get { return _state.LX; } } + byte RX { get { return _state.RX; } } + byte LY { get { return _state.LY; } } + byte RY { get { return _state.RY; } } + byte L2 { get { return _state.L2; } } + byte R2 { get { return _state.R2; } } int Battery { get { return _state.Battery; } } - /// Holds raw DS4 input data from 14 to 19 - public byte[] Accel { set { accel = value; } } - public void setAccel(byte[] value) + public int GyroYaw { get { return _state.Motion.gyroYaw; } } + public int getGyroYaw() { - accel = value; + return _state.Motion.gyroYaw; } - /// Holds raw DS4 input data from 20 to 25 - public byte[] Gyro { set { gyro = value; } } - public void setGyro(byte[] value) + public int GyroPitch { get { return _state.Motion.gyroPitch; } } + public int getGyroPitch() { - gyro = value; + return _state.Motion.gyroPitch; } - /// Yaw leftward/counter-clockwise/turn to port or larboard side - /// Add double the previous result to this delta and divide by three. - //public int AccelX { get { return (short)((ushort)(accel[2] << 8) | accel[3]) / 256; } } - //public int AccelX { get { return (short)((ushort)(accel[1] << 8) | accel[0]) / 64; } } - public int AccelX { get { return (short)((ushort)(gyro[3] << 8) | gyro[2]) / 256; } } - - /// Pitch upward/backward - /// Add double the previous result to this delta and divide by three. - //public int AccelY { get { return (short)((ushort)(accel[0] << 8) | accel[1] ) / 256; } } - //public int AccelY { get { return (short)((ushort)(accel[3] << 8) | accel[2]) / 64; } } - public int AccelY { get { return (short)((ushort)(gyro[1] << 8) | gyro[0]) / 256; } } - - /// roll left/L side of controller down/starboard raising up - /// Add double the previous result to this delta and divide by three. - //public int AccelZ { get { return (short)((ushort)(accel[4] << 8) | accel[5]) / 256; } } - //public int AccelZ { get { return (short)((ushort)(accel[5] << 8) | accel[4]) / 64; } } - public int AccelZ { get { return (short)((ushort)(gyro[5] << 8) | gyro[4]) / 256; } } - - /// R side of controller upward - /// Add double the previous result to this delta and divide by three. - //public int GyroX { get { return (short)((ushort)(gyro[0] << 8) | gyro[1]) / 64; } } - //public int GyroX { get { return (short)((ushort)(gyro[3] << 8) | gyro[2]) / 256; } } - public int GyroX { get { return (short)((ushort)(accel[1] << 8) | accel[0]) / 64; } } - - public int getGyroX() + public int GyroRoll { get { return _state.Motion.gyroRoll; } } + public int getGyroRoll() { - //return (short)((ushort)(gyro[0] << 8) | gyro[1]) / 64; - //return (short)((ushort)(gyro[3] << 8) | gyro[2]) / 256; - return (short)((ushort)(accel[1] << 8) | accel[0]) / 64; + return _state.Motion.gyroRoll; } - /// touchpad and button face side of controller upward - /// Add double the previous result to this delta and divide by three. - //public int GyroY { get { return (short)((ushort)(gyro[2] << 8) | gyro[3]) / 64; } } - //public int GyroY { get { return (short)((ushort)(gyro[1] << 8) | gyro[0]) / 256; } } - public int GyroY { get { return (short)((ushort)(accel[3] << 8) | accel[2]) / 64; } } - - public int getGyroY() + public int AccelX { get { return _state.Motion.accelX; } } + public int getAccelX() { - //return (short)((ushort)(gyro[2] << 8) | gyro[3]) / 64; - //return (short)((ushort)(gyro[1] << 8) | gyro[0]) / 256; - return (short)((ushort)(accel[3] << 8) | accel[2]) / 64; + return _state.Motion.accelX; } - /// Audio/expansion ports upward and light bar/shoulders/bumpers/USB port downward - /// Add double the previous result to this delta and divide by three. - //public int GyroZ { get { return (short)((ushort)(gyro[4] << 8) | gyro[5]) / 64; } } - //public int GyroZ { get { return (short)((ushort)(gyro[5] << 8) | gyro[4]) / 256; } } - public int GyroZ { get { return (short)((ushort)(accel[5] << 8) | accel[4]) / 64; } } - - public int getGyroZ() + public int AccelY { get { return _state.Motion.accelY; } } + public int getAccelY() { - //return (short)((ushort)(gyro[4] << 8) | gyro[5]) / 64; - //return (short)((ushort)(gyro[5] << 8) | gyro[4]) / 256; - return (short)((ushort)(accel[5] << 8) | accel[4]) / 64; + return _state.Motion.accelY; + } + + public int AccelZ { get { return _state.Motion.accelZ; } } + public int getAccelZ() + { + return _state.Motion.accelZ; } } } diff --git a/DS4Windows/Properties/AssemblyInfo.cs b/DS4Windows/Properties/AssemblyInfo.cs index 0111199..b6f3c9a 100644 --- a/DS4Windows/Properties/AssemblyInfo.cs +++ b/DS4Windows/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ using System.Runtime.InteropServices; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.4.84")] -[assembly: AssemblyFileVersion("1.4.84")] +[assembly: AssemblyVersion("1.4.86")] +[assembly: AssemblyFileVersion("1.4.86")] diff --git a/README.md b/README.md index d075ac2..d8b7f55 100644 --- a/README.md +++ b/README.md @@ -6,14 +6,24 @@ DS4Windows is a portable program that allows you to get the best DualShock 4 exp You can find the latest and older versions [here](https://github.com/Ryochan7/DS4Windows/releases). +This project is a fork of the work of Jays2Kings. You can find the old project +website at [ds4windows.com](http://ds4windows.com). + ## Requirements - [Microsoft .NET 4.5 or higher (needed to unzip the driver and for macros to work properly)](http://www.microsoft.com/en-us/download/details.aspx?id=42642) -- DS4 Driver (Downloaded & Installed with DS4Windows) +- SCP Virtual Bus Driver (Downloaded & Installed with DS4Windows) - Microsoft 360 Driver (link inside DS4Windows, already installed on Windows 7 SP1 and higher or if you've used a 360 controller before) - Sony DualShock 4 (This should be obvious) - Micro USB cable - (Optional)Bluetooth 2.1+, via adapter or built in pc [(My recommendation)](http://www.amazon.com/gp/product/B004LNXO28/ref=oh_aui_search_detailpage?ie=UTF8&psc=1) (Toshiba's bluetooth & Bluetooth adapters using CSR currently does not work) -Note: Hide DS4 currently doesn't work on Windows 10 without a workaround (disabling Network list service and restarting, but this causes serious issues with windows, use caution). -You can find more info out at [ds4windows.com](http://ds4windows.com). +## Pull Requests + +Pull requests for DS4Windows are welcome. Before making a pull request, please +test your changes to ensure that the changes made do not negatively affect +the performance of other parts of the application. Some consideration will +be made during code review to try to tweak the changes in order to improve +application performance. However, there is a chance that a pull request will be +rejected if no reasonable solution can be found to incorporate code changes. +