summaryrefslogtreecommitdiffstats
path: root/drivers/hid
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2015-07-09 14:33:21 -0700
committerJiri Kosina <jkosina@suse.com>2015-07-10 11:34:44 +0200
commit3eb4351af42bd8b6de20daab07b204a85c35248f (patch)
tree5f6eac80468fbb9adc7cc2c996302b2589c2a5a1 /drivers/hid
parent67e123ff0e9a71fcf19f83827d59f73076f5bd1a (diff)
downloadop-kernel-dev-3eb4351af42bd8b6de20daab07b204a85c35248f.zip
op-kernel-dev-3eb4351af42bd8b6de20daab07b204a85c35248f.tar.gz
HID: input: call input_sync() when automatically releasing a key
We need to emit EV_SYN/SYN_REPORT between key press and release, otherwise userspace is allowed to "swallow" the event. [jkosina@suse.com: Dmitry says that he's observing this behavior with Plantronics headset] Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.com>
Diffstat (limited to 'drivers/hid')
-rw-r--r--drivers/hid/hid-input.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c
index 3511bbab..14aebe4 100644
--- a/drivers/hid/hid-input.c
+++ b/drivers/hid/hid-input.c
@@ -1163,8 +1163,11 @@ void hidinput_hid_event(struct hid_device *hid, struct hid_field *field, struct
input_event(input, usage->type, usage->code, value);
- if ((field->flags & HID_MAIN_ITEM_RELATIVE) && (usage->type == EV_KEY))
+ if ((field->flags & HID_MAIN_ITEM_RELATIVE) &&
+ usage->type == EV_KEY && value) {
+ input_sync(input);
input_event(input, usage->type, usage->code, 0);
+ }
}
void hidinput_report_event(struct hid_device *hid, struct hid_report *report)
OpenPOWER on IntegriCloud