From 269ca4782f2db548b9c4d9ebe7d917de5efe99e4 Mon Sep 17 00:00:00 2001 From: Travis Nickles Date: Sat, 15 Apr 2017 00:07:56 -0700 Subject: [PATCH] Fix drifting mouse around dead zone --- DS4Windows/DS4Control/Mapping.cs | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/DS4Windows/DS4Control/Mapping.cs b/DS4Windows/DS4Control/Mapping.cs index fa21957..afb64ad 100644 --- a/DS4Windows/DS4Control/Mapping.cs +++ b/DS4Windows/DS4Control/Mapping.cs @@ -2101,36 +2101,36 @@ namespace DS4Windows switch (control) { case DS4Controls.LXNeg: - if (cState.LX < 127.5f - deadzoneL) - value = -(cState.LX - 127.5f - deadzoneL) / 2550d * speed; + if (cState.LX < 127 - deadzoneL) + value = -(cState.LX - 127 - deadzoneL) / 2550d * speed; break; case DS4Controls.LXPos: - if (cState.LX > 127.5f + deadzoneL) - value = (cState.LX - 127.5f + deadzoneL) / 2550d * speed; + if (cState.LX > 127 + deadzoneL) + value = (cState.LX - 127 + deadzoneL) / 2550d * speed; break; case DS4Controls.RXNeg: - if (cState.RX < 127.5f - deadzoneR) - value = -(cState.RX - 127.5f - deadzoneR) / 2550d * speed; + if (cState.RX < 127 - deadzoneR) + value = -(cState.RX - 127 - deadzoneR) / 2550d * speed; break; case DS4Controls.RXPos: - if (cState.RX > 127.5f + deadzoneR) - value = (cState.RX - 127.5f + deadzoneR) / 2550d * speed; + if (cState.RX > 127 + deadzoneR) + value = (cState.RX - 127 + deadzoneR) / 2550d * speed; break; case DS4Controls.LYNeg: - if (cState.LY < 127.5f - deadzoneL) - value = -(cState.LY - 127.5f - deadzoneL) / 2550d * speed; + if (cState.LY < 127 - deadzoneL) + value = -(cState.LY - 127 - deadzoneL) / 2550d * speed; break; case DS4Controls.LYPos: - if (cState.LY > 127.5f + deadzoneL) - value = (cState.LY - 127.5f + deadzoneL) / 2550d * speed; + if (cState.LY > 127 + deadzoneL) + value = (cState.LY - 127 + deadzoneL) / 2550d * speed; break; case DS4Controls.RYNeg: if (cState.RY < 127 - deadzoneR) - value = -(cState.RY - 127.5f - deadzoneR) / 2550d * speed; + value = -(cState.RY - 127 - deadzoneR) / 2550d * speed; break; case DS4Controls.RYPos: if (cState.RY > 127 + deadzoneR) - value = (cState.RY - 127.5f + deadzoneR) / 2550d * speed; + value = (cState.RY - 127 + deadzoneR) / 2550d * speed; break; default: break; }