From d619da633517175ffa6977a80760673628f91583 Mon Sep 17 00:00:00 2001 From: Henrik Rydberg Date: Wed, 16 Feb 2011 18:20:14 +0100 Subject: 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 --- src/frame-mtdev.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/frame-mtdev.c') 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, return 1; case ABS_MT_POSITION_X: t->x = ev->value; + t->vx = 0; return 1; case ABS_MT_POSITION_Y: t->y = ev->value; + t->vy = 0; return 1; case ABS_MT_TOUCH_MAJOR: t->touch_major = ev->value; -- cgit v1.2.3