Skip to content

Commit dcce8ef

Browse files
jigpuJiri Kosina
authored andcommitted
HID: wacom: Report 2nd-gen Intuos Pro S center button status over BT
The state of the center button was not reported to userspace for the 2nd-gen Intuos Pro S when used over Bluetooth due to the pad handling code not being updated to support its reduced number of buttons. This patch uses the actual number of buttons present on the tablet to assemble a button state bitmap. Link: https://github.com/linuxwacom/xf86-input-wacom/issues/112 Fixes: cd47de45b855 ("HID: wacom: Add 2nd gen Intuos Pro Small support") Signed-off-by: Jason Gerecke <[email protected]> Cc: [email protected] # v5.3+ Signed-off-by: Jiri Kosina <[email protected]>
1 parent 0ed08fa commit dcce8ef

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

drivers/hid/wacom_wac.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1427,19 +1427,22 @@ static void wacom_intuos_pro2_bt_pad(struct wacom_wac *wacom)
14271427
{
14281428
struct input_dev *pad_input = wacom->pad_input;
14291429
unsigned char *data = wacom->data;
1430+
int nbuttons = wacom->features.numbered_buttons;
14301431

1431-
int buttons = data[282] | ((data[281] & 0x40) << 2);
1432+
int expresskeys = data[282];
1433+
int center = (data[281] & 0x40) >> 6;
14321434
int ring = data[285] & 0x7F;
14331435
bool ringstatus = data[285] & 0x80;
1434-
bool prox = buttons || ringstatus;
1436+
bool prox = expresskeys || center || ringstatus;
14351437

14361438
/* Fix touchring data: userspace expects 0 at left and increasing clockwise */
14371439
ring = 71 - ring;
14381440
ring += 3*72/16;
14391441
if (ring > 71)
14401442
ring -= 72;
14411443

1442-
wacom_report_numbered_buttons(pad_input, 9, buttons);
1444+
wacom_report_numbered_buttons(pad_input, nbuttons,
1445+
expresskeys | (center << (nbuttons - 1)));
14431446

14441447
input_report_abs(pad_input, ABS_WHEEL, ringstatus ? ring : 0);
14451448

0 commit comments

Comments
 (0)