diff options
Diffstat (limited to 'src/gestures-tapping.c')
| -rw-r--r-- | src/gestures-tapping.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/gestures-tapping.c b/src/gestures-tapping.c index 52c5fdb..371dbde 100644 --- a/src/gestures-tapping.c +++ b/src/gestures-tapping.c | |||
| @@ -31,6 +31,17 @@ static const int TAP_MIN_GAP_MS = 25; | |||
| 31 | 31 | ||
| 32 | static const int fm_mask = 0x03; | 32 | static const int fm_mask = 0x03; |
| 33 | 33 | ||
| 34 | static void set_props(const struct gesture_inserter *gin, | ||
| 35 | struct tapping_model *s, const struct move_model *m, | ||
| 36 | const struct touch_frame *frame) | ||
| 37 | { | ||
| 38 | s->prop[GRAIL_PROP_TAP_DT] = m->time - s->start; | ||
| 39 | s->prop[GRAIL_PROP_TAP_X] = gin_prop_x(gin, m->fm[FM_X].value); | ||
| 40 | s->prop[GRAIL_PROP_TAP_Y] = gin_prop_y(gin, m->fm[FM_Y].value); | ||
| 41 | s->nprop = 3; | ||
| 42 | s->nprop += gin_add_contact_props(gin, s->prop + s->nprop, frame); | ||
| 43 | } | ||
| 44 | |||
| 34 | int gru_tapping(struct grail *ge, | 45 | int gru_tapping(struct grail *ge, |
| 35 | const struct touch_frame *frame) | 46 | const struct touch_frame *frame) |
| 36 | { | 47 | { |
| @@ -44,11 +55,7 @@ int gru_tapping(struct grail *ge, | |||
| 44 | if (!state->ntouch) | 55 | if (!state->ntouch) |
| 45 | state->start = move->time; | 56 | state->start = move->time; |
| 46 | if (move->ntouch >= state->ntouch) { | 57 | if (move->ntouch >= state->ntouch) { |
| 47 | state->prop[GRAIL_PROP_TAP_DT] = | 58 | set_props(ge->gin, state, move, frame); |
| 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 | } | 59 | } |
| 53 | if (move->ntouch > state->ntouch) { | 60 | if (move->ntouch > state->ntouch) { |
| 54 | state->ntouch = move->ntouch; | 61 | state->ntouch = move->ntouch; |
