|
@@ -2140,6 +2140,12 @@ static void wacom_wac_pen_event(struct hid_device *hdev, struct hid_field *field
|
|
|
case HID_DG_TIPSWITCH:
|
|
|
wacom_wac->hid_data.tipswitch |= value;
|
|
|
return;
|
|
|
+ case HID_DG_BARRELSWITCH:
|
|
|
+ wacom_wac->hid_data.barrelswitch = value;
|
|
|
+ return;
|
|
|
+ case HID_DG_BARRELSWITCH2:
|
|
|
+ wacom_wac->hid_data.barrelswitch2 = value;
|
|
|
+ return;
|
|
|
case HID_DG_TOOLSERIALNUMBER:
|
|
|
if (value) {
|
|
|
wacom_wac->serial[0] = (wacom_wac->serial[0] & ~0xFFFFFFFFULL);
|
|
@@ -2254,6 +2260,12 @@ static void wacom_wac_pen_report(struct hid_device *hdev,
|
|
|
|
|
|
if (!delay_pen_events(wacom_wac) && wacom_wac->tool[0]) {
|
|
|
int id = wacom_wac->id[0];
|
|
|
+ int sw_state = wacom_wac->hid_data.barrelswitch |
|
|
|
+ (wacom_wac->hid_data.barrelswitch2 << 1);
|
|
|
+
|
|
|
+ input_report_key(input, BTN_STYLUS, sw_state == 1);
|
|
|
+ input_report_key(input, BTN_STYLUS2, sw_state == 2);
|
|
|
+ input_report_key(input, BTN_STYLUS3, sw_state == 3);
|
|
|
|
|
|
/*
|
|
|
* Non-USI EMR tools should have their IDs mangled to
|
|
@@ -3300,9 +3312,11 @@ int wacom_setup_pen_input_capabilities(struct input_dev *input_dev,
|
|
|
else
|
|
|
__set_bit(INPUT_PROP_POINTER, input_dev->propbit);
|
|
|
|
|
|
- if (features->type == HID_GENERIC)
|
|
|
- /* setup has already been done */
|
|
|
+ if (features->type == HID_GENERIC) {
|
|
|
+ /* setup has already been done; apply otherwise-undetectible quirks */
|
|
|
+ input_set_capability(input_dev, EV_KEY, BTN_STYLUS3);
|
|
|
return 0;
|
|
|
+ }
|
|
|
|
|
|
__set_bit(BTN_TOUCH, input_dev->keybit);
|
|
|
__set_bit(ABS_MISC, input_dev->absbit);
|