diff options
| -rw-r--r-- | src/gestures-tapping.c | 9 | ||||
| -rw-r--r-- | src/grail-gestures.h | 2 |
2 files changed, 2 insertions, 9 deletions
diff --git a/src/gestures-tapping.c b/src/gestures-tapping.c index 6d71642..9abb6dc 100644 --- a/src/gestures-tapping.c +++ b/src/gestures-tapping.c | |||
| @@ -23,9 +23,6 @@ | |||
| 23 | #include "grail-recognizer.h" | 23 | #include "grail-recognizer.h" |
| 24 | #include <math.h> | 24 | #include <math.h> |
| 25 | 25 | ||
| 26 | static const int TAP_MIN_GAP_MS = 25; | ||
| 27 | static const int TAP_MIN_UP_MS = 200; | ||
| 28 | |||
| 29 | static const int fm_mask = 0x07; | 26 | static const int fm_mask = 0x07; |
| 30 | 27 | ||
| 31 | static void set_props(const struct gesture_inserter *gin, | 28 | static void set_props(const struct gesture_inserter *gin, |
| @@ -45,10 +42,7 @@ int gru_tapping(struct grail *ge, | |||
| 45 | struct gesture_recognizer *gru = ge->gru; | 42 | struct gesture_recognizer *gru = ge->gru; |
| 46 | struct tapping_model *state = &gru->tapping; | 43 | struct tapping_model *state = &gru->tapping; |
| 47 | struct move_model *move = &gru->move; | 44 | struct move_model *move = &gru->move; |
| 48 | grail_time_t up = move->time - state->end; | ||
| 49 | state->tap = 0; | 45 | state->tap = 0; |
| 50 | if (move->ntouch && move->ntouch < state->mintouch) | ||
| 51 | state->end = move->time; | ||
| 52 | if (move->ntouch > state->maxtouch) { | 46 | if (move->ntouch > state->maxtouch) { |
| 53 | if (state->active) { | 47 | if (state->active) { |
| 54 | gin_gid_discard(ge, state->gid); | 48 | gin_gid_discard(ge, state->gid); |
| @@ -73,8 +67,7 @@ int gru_tapping(struct grail *ge, | |||
| 73 | int x = state->prop[GRAIL_PROP_TAP_X]; | 67 | int x = state->prop[GRAIL_PROP_TAP_X]; |
| 74 | int y = state->prop[GRAIL_PROP_TAP_Y]; | 68 | int y = state->prop[GRAIL_PROP_TAP_Y]; |
| 75 | int t = move->time - state->start; | 69 | int t = move->time - state->start; |
| 76 | if (t < TAP_MIN_GAP_MS || t > move->fm[FM_X].bar_ms || | 70 | if (t > move->fm[FM_X].bar_ms) { |
| 77 | up < TAP_MIN_UP_MS) { | ||
| 78 | gin_gid_discard(ge, state->gid); | 71 | gin_gid_discard(ge, state->gid); |
| 79 | state->mintouch = move->ntouch; | 72 | state->mintouch = move->ntouch; |
| 80 | state->maxtouch = move->ntouch; | 73 | state->maxtouch = move->ntouch; |
diff --git a/src/grail-gestures.h b/src/grail-gestures.h index 69dd7e4..a6d51d5 100644 --- a/src/grail-gestures.h +++ b/src/grail-gestures.h | |||
| @@ -97,7 +97,7 @@ int gru_winrotate(struct grail *ge, | |||
| 97 | const struct utouch_frame *frame); | 97 | const struct utouch_frame *frame); |
| 98 | 98 | ||
| 99 | struct tapping_model { | 99 | struct tapping_model { |
| 100 | grail_time_t start, end; | 100 | grail_time_t start; |
| 101 | int mintouch, maxtouch; | 101 | int mintouch, maxtouch; |
| 102 | int active, gid, tap; | 102 | int active, gid, tap; |
| 103 | int nprop; | 103 | int nprop; |
