summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Gerecke <killertofu@gmail.com>2017-12-26 14:21:17 -0800
committerJason Gerecke <killertofu@gmail.com>2018-01-09 10:30:00 -0800
commit685850060f1cef064a90e02191d4732f275c7179 (patch)
tree0380dba4b14f8785991af512b461e1e8e15da673
parent4108d97fd7d0690d1d343bc0229b68b5fb48a6fc (diff)
downloadxf86-input-wacom-685850060f1cef064a90e02191d4732f275c7179.tar.gz
Allocate 4 buttons for stylus devices (Pro Pen 3D)
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.gerecke@wacom.com> Reviewed-by: Ping Cheng <ping.cheng@wacom.com>
-rw-r--r--src/wcmUSB.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/wcmUSB.c b/src/wcmUSB.c
index 9190fbe..1e4dc51 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 stylus buttons.
*/
if (ISBITSET (common->wcmKeys, BTN_TOOL_MOUSE))
usbdata->nbuttons = WCM_USB_MAX_MOUSE_BUTTONS;