From beca0662074f97fb4d7b4ee118bf6087c0fb8824 Mon Sep 17 00:00:00 2001 From: Travis Nickles Date: Fri, 12 Jan 2018 00:45:16 -0600 Subject: [PATCH] Need to populate firstTouch object because Touch instances are being reused Related to issue #190. --- DS4Windows/DS4Control/Mouse.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/DS4Windows/DS4Control/Mouse.cs b/DS4Windows/DS4Control/Mouse.cs index 369ef8d..126eeb5 100644 --- a/DS4Windows/DS4Control/Mouse.cs +++ b/DS4Windows/DS4Control/Mouse.cs @@ -49,6 +49,7 @@ namespace DS4Windows cursor = new MouseCursor(deviceNum); wheel = new MouseWheel(deviceNum); trackballAccel = TRACKBALL_RADIUS * TRACKBALL_INIT_FICTION / TRACKBALL_INERTIA; + firstTouch = new Touch(0, 0, 0, null); } public void ResetTrackAccel(double friction) @@ -196,7 +197,8 @@ namespace DS4Windows } pastTime = arg.timeStamp; - firstTouch = arg.touches[0]; + firstTouch.populate(arg.touches[0].hwX, arg.touches[0].hwY, arg.touches[0].touchID, + arg.touches[0].previousTouch); if (Global.getDoubleTap(deviceNum)) {