The Pro Pen 3D includes a third stylus button, reported from the kernel
as BTN_STYLUS3. Support for this event was added earlier, but the number
of buttons allocated was not updated. This meant that although the X
driver would properly set the button flag bit to indicate that a button
should be sent, a userspace event wouldn't actually be sent. This commit
increases the number of buttons allocated, causing the third button to
emit X11 button number 8 when pressed. This button can also be configured
through xsetwacom now that the driver allocates the correct number.

Fixes: 4a96a58f26 ("Add support for kernel's new BTN_STYLUS3 event")
Signed-off-by: Jason Gerecke <jason.gere...@wacom.com>
---
 src/wcmUSB.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/wcmUSB.c b/src/wcmUSB.c
index 9190fbe..6349d69 100644
--- a/src/wcmUSB.c
+++ b/src/wcmUSB.c
@@ -167,7 +167,7 @@ static unsigned short padkey_codes [] = {
 /* Fixed mapped stylus and mouse buttons */
 
 #define WCM_USB_MAX_MOUSE_BUTTONS 5
-#define WCM_USB_MAX_STYLUS_BUTTONS 3
+#define WCM_USB_MAX_STYLUS_BUTTONS 4
 
 static unsigned short mouse_codes [] = {
        BTN_LEFT, BTN_MIDDLE, BTN_RIGHT, BTN_BACK, BTN_FORWARD,
@@ -480,7 +480,7 @@ static Bool usbWcmInit(InputInfoPtr pInfo, char* id, size_t 
id_len, float *versi
        /* nbuttons tracks maximum buttons on all tools (stylus/mouse).
         *
         * Mouse support left, middle, right, side, and extra side button.
-        * Stylus support tip and 2 stlyus buttons.
+        * Stylus support tip and 3 stlyus buttons.
         */
        if (ISBITSET (common->wcmKeys, BTN_TOOL_MOUSE))
                usbdata->nbuttons = WCM_USB_MAX_MOUSE_BUTTONS;
-- 
2.15.1


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel

Reply via email to