diff options
| -rw-r--r-- | driver/multitouch.c | 8 | ||||
| -rw-r--r-- | include/gestures.h | 2 | ||||
| -rw-r--r-- | src/gestures.c | 4 |
3 files changed, 14 insertions, 0 deletions
diff --git a/driver/multitouch.c b/driver/multitouch.c index 99f1484..a083adc 100644 --- a/driver/multitouch.c +++ b/driver/multitouch.c | |||
| @@ -261,6 +261,14 @@ static void handle_gestures(LocalDevicePtr local, | |||
| 261 | foreach_bit(i, gs->tapmask) | 261 | foreach_bit(i, gs->tapmask) |
| 262 | tickle_button(local, i + 1); | 262 | tickle_button(local, i + 1); |
| 263 | } | 263 | } |
| 264 | if (GETBIT(gs->type, GS_VSWIPE4)) { | ||
| 265 | int step = 1 + vswipe_fraction * get_cap_ysize(caps); | ||
| 266 | button_scroll(local, 16, 17, &vswipe, step, gs->dy); | ||
| 267 | } | ||
| 268 | if (GETBIT(gs->type, GS_HSWIPE4)) { | ||
| 269 | int step = 1 + hswipe_fraction * get_cap_xsize(caps); | ||
| 270 | button_scroll(local, 18, 19, &hswipe, step, gs->dx); | ||
| 271 | } | ||
| 264 | } | 272 | } |
| 265 | 273 | ||
| 266 | /* called for each full received packet from the touchpad */ | 274 | /* called for each full received packet from the touchpad */ |
diff --git a/include/gestures.h b/include/gestures.h index 6bc92cd..b512121 100644 --- a/include/gestures.h +++ b/include/gestures.h | |||
| @@ -33,6 +33,8 @@ | |||
| 33 | #define GS_SCALE 6 | 33 | #define GS_SCALE 6 |
| 34 | #define GS_ROTATE 7 | 34 | #define GS_ROTATE 7 |
| 35 | #define GS_TAP 8 | 35 | #define GS_TAP 8 |
| 36 | #define GS_VSWIPE4 9 | ||
| 37 | #define GS_HSWIPE4 10 | ||
| 36 | 38 | ||
| 37 | struct Gestures { | 39 | struct Gestures { |
| 38 | bitmask_t type, btmask, btdata; | 40 | bitmask_t type, btmask, btdata; |
diff --git a/src/gestures.c b/src/gestures.c index 735e77c..cc95e9b 100644 --- a/src/gestures.c +++ b/src/gestures.c | |||
| @@ -157,12 +157,16 @@ static void extract_movement(struct Gestures *gs, struct MTouch* mt) | |||
| 157 | SETBIT(gs->type, GS_HSCROLL); | 157 | SETBIT(gs->type, GS_HSCROLL); |
| 158 | if (nmove == 3) | 158 | if (nmove == 3) |
| 159 | SETBIT(gs->type, GS_HSWIPE); | 159 | SETBIT(gs->type, GS_HSWIPE); |
| 160 | if (nmove == 4) | ||
| 161 | SETBIT(gs->type, GS_HSWIPE4); | ||
| 160 | } | 162 | } |
| 161 | if (abs(gs->dy) > abs(gs->dx)) { | 163 | if (abs(gs->dy) > abs(gs->dx)) { |
| 162 | if (nmove == 2) | 164 | if (nmove == 2) |
| 163 | SETBIT(gs->type, GS_VSCROLL); | 165 | SETBIT(gs->type, GS_VSCROLL); |
| 164 | if (nmove == 3) | 166 | if (nmove == 3) |
| 165 | SETBIT(gs->type, GS_VSWIPE); | 167 | SETBIT(gs->type, GS_VSWIPE); |
| 168 | if (nmove == 4) | ||
| 169 | SETBIT(gs->type, GS_VSWIPE4); | ||
| 166 | } | 170 | } |
| 167 | } | 171 | } |
| 168 | } | 172 | } |
