from Gestures.hpp:34
class Gestures
{
static const uint8_t MAX_TICKS_BETWEEN_MOVES_FOR_SWIPE = 7;
static const uint8_t MIN_VELOCITY_AT_RELEASE_BEFORE_SWIPE = 3;
struct DragState
{
DragState() : startX(0),
startY(0),
downX(0),
downY(0),
tickCount(0),
velocityX(0),
velocityY(0),
inProgress(false)
{
}
uint16_t startX;
uint16_t startY;
uint16_t downX;
uint16_t downY;
uint16_t tickCount;
int16_t velocityX;
int16_t velocityY;
bool inProgress;
};
public:
Gestures() : listener(0), dragThresholdValue(0) { }
void registerEventListener(UIEventListener& l);
void tick();
bool registerDragEvent(uint16_t oldX, uint16_t oldY, uint16_t newX, uint16_t newY);
void registerClickEvent(ClickEvent::ClickEventType evt, uint16_t x, uint16_t y);
void setDragThreshold(uint16_t val)
{
dragThresholdValue = val;
}
private:
DragState drag;
UIEventListener* listener;
uint16_t dragThresholdValue;
};