printq("\n");
}
-static void
-print_touch_event_without_coords(struct libinput_event *ev)
-{
- struct libinput_event_touch *t = libinput_event_get_touch_event(ev);
-
- print_event_time(libinput_event_touch_get_time(t));
- printq("\n");
-}
-
static void
print_proximity_event(struct libinput_event *ev)
{
}
static void
-print_touch_event_with_coords(struct libinput_event *ev)
+print_touch_event(struct libinput_event *ev)
{
struct libinput_event_touch *t = libinput_event_get_touch_event(ev);
- double x = libinput_event_touch_get_x_transformed(t, screen_width);
- double y = libinput_event_touch_get_y_transformed(t, screen_height);
- double xmm = libinput_event_touch_get_x(t);
- double ymm = libinput_event_touch_get_y(t);
+ enum libinput_event_type type = libinput_event_get_type(ev);
print_event_time(libinput_event_touch_get_time(t));
- printq("%d (%d) %5.2f/%5.2f (%5.2f/%5.2fmm)\n",
- libinput_event_touch_get_slot(t),
- libinput_event_touch_get_seat_slot(t),
- x, y,
- xmm, ymm);
+ if (type != LIBINPUT_EVENT_TOUCH_FRAME) {
+ printq("%d (%d)",
+ libinput_event_touch_get_slot(t),
+ libinput_event_touch_get_seat_slot(t));
+ }
+
+ if (type == LIBINPUT_EVENT_TOUCH_DOWN ||
+ type == LIBINPUT_EVENT_TOUCH_MOTION) {
+ double x = libinput_event_touch_get_x_transformed(t, screen_width);
+ double y = libinput_event_touch_get_y_transformed(t, screen_height);
+ double xmm = libinput_event_touch_get_x(t);
+ double ymm = libinput_event_touch_get_y(t);
+
+ printq(" %5.2f/%5.2f (%5.2f/%5.2fmm)", x, y, xmm, ymm);
+ }
+
+ printq("\n");
}
static void
print_pointer_axis_event(ev);
break;
case LIBINPUT_EVENT_TOUCH_DOWN:
- print_touch_event_with_coords(ev);
- break;
case LIBINPUT_EVENT_TOUCH_MOTION:
- print_touch_event_with_coords(ev);
- break;
case LIBINPUT_EVENT_TOUCH_UP:
- print_touch_event_without_coords(ev);
- break;
case LIBINPUT_EVENT_TOUCH_CANCEL:
- print_touch_event_without_coords(ev);
- break;
case LIBINPUT_EVENT_TOUCH_FRAME:
- print_touch_event_without_coords(ev);
+ print_touch_event(ev);
break;
case LIBINPUT_EVENT_GESTURE_SWIPE_BEGIN:
print_gesture_event_without_coords(ev);