mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2026-05-05 19:18:03 +02:00
touchpad: add touch state debugging helper
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
691aea6d06
commit
ea4332a6cf
1 changed files with 25 additions and 0 deletions
|
|
@ -1268,6 +1268,28 @@ tp_handle_state(struct tp_dispatch *tp,
|
||||||
tp_clickpad_middlebutton_apply_config(tp->device);
|
tp_clickpad_middlebutton_apply_config(tp->device);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline void
|
||||||
|
tp_debug_touch_state(struct tp_dispatch *tp,
|
||||||
|
struct evdev_device *device)
|
||||||
|
{
|
||||||
|
char buf[1024] = {0};
|
||||||
|
struct tp_touch *t;
|
||||||
|
size_t i = 0;
|
||||||
|
|
||||||
|
tp_for_each_touch(tp, t) {
|
||||||
|
if (i >= tp->nfingers_down)
|
||||||
|
break;
|
||||||
|
sprintf(&buf[strlen(buf)],
|
||||||
|
"slot %zd: %04d/%04d p%03d %s |",
|
||||||
|
i++,
|
||||||
|
t->point.x,
|
||||||
|
t->point.y,
|
||||||
|
t->pressure,
|
||||||
|
tp_touch_active(tp, t) ? "" : "inactive");
|
||||||
|
}
|
||||||
|
evdev_log_debug(device, "touch state: %s\n", buf);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
tp_interface_process(struct evdev_dispatch *dispatch,
|
tp_interface_process(struct evdev_dispatch *dispatch,
|
||||||
struct evdev_device *device,
|
struct evdev_device *device,
|
||||||
|
|
@ -1291,6 +1313,9 @@ tp_interface_process(struct evdev_dispatch *dispatch,
|
||||||
break;
|
break;
|
||||||
case EV_SYN:
|
case EV_SYN:
|
||||||
tp_handle_state(tp, time);
|
tp_handle_state(tp, time);
|
||||||
|
#if 0
|
||||||
|
tp_debug_touch_state(tp, device);
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue