From a90e5f705010f6381cc8c36856d307055439a783 Mon Sep 17 00:00:00 2001 From: Kishor Prins Date: Sat, 6 May 2017 20:24:08 -0400 Subject: [PATCH] Fix scroll then 2F press --- VoodooI2C/csgesture.cpp | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/VoodooI2C/csgesture.cpp b/VoodooI2C/csgesture.cpp index 6c4cb967..61ede57e 100644 --- a/VoodooI2C/csgesture.cpp +++ b/VoodooI2C/csgesture.cpp @@ -140,10 +140,20 @@ bool CSGesture::ProcessMove(csgesture_softc *sc, int abovethreshold, int iToUse[ bool CSGesture::ProcessScroll(csgesture_softc *sc, int abovethreshold, int iToUse[3]) { sc->scrollx = 0; sc->scrolly = 0; + + if(sc->buttondown || sc->mouseDownDueToTap) { + if (_scrollHandler->isScrolling()) { + _scrollHandler->stopScroll(); + } + + return false; + } + if (abovethreshold == 2 || sc->scrollingActive) { int i1 = iToUse[0]; int i2 = iToUse[1]; + if (!sc->scrollingActive && !sc->scrollInertiaActive) { if (sc->truetick[i1] < 8 && sc->truetick[i2] < 8) return false; @@ -458,7 +468,7 @@ void CSGesture::ProcessGesture(csgesture_softc *sc) { if (!handled) handled = ProcessThreeFingerSwipe(sc, abovethreshold, iToUse); - if (!handled && !sc->buttondown && !sc->mouseDownDueToTap) + if (!handled) handledByScroll = handled = ProcessScroll(sc, abovethreshold, iToUse); if (!handled) handled = ProcessMove(sc, abovethreshold, iToUse); @@ -482,12 +492,11 @@ void CSGesture::ProcessGesture(csgesture_softc *sc) { sc->mousebutton = 3; if (!sc->mouseDownDueToTap) { + if (_scrollHandler->isScrolling()){ + _scrollHandler->stopScroll(); + } + if (sc->buttondown && !sc->mousedown) { - if (_scrollHandler->isScrolling()){ - _scrollHandler->stopScroll(); - return; - } - sc->mousedown = true; sc->tickssinceclick = 0;