summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHenrik Rydberg <rydberg@euromail.se>2010-09-21 11:14:00 +0200
committerHenrik Rydberg <rydberg@euromail.se>2010-09-21 12:56:17 +0200
commit07e097727f7bba8afc1abe29b1660a253ac64dad (patch)
treeea92d6a62cf3f63674f758f7d14a3be0635acb6e /src
parentd9a9cafc00cf1ccfeb72c9d86644144687884ef4 (diff)
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 <rydberg@euromail.se>
Diffstat (limited to 'src')
-rw-r--r--src/gestures-tapping.c2
-rw-r--r--src/grail-gestures.h2
2 files changed, 3 insertions, 1 deletions
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,
46 struct tapping_model *state = &gru->tapping; 46 struct tapping_model *state = &gru->tapping;
47 struct move_model *move = &gru->move; 47 struct move_model *move = &gru->move;
48 grail_time_t up = move->time - state->end; 48 grail_time_t up = move->time - state->end;
49 state->tap = 0;
49 if (move->ntouch && move->ntouch < state->mintouch) 50 if (move->ntouch && move->ntouch < state->mintouch)
50 state->end = move->time; 51 state->end = move->time;
51 if (move->ntouch > state->maxtouch) { 52 if (move->ntouch > state->maxtouch) {
@@ -80,6 +81,7 @@ int gru_tapping(struct grail *ge,
80 state->active = 0; 81 state->active = 0;
81 return 0; 82 return 0;
82 } 83 }
84 state->tap = state->maxtouch;
83 state->prop[GRAIL_PROP_TAP_DT] = t; 85 state->prop[GRAIL_PROP_TAP_DT] = t;
84 gin_gid_event(ge, state->gid, x, y, state->maxtouch, 86 gin_gid_event(ge, state->gid, x, y, state->maxtouch,
85 state->prop, state->nprop, 1); 87 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,
99struct tapping_model { 99struct tapping_model {
100 grail_time_t start, end; 100 grail_time_t start, end;
101 int mintouch, maxtouch; 101 int mintouch, maxtouch;
102 int active, gid; 102 int active, gid, tap;
103 int nprop; 103 int nprop;
104 grail_prop_t prop[DIM_GRAIL_PROP]; 104 grail_prop_t prop[DIM_GRAIL_PROP];
105}; 105};