HID: Implement horizontal wheel handling for A4 Tech X5-005D
This mouse distinguishes horizontal wheel from vertical by a special "pseudo event" GenericDesktop.00b8, with values of 0 for vertical and 8 for horizontal wheel. Because this event is supplied by the parser too late, we need to delay a wheel event, wait for this one and send either REL_WHEEL or REL_HWHEEL to input depending on the event value. Signed-off-by: Pavel Troller <patrol@sinus.cz> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
This commit is contained in:

committed by
Jiri Kosina

parent
a45d82d19a
commit
c80e5ffac0
@@ -902,9 +902,10 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
|
||||
map_key(BTN_1);
|
||||
}
|
||||
|
||||
if ((device->quirks & (HID_QUIRK_2WHEEL_MOUSE_HACK_7 | HID_QUIRK_2WHEEL_MOUSE_HACK_5)) &&
|
||||
(usage->type == EV_REL) && (usage->code == REL_WHEEL))
|
||||
set_bit(REL_HWHEEL, bit);
|
||||
if ((device->quirks & (HID_QUIRK_2WHEEL_MOUSE_HACK_7 | HID_QUIRK_2WHEEL_MOUSE_HACK_5 |
|
||||
HID_QUIRK_2WHEEL_MOUSE_HACK_B8)) && (usage->type == EV_REL) &&
|
||||
(usage->code == REL_WHEEL))
|
||||
set_bit(REL_HWHEEL, bit);
|
||||
|
||||
if (((device->quirks & HID_QUIRK_2WHEEL_MOUSE_HACK_5) && (usage->hid == 0x00090005))
|
||||
|| ((device->quirks & HID_QUIRK_2WHEEL_MOUSE_HACK_7) && (usage->hid == 0x00090007)))
|
||||
@@ -1002,6 +1003,19 @@ void hidinput_hid_event(struct hid_device *hid, struct hid_field *field, struct
|
||||
return;
|
||||
}
|
||||
|
||||
if ((hid->quirks & HID_QUIRK_2WHEEL_MOUSE_HACK_B8) &&
|
||||
(usage->type == EV_REL) &&
|
||||
(usage->code == REL_WHEEL)) {
|
||||
hid->delayed_value = value;
|
||||
return;
|
||||
}
|
||||
|
||||
if ((hid->quirks & HID_QUIRK_2WHEEL_MOUSE_HACK_B8) &&
|
||||
(usage->hid == 0x000100b8)) {
|
||||
input_event(input, EV_REL, value ? REL_HWHEEL : REL_WHEEL, hid->delayed_value);
|
||||
return;
|
||||
}
|
||||
|
||||
if ((hid->quirks & HID_QUIRK_INVERT_HWHEEL) && (usage->code == REL_HWHEEL)) {
|
||||
input_event(input, usage->type, usage->code, -value);
|
||||
return;
|
||||
|
Reference in New Issue
Block a user