diff options
| author | Henrik Rydberg <rydberg@euromail.se> | 2011-02-16 18:20:14 +0100 |
|---|---|---|
| committer | Henrik Rydberg <rydberg@euromail.se> | 2011-02-16 18:20:14 +0100 |
| commit | d619da633517175ffa6977a80760673628f91583 (patch) | |
| tree | 42bddbfbd1b69dcaa8aaf82a6709f21b00e26efb /src/frame-xi2.c | |
| parent | 7864e778cc10dbc2b0064f0f1953ef5389f0d68b (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-xi2.c')
| -rw-r--r-- | src/frame-xi2.c | 2 |
1 files changed, 2 insertions, 0 deletions
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, | |||
| 217 | switch (fh->evmap[ix]) { | 217 | switch (fh->evmap[ix]) { |
| 218 | case ABS_MT_POSITION_X: | 218 | case ABS_MT_POSITION_X: |
| 219 | slot->x = value; | 219 | slot->x = value; |
| 220 | slot->vx = 0; | ||
| 220 | return 1; | 221 | return 1; |
| 221 | case ABS_MT_POSITION_Y: | 222 | case ABS_MT_POSITION_Y: |
| 222 | slot->y = value; | 223 | slot->y = value; |
| 224 | slot->vy = 0; | ||
| 223 | return 1; | 225 | return 1; |
| 224 | case ABS_MT_TOUCH_MAJOR: | 226 | case ABS_MT_TOUCH_MAJOR: |
| 225 | slot->touch_major = value; | 227 | slot->touch_major = value; |
