Anssi Hannula wrote: > Logitech USB Receiver (046d:c101) has two interfaces. The first one > contains fields from HID_UP_KEYBOARD and HID_UP_LED, and the other one > contains fields from HID_UP_CONSUMER and HID_UP_LOGIVENDOR. This device > is used with multiple wireless Logitech products, including UltraX Media > Remote. > > All fields on both interfaces are either keys or leds. All fields in the > first interface are marked as Absolute, while the fields in the second > interface are marked as Relative. Marking the keys as relative causes > hidinput_hid_event() to send release events right after key press > events. > > The device has EV_REP set, so the userspace expects the device to send > repeat events if a key is held down. However, as hidinput_hid_event() > sends release events immediately, repeat events are not sent at all. In > fact, the userspace has no way of knowing if a key is being held down. > > Fix this by adding a quirk for 046d:c101 which changes relative keys to > absolute ones. >
Any comments? > Signed-off-by: Anssi Hannula <[EMAIL PROTECTED]> > > --- > > hid-core.c | 5 +++++ > hid-input.c | 4 ++++ > hid.h | 1 + > 3 files changed, 10 insertions(+) > > > diff -Nurp -x '*~' linux-2.6.18-git21/drivers/usb/input/hid-core.c > linux-2.6.18-git21-logimedia/drivers/usb/input/hid-core.c > --- linux-2.6.18-git21/drivers/usb/input/hid-core.c 2006-10-04 > 14:22:15.000000000 +0300 > +++ linux-2.6.18-git21-logimedia/drivers/usb/input/hid-core.c 2006-10-04 > 14:34:44.000000000 +0300 > @@ -1602,6 +1602,9 @@ void hid_init_reports(struct hid_device > #define USB_VENDOR_ID_SUN 0x0430 > #define USB_DEVICE_ID_RARITAN_KVM_DONGLE 0xcdab > > +#define USB_VENDOR_ID_LOGITECH 0x046d > +#define USB_DEVICE_ID_LOGITECH_USB_RECEIVER 0xc101 > + > /* > * Alphabetically sorted blacklist by quirk type. > */ > @@ -1768,6 +1771,8 @@ static const struct hid_blacklist { > { USB_VENDOR_ID_PANJIT, 0x0003, HID_QUIRK_IGNORE }, > { USB_VENDOR_ID_PANJIT, 0x0004, HID_QUIRK_IGNORE }, > > + { USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_USB_RECEIVER, > HID_QUIRK_BAD_RELATIVE_KEYS }, > + > { 0, 0 } > }; > > diff -Nurp -x '*~' linux-2.6.18-git21/drivers/usb/input/hid.h > linux-2.6.18-git21-logimedia/drivers/usb/input/hid.h > --- linux-2.6.18-git21/drivers/usb/input/hid.h 2006-10-04 > 14:22:15.000000000 +0300 > +++ linux-2.6.18-git21-logimedia/drivers/usb/input/hid.h 2006-10-04 > 14:45:45.000000000 +0300 > @@ -260,6 +260,7 @@ struct hid_item { > #define HID_QUIRK_POWERBOOK_HAS_FN 0x00001000 > #define HID_QUIRK_POWERBOOK_FN_ON 0x00002000 > #define HID_QUIRK_INVERT_HWHEEL 0x00004000 > +#define HID_QUIRK_BAD_RELATIVE_KEYS 0x00008000 > > /* > * This is the global environment of the parser. This information is > diff -Nurp -x '*~' linux-2.6.18-git21/drivers/usb/input/hid-input.c > linux-2.6.18-git21-logimedia/drivers/usb/input/hid-input.c > --- linux-2.6.18-git21/drivers/usb/input/hid-input.c 2006-10-04 > 14:22:15.000000000 +0300 > +++ linux-2.6.18-git21-logimedia/drivers/usb/input/hid-input.c > 2006-10-04 14:46:52.000000000 +0300 > @@ -564,6 +564,10 @@ static void hidinput_configure_usage(str > || ((device->quirks & HID_QUIRK_2WHEEL_MOUSE_HACK_7) && > (usage->hid == 0x00090007))) > goto ignore; > > + if ((device->quirks & HID_QUIRK_BAD_RELATIVE_KEYS) && > + usage->type == EV_KEY && (field->flags & HID_MAIN_ITEM_RELATIVE)) > + field->flags &= ~HID_MAIN_ITEM_RELATIVE; > + > set_bit(usage->type, input->evbit); > > while (usage->code <= max && test_and_set_bit(usage->code, bit)) > > -- Anssi Hannula ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel