From ee4a0c6821a1b79c3d18c6ef6d7ed6d37df74755 Mon Sep 17 00:00:00 2001 From: Henrik Rydberg Date: Sat, 7 Aug 2010 18:28:29 +0200 Subject: gesture: Improved tickle/active logic Reorganize the mode model to use bitmasks for tickle and active, and refine the tickle logic for each gesture. --- src/gestures-tapping.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/gestures-tapping.c') diff --git a/src/gestures-tapping.c b/src/gestures-tapping.c index a5357e4..1a02731 100644 --- a/src/gestures-tapping.c +++ b/src/gestures-tapping.c @@ -30,6 +30,8 @@ static const int TAP_CANCEL = 2; static const int TAP_MIN_GAP_MS = 25; static const int TAP_MAX_GAP_MS = 300; +static const int fm_mask = 0x03; + int gru_tapping(struct grail *ge, const struct touch_frame *frame) { @@ -69,7 +71,7 @@ int gru_tapping(struct grail *ge, if (state->status == TAP_END && move->time - state->start < TAP_MIN_GAP_MS) state->status = TAP_CANCEL; - if (move->x.active || move->y.active) + if (move->active & fm_mask) state->status = TAP_CANCEL; if (state->status == TAP_CANCEL) { if (state->active) { @@ -84,7 +86,7 @@ int gru_tapping(struct grail *ge, return 0; prop[0] = move->time - state->start; gin_gid_event(ge, state->gid, - move->x.val, move->y.val, state->ntouch, + move->fm[FM_X].val, move->fm[FM_Y].val, state->ntouch, prop, 1, GRAIL_STATUS_END); state->status = TAP_BEGIN; state->ntouch = 0; -- cgit v1.2.3