Commit f3cf5c4f authored by Seth Forshee's avatar Seth Forshee Committed by Dmitry Torokhov

Input: sparse-keymap - report scancodes with key events

Scancodes are useful debugging aids when incorrect keycodes
are being sent, as is common with laptop hotkeys.
Signed-off-by: default avatarSeth Forshee <seth.forshee@canonical.com>
Signed-off-by: default avatarDmitry Torokhov <dtor@mail.ru>
parent d51ca076
...@@ -208,6 +208,11 @@ int sparse_keymap_setup(struct input_dev *dev, ...@@ -208,6 +208,11 @@ int sparse_keymap_setup(struct input_dev *dev,
} }
} }
if (test_bit(EV_KEY, dev->evbit)) {
__set_bit(EV_MSC, dev->evbit);
__set_bit(MSC_SCAN, dev->mscbit);
}
dev->keycode = map; dev->keycode = map;
dev->keycodemax = map_size; dev->keycodemax = map_size;
dev->getkeycode = sparse_keymap_getkeycode; dev->getkeycode = sparse_keymap_getkeycode;
...@@ -268,6 +273,7 @@ void sparse_keymap_report_entry(struct input_dev *dev, const struct key_entry *k ...@@ -268,6 +273,7 @@ void sparse_keymap_report_entry(struct input_dev *dev, const struct key_entry *k
{ {
switch (ke->type) { switch (ke->type) {
case KE_KEY: case KE_KEY:
input_event(dev, EV_MSC, MSC_SCAN, ke->code);
input_report_key(dev, ke->keycode, value); input_report_key(dev, ke->keycode, value);
input_sync(dev); input_sync(dev);
if (value && autorelease) { if (value && autorelease) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment