mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2026-01-06 09:30:11 +01:00
touchpad: add helper function to reset a thumb's state
Extracted from Matt Mayfield's thumb detection patches. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
c2331ae11e
commit
117ef65087
3 changed files with 10 additions and 1 deletions
|
|
@ -62,6 +62,12 @@ tp_thumb_set_state(struct tp_dispatch *tp,
|
|||
t->thumb.state = state;
|
||||
}
|
||||
|
||||
void
|
||||
tp_thumb_reset(struct tp_dispatch *tp, struct tp_touch *t)
|
||||
{
|
||||
t->thumb.state = THUMB_STATE_MAYBE;
|
||||
}
|
||||
|
||||
void
|
||||
tp_thumb_detect(struct tp_dispatch *tp, struct tp_touch *t, uint64_t time)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -353,7 +353,7 @@ tp_begin_touch(struct tp_dispatch *tp, struct tp_touch *t, uint64_t time)
|
|||
t->was_down = true;
|
||||
tp->nfingers_down++;
|
||||
t->palm.time = time;
|
||||
t->thumb.state = THUMB_STATE_MAYBE;
|
||||
tp_thumb_reset(tp, t);
|
||||
t->thumb.first_touch_time = time;
|
||||
t->tap.is_thumb = false;
|
||||
t->tap.is_palm = false;
|
||||
|
|
|
|||
|
|
@ -684,6 +684,9 @@ tp_clickpad_middlebutton_apply_config(struct evdev_device *device);
|
|||
bool
|
||||
tp_thumb_ignored(const struct tp_dispatch *tp, const struct tp_touch *t);
|
||||
|
||||
void
|
||||
tp_thumb_reset(struct tp_dispatch *tp, struct tp_touch *t);
|
||||
|
||||
void
|
||||
tp_thumb_detect(struct tp_dispatch *tp, struct tp_touch *t, uint64_t time);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue