diff options
Diffstat (limited to 'src/gestures-tapping.c')
| -rw-r--r-- | src/gestures-tapping.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/gestures-tapping.c b/src/gestures-tapping.c index 8727639..5474731 100644 --- a/src/gestures-tapping.c +++ b/src/gestures-tapping.c | |||
| @@ -24,6 +24,7 @@ | |||
| 24 | #include <math.h> | 24 | #include <math.h> |
| 25 | 25 | ||
| 26 | static const int TAP_MIN_GAP_MS = 25; | 26 | static const int TAP_MIN_GAP_MS = 25; |
| 27 | static const int TAP_MIN_UP_MS = 200; | ||
| 27 | 28 | ||
| 28 | static const int fm_mask = 0x07; | 29 | static const int fm_mask = 0x07; |
| 29 | 30 | ||
| @@ -44,6 +45,9 @@ int gru_tapping(struct grail *ge, | |||
| 44 | struct gesture_recognizer *gru = ge->gru; | 45 | struct gesture_recognizer *gru = ge->gru; |
| 45 | struct tapping_model *state = &gru->tapping; | 46 | struct tapping_model *state = &gru->tapping; |
| 46 | struct move_model *move = &gru->move; | 47 | struct move_model *move = &gru->move; |
| 48 | grail_time_t up = move->time - state->end; | ||
| 49 | if (move->ntouch && move->ntouch < state->ntouch) | ||
| 50 | state->end = move->time; | ||
| 47 | if (move->ntouch > state->ntouch) { | 51 | if (move->ntouch > state->ntouch) { |
| 48 | if (state->active) { | 52 | if (state->active) { |
| 49 | gin_gid_discard(ge, state->gid); | 53 | gin_gid_discard(ge, state->gid); |
| @@ -67,7 +71,8 @@ int gru_tapping(struct grail *ge, | |||
| 67 | int x = state->prop[GRAIL_PROP_TAP_X]; | 71 | int x = state->prop[GRAIL_PROP_TAP_X]; |
| 68 | int y = state->prop[GRAIL_PROP_TAP_Y]; | 72 | int y = state->prop[GRAIL_PROP_TAP_Y]; |
| 69 | int t = move->time - state->start; | 73 | int t = move->time - state->start; |
| 70 | if (t < TAP_MIN_GAP_MS || t > move->fm[FM_X].bar_ms) { | 74 | if (t < TAP_MIN_GAP_MS || t > move->fm[FM_X].bar_ms || |
| 75 | up < TAP_MIN_UP_MS) { | ||
| 71 | gin_gid_discard(ge, state->gid); | 76 | gin_gid_discard(ge, state->gid); |
| 72 | state->ntouch = move->ntouch; | 77 | state->ntouch = move->ntouch; |
| 73 | state->active = 0; | 78 | state->active = 0; |
