summary refs log tree commit diff
path: root/drivers/hid/wacom_wac.h
diff options
context:
space:
mode:
authorJason Gerecke <killertofu@gmail.com>2017-11-07 08:25:17 -0800
committerJiri Kosina <jkosina@suse.cz>2017-11-09 13:32:43 +0100
commit9e429d564926d3bca49907fa03031da705ad6f2c (patch)
tree591f242c7674ac2076d9e2a56139167ffbf1c5b1 /drivers/hid/wacom_wac.h
parent2f84723de7cdd031f293b900fecd68ddbec3feaa (diff)
downloadlinux-9e429d564926d3bca49907fa03031da705ad6f2c.tar.gz
HID: wacom: generic: Send BTN_STYLUS3 when both barrel switches are set
The Wacom Pro Pen 3D includes a third barrel switch which is intended to
be particularly useful in applications where one frequency uses pan, zoom,
and rotate to navigate around a scene or model. The pen is compatible with
the MobileStudio Pro, 2nd-gen Intuos Pro, and Cintiq Pro. When the third
button is pressed, these devices set both the HID_DG_BARRELSWITCH and
HID_DG_BARRELSWITCH2 usages since their HID descriptors do not include a
usage specific to the button.

Rather than send both BTN_STYLUS and BTN_STYLUS2 when the third button is
pressed, userspace (libinput) has requested that we detect this condition
and report a newly-defined BTN_STYLUS3 event instead. We could define a
quirk specific to devices compatible with the Pro Pen 3D, but the liklihood
of seeing both barrel switch bits set with other pens/devices is low enough
to not worry about (pens mechanically prevent accidental activation of
multiple switches).

Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com>
Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid/wacom_wac.h')
-rw-r--r--drivers/hid/wacom_wac.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/hid/wacom_wac.h b/drivers/hid/wacom_wac.h
index 8a03654048bf..69dda27e8dde 100644
--- a/drivers/hid/wacom_wac.h
+++ b/drivers/hid/wacom_wac.h
@@ -291,6 +291,8 @@ struct hid_data {
 	bool inrange_state;
 	bool invert_state;
 	bool tipswitch;
+	bool barrelswitch;
+	bool barrelswitch2;
 	int x;
 	int y;
 	int pressure;