From 2e51d27cf6e1380e7bf4744215bf16243af2829d Mon Sep 17 00:00:00 2001 From: Henrik Rydberg Date: Wed, 14 Apr 2010 16:07:17 +0200 Subject: Define swipe gestures Define three-finger vertical and horizontal scroll as vertical and horizontal swipe gestures. Signed-off-by: Henrik Rydberg --- src/gestures.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'src/gestures.c') diff --git a/src/gestures.c b/src/gestures.c index fb81576..d075356 100644 --- a/src/gestures.c +++ b/src/gestures.c @@ -90,10 +90,18 @@ static void extract_type(struct Gestures *gs, struct MTouch* mt) if (gs->dx || gs->dy) { if (mt->state.nfinger == 1) SETBIT(gs->type, GS_MOVE); - if (mt->state.nfinger == 2) - SETBIT(gs->type, GS_VSCROLL); - if (mt->state.nfinger == 3) - SETBIT(gs->type, GS_HSCROLL); + if (mt->state.nfinger == 2) { + if (gs->dx) + SETBIT(gs->type, GS_HSCROLL); + if (gs->dy) + SETBIT(gs->type, GS_VSCROLL); + } + if (mt->state.nfinger == 3) { + if (gs->dx) + SETBIT(gs->type, GS_HSWIPE); + if (gs->dy) + SETBIT(gs->type, GS_VSWIPE); + } } } -- cgit v1.2.3