From e3d04088bdf8b32e5b0398ee55bd782e7034bb6e Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Tue, 21 Mar 2017 11:17:28 +1000 Subject: tools: print axes, but not capabilities on proximity out Print the axis values on proximity out because it a) ensures we have the right values and b) makes the output better aligned with the proximity in, so it's easier to spot in a log file. But don't print the tool capabilities because they're unrelated to the prox out anyway and again it makes the output easier to spot. Signed-off-by: Peter Hutterer --- tools/event-debug.c | 66 +++++++++++++++++++++++++++-------------------------- 1 file changed, 34 insertions(+), 32 deletions(-) (limited to 'tools') diff --git a/tools/event-debug.c b/tools/event-debug.c index 81d7ea4..51ed428 100644 --- a/tools/event-debug.c +++ b/tools/event-debug.c @@ -549,8 +549,8 @@ print_proximity_event(struct libinput_event *ev) print_tablet_axes(t); state_str = "proximity-in"; } else if (state == LIBINPUT_TABLET_TOOL_PROXIMITY_STATE_OUT) { + print_tablet_axes(t); state_str = "proximity-out"; - printq("\t"); } else { abort(); } @@ -561,37 +561,39 @@ print_proximity_event(struct libinput_event *ev) libinput_tablet_tool_get_tool_id(tool), state_str); - printq("\taxes:"); - if (libinput_tablet_tool_has_distance(tool)) - printq("d"); - if (libinput_tablet_tool_has_pressure(tool)) - printq("p"); - if (libinput_tablet_tool_has_tilt(tool)) - printq("t"); - if (libinput_tablet_tool_has_rotation(tool)) - printq("r"); - if (libinput_tablet_tool_has_slider(tool)) - printq("s"); - if (libinput_tablet_tool_has_wheel(tool)) - printq("w"); - - printq("\tbtn:"); - if (libinput_tablet_tool_has_button(tool, BTN_TOUCH)) - printq("T"); - if (libinput_tablet_tool_has_button(tool, BTN_STYLUS)) - printq("S"); - if (libinput_tablet_tool_has_button(tool, BTN_STYLUS2)) - printq("S2"); - if (libinput_tablet_tool_has_button(tool, BTN_LEFT)) - printq("L"); - if (libinput_tablet_tool_has_button(tool, BTN_MIDDLE)) - printq("M"); - if (libinput_tablet_tool_has_button(tool, BTN_RIGHT)) - printq("R"); - if (libinput_tablet_tool_has_button(tool, BTN_SIDE)) - printq("Sd"); - if (libinput_tablet_tool_has_button(tool, BTN_EXTRA)) - printq("Ex"); + if (state == LIBINPUT_TABLET_TOOL_PROXIMITY_STATE_IN) { + printq("\taxes:"); + if (libinput_tablet_tool_has_distance(tool)) + printq("d"); + if (libinput_tablet_tool_has_pressure(tool)) + printq("p"); + if (libinput_tablet_tool_has_tilt(tool)) + printq("t"); + if (libinput_tablet_tool_has_rotation(tool)) + printq("r"); + if (libinput_tablet_tool_has_slider(tool)) + printq("s"); + if (libinput_tablet_tool_has_wheel(tool)) + printq("w"); + + printq("\tbtn:"); + if (libinput_tablet_tool_has_button(tool, BTN_TOUCH)) + printq("T"); + if (libinput_tablet_tool_has_button(tool, BTN_STYLUS)) + printq("S"); + if (libinput_tablet_tool_has_button(tool, BTN_STYLUS2)) + printq("S2"); + if (libinput_tablet_tool_has_button(tool, BTN_LEFT)) + printq("L"); + if (libinput_tablet_tool_has_button(tool, BTN_MIDDLE)) + printq("M"); + if (libinput_tablet_tool_has_button(tool, BTN_RIGHT)) + printq("R"); + if (libinput_tablet_tool_has_button(tool, BTN_SIDE)) + printq("Sd"); + if (libinput_tablet_tool_has_button(tool, BTN_EXTRA)) + printq("Ex"); + } printq("\n"); } -- cgit v1.2.3