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-xi2.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/frame-xi2.c') diff --git a/src/frame-xi2.c b/src/frame-xi2.c index a78d9bf..bead751 100644 --- a/src/frame-xi2.c +++ b/src/frame-xi2.c @@ -217,9 +217,11 @@ static int handle_event(utouch_frame_handle fh, switch (fh->evmap[ix]) { case ABS_MT_POSITION_X: slot->x = value; + slot->vx = 0; return 1; case ABS_MT_POSITION_Y: slot->y = value; + slot->vy = 0; return 1; case ABS_MT_TOUCH_MAJOR: slot->touch_major = value; -- cgit v1.2.3