mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-07 05:35:02 -05:00
touchscreen: Add gesture velocity helper
Add a helper for computing the motion velocity during a touchscreen press. Change-Id: I1ef7452ba9815897fd3ec01f8980c89aeef5418f
This commit is contained in:
parent
7aa823215b
commit
bb1e0b48a0
2 changed files with 76 additions and 0 deletions
|
|
@ -120,4 +120,18 @@ static inline bool gesture_is_pressed(struct gesture *g)
|
|||
return !!(g->flags & GESTURE_F_PRESSED);
|
||||
}
|
||||
|
||||
/* Helper for computing velocity vectors */
|
||||
struct gesture_vel
|
||||
{
|
||||
size_t idx;
|
||||
size_t cnt;
|
||||
short xsamp[4];
|
||||
short ysamp[4];
|
||||
long tsamp[4];
|
||||
};
|
||||
|
||||
void gesture_vel_reset(struct gesture_vel *gv);
|
||||
void gesture_vel_process(struct gesture_vel *gv, const struct touchevent *ev);
|
||||
bool gesture_vel_get(struct gesture_vel *gv, int *xvel, int *yvel);
|
||||
|
||||
#endif /* _GESTURE_H_ */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue