summaryrefslogtreecommitdiff
path: root/tools/libinput-debug-events.c
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2018-09-13 13:26:22 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2019-06-07 01:03:21 +0000
commit17d792445edd689edc5b83608dbca51a1ab9e6fa (patch)
tree33e04c5e5d6c3f3a890d80f347037af111f566a0 /tools/libinput-debug-events.c
parent52e86f4b2a743965a31dd0926256e28c530e506a (diff)
downloadlibinput-17d792445edd689edc5b83608dbca51a1ab9e6fa.tar.gz
tablet: add a the Totem tool type to the tablet interface
This is the public API only, not the internal bits, so nothing will work just yet. This interface addition is for the Dell Canvas Totem tool, so let's go with the same name because options like "Rotary" are too ambiguous. The totem is a knob that can be placed on the surface, it provides us with location and rotation data. The touch major/minor fields are filled in by the current totem, but they're always the same size. The totem exports BTN_0 as well, so let's add that to the debug-events output. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'tools/libinput-debug-events.c')
-rw-r--r--tools/libinput-debug-events.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/tools/libinput-debug-events.c b/tools/libinput-debug-events.c
index c989733e..23926af1 100644
--- a/tools/libinput-debug-events.c
+++ b/tools/libinput-debug-events.c
@@ -366,6 +366,7 @@ print_tablet_axes(struct libinput_event_tablet_tool *t)
double dist, pressure;
double rotation, slider, wheel;
double delta;
+ double major, minor;
#define changed_sym(ev, ax) \
(libinput_event_tablet_tool_##ax##_has_changed(ev) ? "*" : "")
@@ -415,6 +416,14 @@ print_tablet_axes(struct libinput_event_tablet_tool *t)
wheel, changed_sym(t, wheel),
(int)delta);
}
+
+ if (libinput_tablet_tool_has_size(tool)) {
+ major = libinput_event_tablet_tool_get_size_major(t);
+ minor = libinput_event_tablet_tool_get_size_minor(t);
+ printq("\tsize: %.2f%s/%.2f%s",
+ major, changed_sym(t, size_major),
+ minor, changed_sym(t, size_minor));
+ }
}
static void
@@ -548,6 +557,9 @@ print_proximity_event(struct libinput_event *ev)
case LIBINPUT_TABLET_TOOL_TYPE_LENS:
tool_str = "lens";
break;
+ case LIBINPUT_TABLET_TOOL_TYPE_TOTEM:
+ tool_str = "totem";
+ break;
default:
abort();
}
@@ -586,6 +598,8 @@ print_proximity_event(struct libinput_event *ev)
printq("s");
if (libinput_tablet_tool_has_wheel(tool))
printq("w");
+ if (libinput_tablet_tool_has_size(tool))
+ printq("S");
printq("\tbtn:");
if (libinput_tablet_tool_has_button(tool, BTN_TOUCH))
@@ -604,6 +618,8 @@ print_proximity_event(struct libinput_event *ev)
printq("Sd");
if (libinput_tablet_tool_has_button(tool, BTN_EXTRA))
printq("Ex");
+ if (libinput_tablet_tool_has_button(tool, BTN_0))
+ printq("0");
}
printq("\n");