clutter/evdev: Add support for BTN_STYLUS3

BTN_STYLUS3 is defined by the Linux 4.15 kernel and is sent when the
third button on a stylus is pressed. At the moment, only Wacom's "Pro
Pen 3D" has three stylus buttons. Pressing this button triggers a button
8 event to be sent under X11, so we use the same mapping here.

https://bugzilla.gnome.org/show_bug.cgi?id=790033
This commit is contained in:
Jason Gerecke 2017-10-10 09:18:25 -07:00 committed by Carlos Garnacho
parent 97f142d1cc
commit 91df801ffb

View File

@ -45,6 +45,10 @@
#define DISCRETE_SCROLL_STEP 10.0
#ifndef BTN_STYLUS3
#define BTN_STYLUS3 0x149 /* Linux 4.15 */
#endif
void
clutter_seat_evdev_set_libinput_seat (ClutterSeatEvdev *seat,
struct libinput_seat *libinput_seat)
@ -492,6 +496,10 @@ clutter_seat_evdev_notify_button (ClutterSeatEvdev *seat,
button_nr = CLUTTER_BUTTON_MIDDLE;
break;
case 0x149: /* BTN_STYLUS3 */
button_nr = 8;
break;
default:
/* For compatibility reasons, all additional buttons go after the old 4-7 scroll ones */
if (clutter_input_device_get_device_type (input_device) == CLUTTER_TABLET_DEVICE)