|
@@ -567,16 +567,14 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
|
|
|
|
- set_bit(usage->type, input->evbit);
|
|
|
|
-
|
|
|
|
- while (usage->code <= max && test_and_set_bit(usage->code, bit))
|
|
|
|
- usage->code = find_next_zero_bit(bit, max + 1, usage->code);
|
|
|
|
-
|
|
|
|
- if (usage->code > max)
|
|
|
|
- goto ignore;
|
|
|
|
-
|
|
|
|
- if (((device->quirks & (HID_QUIRK_2WHEEL_POWERMOUSE)) && (usage->hid == 0x00010032)))
|
|
|
|
- map_rel(REL_HWHEEL);
|
|
|
|
|
|
+ if (device->quirks & HID_QUIRK_MIGHTYMOUSE) {
|
|
|
|
+ if (usage->hid == HID_GD_Z)
|
|
|
|
+ map_rel(REL_HWHEEL);
|
|
|
|
+ else if (usage->code == BTN_1)
|
|
|
|
+ map_key(BTN_2);
|
|
|
|
+ else if (usage->code == BTN_2)
|
|
|
|
+ map_key(BTN_1);
|
|
|
|
+ }
|
|
|
|
|
|
if ((device->quirks & (HID_QUIRK_2WHEEL_MOUSE_HACK_7 | HID_QUIRK_2WHEEL_MOUSE_HACK_5)) &&
|
|
if ((device->quirks & (HID_QUIRK_2WHEEL_MOUSE_HACK_7 | HID_QUIRK_2WHEEL_MOUSE_HACK_5)) &&
|
|
(usage->type == EV_REL) && (usage->code == REL_WHEEL))
|
|
(usage->type == EV_REL) && (usage->code == REL_WHEEL))
|
|
@@ -586,6 +584,15 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
|
|
|| ((device->quirks & HID_QUIRK_2WHEEL_MOUSE_HACK_7) && (usage->hid == 0x00090007)))
|
|
|| ((device->quirks & HID_QUIRK_2WHEEL_MOUSE_HACK_7) && (usage->hid == 0x00090007)))
|
|
goto ignore;
|
|
goto ignore;
|
|
|
|
|
|
|
|
+ set_bit(usage->type, input->evbit);
|
|
|
|
+
|
|
|
|
+ while (usage->code <= max && test_and_set_bit(usage->code, bit))
|
|
|
|
+ usage->code = find_next_zero_bit(bit, max + 1, usage->code);
|
|
|
|
+
|
|
|
|
+ if (usage->code > max)
|
|
|
|
+ goto ignore;
|
|
|
|
+
|
|
|
|
+
|
|
if (usage->type == EV_ABS) {
|
|
if (usage->type == EV_ABS) {
|
|
|
|
|
|
int a = field->logical_minimum;
|
|
int a = field->logical_minimum;
|
|
@@ -647,6 +654,11 @@ void hidinput_hid_event(struct hid_device *hid, struct hid_field *field, struct
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ if ((hid->quirks & HID_QUIRK_INVERT_HWHEEL) && (usage->code == REL_HWHEEL)) {
|
|
|
|
+ input_event(input, usage->type, usage->code, -value);
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
if ((hid->quirks & HID_QUIRK_2WHEEL_MOUSE_HACK_ON) && (usage->code == REL_WHEEL)) {
|
|
if ((hid->quirks & HID_QUIRK_2WHEEL_MOUSE_HACK_ON) && (usage->code == REL_WHEEL)) {
|
|
input_event(input, usage->type, REL_HWHEEL, value);
|
|
input_event(input, usage->type, REL_HWHEEL, value);
|
|
return;
|
|
return;
|