diff --git a/DS4Windows/DS4Control/MouseCursor.cs b/DS4Windows/DS4Control/MouseCursor.cs index c65ffe5..61cd440 100644 --- a/DS4Windows/DS4Control/MouseCursor.cs +++ b/DS4Windows/DS4Control/MouseCursor.cs @@ -37,7 +37,7 @@ namespace DS4Windows public virtual void sixaxisMoved(SixAxisEventArgs arg) { int deltaX = 0, deltaY = 0; - deltaX = -arg.sixAxis.gyroYawFull; + deltaX = arg.sixAxis.gyroYawFull; deltaY = -arg.sixAxis.gyroPitchFull; //Console.WriteLine(arg.sixAxis.deltaX); @@ -61,12 +61,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; } @@ -170,10 +170,10 @@ namespace DS4Windows //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) diff --git a/DS4Windows/DS4Library/DS4Sixaxis.cs b/DS4Windows/DS4Library/DS4Sixaxis.cs index d58e2dc..c2a4015 100644 --- a/DS4Windows/DS4Library/DS4Sixaxis.cs +++ b/DS4Windows/DS4Library/DS4Sixaxis.cs @@ -25,9 +25,9 @@ namespace DS4Windows gyroX = X / 256; gyroY = Y / 256; gyroZ = Z / 256; - gyroYawFull = X; + gyroYawFull = -X; gyroPitchFull = Y; - gyroRollFull = Z; + gyroRollFull = -Z; accelX = aX / 64; accelY = aY / 64; diff --git a/DS4Windows/DS4Library/DS4State.cs b/DS4Windows/DS4Library/DS4State.cs index 9971291..4b75b5f 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....