Skip to content

Commit

Permalink
Fix scroll then 2F press
Browse files Browse the repository at this point in the history
  • Loading branch information
kprinssu committed May 7, 2017
1 parent e9c8c89 commit a90e5f7
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions VoodooI2C/csgesture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand All @@ -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;

Expand Down

0 comments on commit a90e5f7

Please sign in to comment.