aboutsummaryrefslogtreecommitdiffstats
path: root/src/memory.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/memory.c
parentc620cb1319093dca0f0241c04c4c227a40577bdc (diff)
downloadxorg-input-kobomultitouch-31a96545e433128af34f08a0bb993bbc54e90df1.tar.gz
xorg-input-kobomultitouch-31a96545e433128af34f08a0bb993bbc54e90df1.tar.bz2
xorg-input-kobomultitouch-31a96545e433128af34f08a0bb993bbc54e90df1.zip
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/memory.c')
-rw-r--r--src/memory.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/memory.c b/src/memory.c
index 7d8cda8..9084502 100644
--- a/src/memory.c
+++ b/src/memory.c
@@ -46,11 +46,11 @@ void init_memory(struct Memory *mem)
/**
* update_configuration
*
- * Update the same, fingers, added memory variables.
+ * Update the same, fingers, added, and thumb memory variables.
*
* Precondition: none
*
- * Postcondition: same, fingers, added are set
+ * Postcondition: same, fingers, added, thumb are set
*
*/
static void update_configuration(struct Memory *m,
@@ -66,6 +66,11 @@ static void update_configuration(struct Memory *m,
SETBIT(m->added, i);
m->same = m->fingers == fingers && m->added == 0;
m->fingers = fingers;
+ if (!m->same)
+ m->thumb = 0;
+ foreach_bit(i, fingers)
+ if (f[i].thumb)
+ SETBIT(m->thumb, i);
}
/**
@@ -73,7 +78,7 @@ static void update_configuration(struct Memory *m,
*
* Update the pointing and ybar memory variables.
*
- * Precondition: fingers, added are set
+ * Precondition: fingers, added, thumb are set
*
* Postcondition: pointing, ybar are set
*
@@ -121,7 +126,7 @@ static void update_pointers(struct Memory *m,
* When moving is nonzero, gestures can be extracted from the dx and dy
* variables. These variables should be cleared after use.
*
- * Precondition: fingers, added, pointing are set
+ * Precondition: fingers, added, thumb, pointing are set
*
* Postcondition: pending, moving, mvhold, mvforget, dx, dy are set
*