diff options
author | Jason Gerecke <killertofu@gmail.com> | 2017-10-10 09:18:25 -0700 |
---|---|---|
committer | Carlos Garnacho <carlosg@gnome.org> | 2018-01-30 19:28:02 +0100 |
commit | 91df801ffbfa5b20831e2b03321ba97636b85ee1 (patch) | |
tree | d59a220b7579a032a77357627922b8959c1cc668 | |
parent | 97f142d1cc2fa5ba2182081c54abd890a2cf449b (diff) | |
download | mutter-91df801ffbfa5b20831e2b03321ba97636b85ee1.tar.gz |
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
-rw-r--r-- | clutter/clutter/evdev/clutter-seat-evdev.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/clutter/clutter/evdev/clutter-seat-evdev.c b/clutter/clutter/evdev/clutter-seat-evdev.c index e8524da72..f98f85ae0 100644 --- a/clutter/clutter/evdev/clutter-seat-evdev.c +++ b/clutter/clutter/evdev/clutter-seat-evdev.c @@ -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) |