Rename KEYBOARD_KEY_STATE to KEY_STATE
[platform/upstream/libinput.git] / tools / event-debug.c
index e41da05..eb43e05 100644 (file)
@@ -231,23 +231,29 @@ print_device_notify(struct libinput_event *ev)
 {
        struct libinput_device *dev = libinput_event_get_device(ev);
        struct libinput_seat *seat = libinput_device_get_seat(dev);
+       double w, h;
 
-       printf("%s      %s\n",
+       printf("%s      %s",
               libinput_seat_get_physical_name(seat),
               libinput_seat_get_logical_name(seat));
+
+       if (libinput_device_get_size(dev, &w, &h) == 0)
+               printf("\tsize %.2f/%.2fmm", w, h);
+
+       printf("\n");
 }
 
 static void
 print_key_event(struct libinput_event *ev)
 {
        struct libinput_event_keyboard *k = libinput_event_get_keyboard_event(ev);
-       enum libinput_keyboard_key_state state;
+       enum libinput_key_state state;
 
        print_event_time(libinput_event_keyboard_get_time(k));
        state = libinput_event_keyboard_get_key_state(k);
        printf("%d %s\n",
               libinput_event_keyboard_get_key(k),
-              state == LIBINPUT_KEYBOARD_KEY_STATE_PRESSED ? "pressed" : "released");
+              state == LIBINPUT_KEY_STATE_PRESSED ? "pressed" : "released");
 }
 
 static void
@@ -279,14 +285,14 @@ static void
 print_button_event(struct libinput_event *ev)
 {
        struct libinput_event_pointer *p = libinput_event_get_pointer_event(ev);
-       enum libinput_pointer_button_state state;
+       enum libinput_button_state state;
 
        print_event_time(libinput_event_pointer_get_time(p));
 
        state = libinput_event_pointer_get_button_state(p);
        printf("%3d %s, seat count: %u\n",
               libinput_event_pointer_get_button(p),
-              state == LIBINPUT_POINTER_BUTTON_STATE_PRESSED ? "pressed" : "released",
+              state == LIBINPUT_BUTTON_STATE_PRESSED ? "pressed" : "released",
               libinput_event_pointer_get_seat_button_count(p));
 }
 
@@ -299,10 +305,10 @@ print_axis_event(struct libinput_event *ev)
        double val;
 
        switch (axis) {
-       case LIBINPUT_POINTER_AXIS_VERTICAL_SCROLL:
+       case LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL:
                ax = "vscroll";
                break;
-       case LIBINPUT_POINTER_AXIS_HORIZONTAL_SCROLL:
+       case LIBINPUT_POINTER_AXIS_SCROLL_HORIZONTAL:
                ax = "hscroll";
                break;
        default:
@@ -329,13 +335,16 @@ print_touch_event_with_coords(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);
 
        print_event_time(libinput_event_touch_get_time(t));
 
-       printf("%d (%d) %5.2f/%5.2f\n",
+       printf("%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);
+              x, y,
+              xmm, ymm);
 }
 
 static int