summaryrefslogtreecommitdiff
path: root/src/gestures-tapping.c
diff options
context:
space:
mode:
authorHenrik Rydberg <rydberg@euromail.se>2010-08-10 16:48:39 +0100
committerHenrik Rydberg <rydberg@euromail.se>2010-08-10 16:49:40 +0100
commit11ce60e63da0c632e4c06e212a3add7d53cbf658 (patch)
tree1588c1619df235727a62d3d9f9713d94a0c73170 /src/gestures-tapping.c
parent33be41843e18b6a716ff62982e32c843e7a2bb1f (diff)
Make tapping position appear properly
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Diffstat (limited to 'src/gestures-tapping.c')
-rw-r--r--src/gestures-tapping.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/gestures-tapping.c b/src/gestures-tapping.c
index 0deacf8..52c5fdb 100644
--- a/src/gestures-tapping.c
+++ b/src/gestures-tapping.c
@@ -37,13 +37,19 @@ int gru_tapping(struct grail *ge,
37 struct gesture_recognizer *gru = ge->gru; 37 struct gesture_recognizer *gru = ge->gru;
38 struct tapping_model *state = &gru->tapping; 38 struct tapping_model *state = &gru->tapping;
39 struct move_model *move = &gru->move; 39 struct move_model *move = &gru->move;
40 grail_prop_t prop[DIM_GRAIL_PROP];
41 if (move->ntouch) { 40 if (move->ntouch) {
42 if (state->status == TAP_CANCEL) 41 if (state->status == TAP_CANCEL)
43 return 0; 42 return 0;
44 state->status = TAP_BEGIN; 43 state->status = TAP_BEGIN;
45 if (!state->ntouch) 44 if (!state->ntouch)
46 state->start = move->time; 45 state->start = move->time;
46 if (move->ntouch >= state->ntouch) {
47 state->prop[GRAIL_PROP_TAP_DT] =
48 move->time - state->start;
49 state->prop[GRAIL_PROP_TAP_X] = move->fm[FM_X].value;
50 state->prop[GRAIL_PROP_TAP_Y] = move->fm[FM_Y].value;
51 state->nprop = 3;
52 }
47 if (move->ntouch > state->ntouch) { 53 if (move->ntouch > state->ntouch) {
48 state->ntouch = move->ntouch; 54 state->ntouch = move->ntouch;
49 if (state->active) { 55 if (state->active) {
@@ -83,10 +89,11 @@ int gru_tapping(struct grail *ge,
83 if (state->status != TAP_END || 89 if (state->status != TAP_END ||
84 move->time - state->start < TAP_MIN_GAP_MS) 90 move->time - state->start < TAP_MIN_GAP_MS)
85 return 0; 91 return 0;
86 prop[GRAIL_PROP_TAP_DT] = move->time - state->start; 92 state->prop[GRAIL_PROP_TAP_DT] = move->time - state->start;
87 gin_gid_event(ge, state->gid, 93 gin_gid_event(ge, state->gid,
88 move->fm[FM_X].value, move->fm[FM_Y].value, state->ntouch, 94 state->prop[GRAIL_PROP_TAP_X],
89 prop, 1, 1); 95 state->prop[GRAIL_PROP_TAP_Y], state->ntouch,
96 state->prop, state->nprop, 1);
90 state->status = TAP_BEGIN; 97 state->status = TAP_BEGIN;
91 state->ntouch = 0; 98 state->ntouch = 0;
92 state->active = 0; 99 state->active = 0;