[PATCH libinput 13/15] tablet: set the axis bits correctly for each tool

Peter Hutterer peter.hutterer at who-t.net
Tue Feb 17 21:45:14 PST 2015


Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
 src/evdev-tablet.c | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/src/evdev-tablet.c b/src/evdev-tablet.c
index 46eb665..dcf1716 100644
--- a/src/evdev-tablet.c
+++ b/src/evdev-tablet.c
@@ -417,6 +417,18 @@ tool_set_bits(const struct tablet_dispatch *tablet,
 	 * - All of the mouse-like devices don't report any of
 	 *   the extra axes except for rotation (calculated from tilt x/y).
 	 */
+
+	switch (type) {
+	case LIBINPUT_TOOL_AIRBRUSH:
+		copy_axis_cap(tablet, tool, LIBINPUT_TABLET_AXIS_SLIDER);
+		break;
+	case LIBINPUT_TOOL_BRUSH:
+		copy_axis_cap(tablet, tool, LIBINPUT_TABLET_AXIS_ROTATION_Z);
+		break;
+	default:
+		break;
+	}
+
 	switch (type) {
 	case LIBINPUT_TOOL_PEN:
 	case LIBINPUT_TOOL_ERASER:
@@ -427,8 +439,6 @@ tool_set_bits(const struct tablet_dispatch *tablet,
 		copy_axis_cap(tablet, tool, LIBINPUT_TABLET_AXIS_DISTANCE);
 		copy_axis_cap(tablet, tool, LIBINPUT_TABLET_AXIS_TILT_X);
 		copy_axis_cap(tablet, tool, LIBINPUT_TABLET_AXIS_TILT_Y);
-		copy_axis_cap(tablet, tool, LIBINPUT_TABLET_AXIS_ROTATION_Z);
-		copy_axis_cap(tablet, tool, LIBINPUT_TABLET_AXIS_SLIDER);
 		break;
 	case LIBINPUT_TOOL_MOUSE:
 	case LIBINPUT_TOOL_LENS:
-- 
2.1.0



More information about the wayland-devel mailing list