From 07e097727f7bba8afc1abe29b1660a253ac64dad Mon Sep 17 00:00:00 2001 From: Henrik Rydberg Date: Tue, 21 Sep 2010 11:14:00 +0200 Subject: Add tap state to the tapping model Add the ability to read off the tap state in the tapping model. Useful for emulation i lieu of tapping gestures. Signed-off-by: Henrik Rydberg --- src/gestures-tapping.c | 2 ++ src/grail-gestures.h | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/gestures-tapping.c b/src/gestures-tapping.c index cb30168..aa8e6d6 100644 --- a/src/gestures-tapping.c +++ b/src/gestures-tapping.c @@ -46,6 +46,7 @@ int gru_tapping(struct grail *ge, struct tapping_model *state = &gru->tapping; struct move_model *move = &gru->move; grail_time_t up = move->time - state->end; + state->tap = 0; if (move->ntouch && move->ntouch < state->mintouch) state->end = move->time; if (move->ntouch > state->maxtouch) { @@ -80,6 +81,7 @@ int gru_tapping(struct grail *ge, state->active = 0; return 0; } + state->tap = state->maxtouch; state->prop[GRAIL_PROP_TAP_DT] = t; gin_gid_event(ge, state->gid, x, y, state->maxtouch, state->prop, state->nprop, 1); diff --git a/src/grail-gestures.h b/src/grail-gestures.h index 36d8e78..27108e9 100644 --- a/src/grail-gestures.h +++ b/src/grail-gestures.h @@ -99,7 +99,7 @@ int gru_winrotate(struct grail *ge, struct tapping_model { grail_time_t start, end; int mintouch, maxtouch; - int active, gid; + int active, gid, tap; int nprop; grail_prop_t prop[DIM_GRAIL_PROP]; }; -- cgit v1.2.3