File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -2540,11 +2540,12 @@ static void wacom_wac_pen_report(struct hid_device *hdev,
2540
2540
2541
2541
if (!delay_pen_events (wacom_wac ) && wacom_wac -> tool [0 ]) {
2542
2542
int id = wacom_wac -> id [0 ];
2543
- if (wacom_wac -> features .quirks & WACOM_QUIRK_PEN_BUTTON3 &&
2544
- wacom_wac -> hid_data .barrelswitch & wacom_wac -> hid_data .barrelswitch2 ) {
2545
- wacom_wac -> hid_data .barrelswitch = 0 ;
2546
- wacom_wac -> hid_data .barrelswitch2 = 0 ;
2547
- wacom_wac -> hid_data .barrelswitch3 = 1 ;
2543
+ if (wacom_wac -> features .quirks & WACOM_QUIRK_PEN_BUTTON3 ) {
2544
+ int sw_state = wacom_wac -> hid_data .barrelswitch |
2545
+ (wacom_wac -> hid_data .barrelswitch2 << 1 );
2546
+ wacom_wac -> hid_data .barrelswitch = sw_state == 1 ;
2547
+ wacom_wac -> hid_data .barrelswitch2 = sw_state == 2 ;
2548
+ wacom_wac -> hid_data .barrelswitch3 = sw_state == 3 ;
2548
2549
}
2549
2550
input_report_key (input , BTN_STYLUS , wacom_wac -> hid_data .barrelswitch );
2550
2551
input_report_key (input , BTN_STYLUS2 , wacom_wac -> hid_data .barrelswitch2 );
You can’t perform that action at this time.
0 commit comments