summaryrefslogtreecommitdiff
path: root/src/gestures.c
diff options
context:
space:
mode:
authorHenrik Rydberg <rydberg@euromail.se>2010-05-13 23:21:37 +0200
committerHenrik Rydberg <rydberg@euromail.se>2010-05-14 01:41:39 +0200
commit31a96545e433128af34f08a0bb993bbc54e90df1 (patch)
tree8b352a2eb50d7a054867112f94f93689f51a1cc4 /src/gestures.c
parentc620cb1319093dca0f0241c04c4c227a40577bdc (diff)
Disable motion with resting thumbs
Disable motion gestures whenever one of the pointing fingers is a thumb. Movement is skipped rather than held, minimizing unpredictable movement after thumb release. Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Diffstat (limited to 'src/gestures.c')
-rw-r--r--src/gestures.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/gestures.c b/src/gestures.c
index b6c3bf4..d061f93 100644
--- a/src/gestures.c
+++ b/src/gestures.c
@@ -25,6 +25,7 @@
25 25
26#include "gestures.h" 26#include "gestures.h"
27 27
28static const int FINGER_THUMB_MS = 400;
28/** 29/**
29 * extract_buttons 30 * extract_buttons
30 * 31 *
@@ -83,11 +84,19 @@ static void extract_movement(struct Gestures *gs, struct MTouch* mt)
83 ymove /= nmove; 84 ymove /= nmove;
84 85
85 if (nmove == 1) { 86 if (nmove == 1) {
87 if (mt->mem.moving & mt->mem.thumb) {
88 mt_skip_movement(mt, FINGER_THUMB_MS);
89 return;
90 }
86 gs->dx = xmove; 91 gs->dx = xmove;
87 gs->dy = ymove; 92 gs->dy = ymove;
88 if (gs->dx || gs->dy) 93 if (gs->dx || gs->dy)
89 SETBIT(gs->type, GS_MOVE); 94 SETBIT(gs->type, GS_MOVE);
90 } else { 95 } else {
96 if (mt->mem.moving & mt->mem.thumb) {
97 mt_skip_movement(mt, FINGER_THUMB_MS);
98 return;
99 }
91 gs->dx = xmove; 100 gs->dx = xmove;
92 gs->dy = ymove; 101 gs->dy = ymove;
93 if (abs(gs->dx) > abs(gs->dy)) { 102 if (abs(gs->dx) > abs(gs->dy)) {