Skip to content

Commit

Permalink
Input: sparse-keymap - report scancodes with key events
Browse files Browse the repository at this point in the history
Scancodes are useful debugging aids when incorrect keycodes
are being sent, as is common with laptop hotkeys.

Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
  • Loading branch information
Seth Forshee authored and Dmitry Torokhov committed Mar 29, 2011
1 parent d51ca07 commit f3cf5c4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions drivers/input/sparse-keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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->keycodemax = map_size;
dev->getkeycode = sparse_keymap_getkeycode;
Expand Down Expand Up @@ -268,6 +273,7 @@ void sparse_keymap_report_entry(struct input_dev *dev, const struct key_entry *k
{
switch (ke->type) {
case KE_KEY:
input_event(dev, EV_MSC, MSC_SCAN, ke->code);
input_report_key(dev, ke->keycode, value);
input_sync(dev);
if (value && autorelease) {
Expand Down

0 comments on commit f3cf5c4

Please sign in to comment.