summaryrefslogtreecommitdiff
path: root/src/frame-mtdev.c
diff options
context:
space:
mode:
authorHenrik Rydberg <rydberg@euromail.se>2011-02-16 18:20:14 +0100
committerHenrik Rydberg <rydberg@euromail.se>2011-02-16 18:20:14 +0100
commitd619da633517175ffa6977a80760673628f91583 (patch)
tree42bddbfbd1b69dcaa8aaf82a6709f21b00e26efb /src/frame-mtdev.c
parent7864e778cc10dbc2b0064f0f1953ef5389f0d68b (diff)
Add velocity estimate
The per-touch velocity is useful in many contexts. This patch adds a simple estimator of the velocity, which also smooths out position jumps caused by course-grained event updates. Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Diffstat (limited to 'src/frame-mtdev.c')
-rw-r--r--src/frame-mtdev.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/frame-mtdev.c b/src/frame-mtdev.c
index caf90ae..1d9976d 100644
--- a/src/frame-mtdev.c
+++ b/src/frame-mtdev.c
@@ -154,9 +154,11 @@ static int handle_abs_event(utouch_frame_handle fh,
154 return 1; 154 return 1;
155 case ABS_MT_POSITION_X: 155 case ABS_MT_POSITION_X:
156 t->x = ev->value; 156 t->x = ev->value;
157 t->vx = 0;
157 return 1; 158 return 1;
158 case ABS_MT_POSITION_Y: 159 case ABS_MT_POSITION_Y:
159 t->y = ev->value; 160 t->y = ev->value;
161 t->vy = 0;
160 return 1; 162 return 1;
161 case ABS_MT_TOUCH_MAJOR: 163 case ABS_MT_TOUCH_MAJOR:
162 t->touch_major = ev->value; 164 t->touch_major = ev->value;