diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2017-04-26 14:40:11 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2017-04-28 15:37:00 +1000 |
commit | ea4332a6cf84bad73adc8f61da027ca2591105ec (patch) | |
tree | b54f2fd085f5b5606eecdb9bbba9ca52a80a7f9f | |
parent | 691aea6d060834f233c6fb29d81b1e9610728545 (diff) |
touchpad: add touch state debugging helper
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r-- | src/evdev-mt-touchpad.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/evdev-mt-touchpad.c b/src/evdev-mt-touchpad.c index 54a3c8e..a2cdf43 100644 --- a/src/evdev-mt-touchpad.c +++ b/src/evdev-mt-touchpad.c @@ -1268,6 +1268,28 @@ tp_handle_state(struct tp_dispatch *tp, 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 tp_interface_process(struct evdev_dispatch *dispatch, struct evdev_device *device, @@ -1291,6 +1313,9 @@ tp_interface_process(struct evdev_dispatch *dispatch, break; case EV_SYN: tp_handle_state(tp, time); +#if 0 + tp_debug_touch_state(tp, device); +#endif break; } } |