Blame SOURCES/0001-Add-support-for-kernel-s-new-BTN_STYLUS3-event.patch

7e269f
From 4a96a58f2693b291b91e21b7e34f5c5e04015f3f Mon Sep 17 00:00:00 2001
7e269f
From: Jason Gerecke <killertofu@gmail.com>
7e269f
Date: Tue, 3 Oct 2017 13:45:37 -0700
7e269f
Subject: [PATCH] Add support for kernel's new BTN_STYLUS3 event
7e269f
7e269f
BTN_STYLUS3 was (will be) added to the Linux 4.15 kernel to support the
7e269f
third button present on Wacom's "Pro Pen 3D" stylus. This commit adds
7e269f
support for this new event, mapping it to mouse button 8 ("navigate
7e269f
back"). Remapping this button to a different function is possible by
7e269f
using commands like `xsetwacom set <id> button 8 <action>`.
7e269f
7e269f
Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com>
7e269f
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
7e269f
---
7e269f
 src/wcmUSB.c        | 4 ++++
7e269f
 src/xf86WacomDefs.h | 6 ++++++
7e269f
 2 files changed, 10 insertions(+)
7e269f
7e269f
diff --git a/src/wcmUSB.c b/src/wcmUSB.c
7e269f
index 0b5ec57..2f96a8a 100644
7e269f
--- a/src/wcmUSB.c
7e269f
+++ b/src/wcmUSB.c
7e269f
@@ -1454,6 +1454,10 @@ static void usbParseKeyEvent(WacomCommonPtr common,
7e269f
 			ds->buttons = mod_buttons(ds->buttons, 2, event->value);
7e269f
 			break;
7e269f
 
7e269f
+		case BTN_STYLUS3:
7e269f
+			ds->buttons = mod_buttons(ds->buttons, 3, event->value);
7e269f
+			break;
7e269f
+
7e269f
 		default:
7e269f
 			change = 0;
7e269f
 	}
7e269f
diff --git a/src/xf86WacomDefs.h b/src/xf86WacomDefs.h
7e269f
index ec34211..a772597 100644
7e269f
--- a/src/xf86WacomDefs.h
7e269f
+++ b/src/xf86WacomDefs.h
7e269f
@@ -93,6 +93,12 @@
7e269f
 #define ABS_MT_SLOT 0x2f
7e269f
 #endif
7e269f
 
7e269f
+/* 4.15 */
7e269f
+
7e269f
+#ifndef BTN_STYLUS3
7e269f
+#define BTN_STYLUS3 0x149
7e269f
+#endif
7e269f
+
7e269f
 /******************************************************************************
7e269f
  * Forward Declarations
7e269f
  *****************************************************************************/
7e269f
-- 
7e269f
2.14.3
7e269f