[mutter] clutter/evdev: Add support for BTN_STYLUS3



commit 91df801ffbfa5b20831e2b03321ba97636b85ee1
Author: Jason Gerecke <killertofu gmail com>
Date:   Tue Oct 10 09:18:25 2017 -0700

    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

 clutter/clutter/evdev/clutter-seat-evdev.c | 8 ++++++++
 1 file changed, 8 insertions(+)
---
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)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]