|
|
|
|
|
|
|
|
// Timeout when waiting for longpress (ms) |
|
|
// Timeout when waiting for longpress (ms) |
|
|
const unsigned GH_LONGPRESS_TIMEOUT = 1000; |
|
|
const unsigned GH_LONGPRESS_TIMEOUT = 1000; |
|
|
|
|
|
|
|
|
|
|
|
// Timeout when waiting to decide between PINCH and TWODRAG (ms) |
|
|
|
|
|
const unsigned GH_TWOTOUCH_TIMEOUT = 50; |
|
|
|
|
|
|
|
|
GestureHandler::GestureHandler() : |
|
|
GestureHandler::GestureHandler() : |
|
|
state(GH_INITSTATE), waitingRelease(false), |
|
|
state(GH_INITSTATE), waitingRelease(false), |
|
|
longpressTimer(this), twoTouchTimer(this) |
|
|
longpressTimer(this), twoTouchTimer(this) |
|
|
|
|
|
|
|
|
} else if(!twoTouchTimer.isStarted()) { |
|
|
} else if(!twoTouchTimer.isStarted()) { |
|
|
// We can't determine the gesture right now, let's |
|
|
// We can't determine the gesture right now, let's |
|
|
// wait and see if more events are on their way |
|
|
// wait and see if more events are on their way |
|
|
twoTouchTimer.start(50); |
|
|
|
|
|
|
|
|
twoTouchTimer.start(GH_TWOTOUCH_TIMEOUT); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|