diff -ur linux.orig/drivers/usb/hid-core.c linux/drivers/usb/hid-core.c --- linux.orig/drivers/usb/hid-core.c 2002-10-26 20:31:21.000000000 -0400 +++ linux/drivers/usb/hid-core.c 2002-10-27 01:45:04.000000000 -0400 @@ -1086,6 +1086,8 @@ #define USB_DEVICE_ID_ATEN_2PORTKVM 0x2204 #define USB_DEVICE_ID_ATEN_4PORTKVM 0x2205 +#define USB_VENDOR_ID_A4TECH 0x09DA +#define USB_DEVICE_ID_A4TECH_WCP32PU 0x0006 struct hid_blacklist { __u16 idVendor; __u16 idProduct; @@ -1115,6 +1117,7 @@ { USB_VENDOR_ID_ATEN, USB_DEVICE_ID_ATEN_CS124U, HID_QUIRK_NOGET }, { USB_VENDOR_ID_ATEN, USB_DEVICE_ID_ATEN_2PORTKVM, HID_QUIRK_NOGET }, { USB_VENDOR_ID_ATEN, USB_DEVICE_ID_ATEN_4PORTKVM, HID_QUIRK_NOGET }, + { USB_VENDOR_ID_A4TECH, USB_DEVICE_ID_A4TECH_WCP32PU, HID_QUIRK_2WHEEL_MOUSE_HACK }, { 0, 0 } }; diff -ur linux.orig/drivers/usb/hid-input.c linux/drivers/usb/hid-input.c --- linux.orig/drivers/usb/hid-input.c 2001-11-11 13:09:37.000000000 -0500 +++ linux/drivers/usb/hid-input.c 2002-10-27 03:36:52.000000000 -0500 @@ -269,6 +269,11 @@ } set_bit(usage->type, input->evbit); + if ((usage->type == EV_REL) + && (device->quirks & HID_QUIRK_2WHEEL_MOUSE_HACK) + && (usage->code == REL_WHEEL)) { + set_bit(REL_HWHEEL, bit); + } while (usage->code <= max && test_and_set_bit(usage->code, bit)) { usage->code = find_next_zero_bit(bit, max + 1, usage->code); @@ -303,6 +308,20 @@ struct input_dev *input = &hid->input; int *quirks = &hid->quirks; + if ((hid->quirks & HID_QUIRK_2WHEEL_MOUSE_HACK) + && (usage->code == BTN_BACK)) { + if (value) + hid->quirks |= HID_QUIRK_2WHEEL_MOUSE_HACK_ON; + else + hid->quirks &= ~HID_QUIRK_2WHEEL_MOUSE_HACK_ON; + return; + } + if ((hid->quirks & HID_QUIRK_2WHEEL_MOUSE_HACK_ON) + && (usage->code == REL_WHEEL)) { + input_event(input, usage->type, REL_HWHEEL, value); + return; + } + if (usage->hat_min != usage->hat_max) { value = (value - usage->hat_min) * 8 / (usage->hat_max - usage->hat_min + 1) + 1; if (value < 0 || value > 8) value = 0; diff -ur linux.orig/drivers/usb/hid.h linux/drivers/usb/hid.h --- linux.orig/drivers/usb/hid.h 2002-10-26 20:31:21.000000000 -0400 +++ linux/drivers/usb/hid.h 2002-10-27 01:43:23.000000000 -0400 @@ -186,6 +186,8 @@ #define HID_QUIRK_NOTOUCH 0x02 #define HID_QUIRK_IGNORE 0x04 #define HID_QUIRK_NOGET 0x08 +#define HID_QUIRK_2WHEEL_MOUSE_HACK 0x10 +#define HID_QUIRK_2WHEEL_MOUSE_HACK_ON 0x20 /* * This is the global enviroment of the parser. This information is