diff options
| author | Henrik Rydberg <rydberg@euromail.se> | 2010-08-07 18:28:29 +0200 |
|---|---|---|
| committer | Henrik Rydberg <rydberg@euromail.se> | 2010-08-07 18:28:29 +0200 |
| commit | ee4a0c6821a1b79c3d18c6ef6d7ed6d37df74755 (patch) | |
| tree | 6516f6f92f572a60eca0fe6a43bc93a7f9570a2c /src/gestures-tapping.c | |
| parent | 5b1126b08faa91bbe26d89c63e5c514911088a0a (diff) | |
gesture: Improved tickle/active logic
Reorganize the mode model to use bitmasks for tickle and active,
and refine the tickle logic for each gesture.
Diffstat (limited to 'src/gestures-tapping.c')
| -rw-r--r-- | src/gestures-tapping.c | 6 |
1 files changed, 4 insertions, 2 deletions
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; | |||
| 30 | static const int TAP_MIN_GAP_MS = 25; | 30 | static const int TAP_MIN_GAP_MS = 25; |
| 31 | static const int TAP_MAX_GAP_MS = 300; | 31 | static const int TAP_MAX_GAP_MS = 300; |
| 32 | 32 | ||
| 33 | static const int fm_mask = 0x03; | ||
| 34 | |||
| 33 | int gru_tapping(struct grail *ge, | 35 | int gru_tapping(struct grail *ge, |
| 34 | const struct touch_frame *frame) | 36 | const struct touch_frame *frame) |
| 35 | { | 37 | { |
| @@ -69,7 +71,7 @@ int gru_tapping(struct grail *ge, | |||
| 69 | if (state->status == TAP_END && | 71 | if (state->status == TAP_END && |
| 70 | move->time - state->start < TAP_MIN_GAP_MS) | 72 | move->time - state->start < TAP_MIN_GAP_MS) |
| 71 | state->status = TAP_CANCEL; | 73 | state->status = TAP_CANCEL; |
| 72 | if (move->x.active || move->y.active) | 74 | if (move->active & fm_mask) |
| 73 | state->status = TAP_CANCEL; | 75 | state->status = TAP_CANCEL; |
| 74 | if (state->status == TAP_CANCEL) { | 76 | if (state->status == TAP_CANCEL) { |
| 75 | if (state->active) { | 77 | if (state->active) { |
| @@ -84,7 +86,7 @@ int gru_tapping(struct grail *ge, | |||
| 84 | return 0; | 86 | return 0; |
| 85 | prop[0] = move->time - state->start; | 87 | prop[0] = move->time - state->start; |
| 86 | gin_gid_event(ge, state->gid, | 88 | gin_gid_event(ge, state->gid, |
| 87 | move->x.val, move->y.val, state->ntouch, | 89 | move->fm[FM_X].val, move->fm[FM_Y].val, state->ntouch, |
| 88 | prop, 1, GRAIL_STATUS_END); | 90 | prop, 1, GRAIL_STATUS_END); |
| 89 | state->status = TAP_BEGIN; | 91 | state->status = TAP_BEGIN; |
| 90 | state->ntouch = 0; | 92 | state->ntouch = 0; |
