I didn't like a) layering violation, and b) that they defeat filtering
unconditionally. Why have any filtering then?
Instead, I propose for USB HID driver to reset NumLock on probe. Like this:
--- a/drivers/usb/input/hid-core.c
+++ b/drivers/usb/input/hid-core.c
@@ -458,6 +458,18 @@ static int usb_hidinput_input_event(struct input_dev *dev, unsigned int type, un
return 0;
}
+static void usbhid_set_leds(struct hid_device *hid, unsigned int code, int val)
+{
+ struct hid_field *field;
+ int offset;
+
+ /* This is often called for the mouse half. */
+ if ((offset = hidinput_find_field(hid, EV_LED, code, &field)) != -1) {
+ hid_set_field(field, offset, val);
+ usbhid_submit_report(hid, field->report, USB_DIR_OUT);
+ }
+}
+