summaryrefslogtreecommitdiff
path: root/drivers/input/sparse-keymap.c
diff options
context:
space:
mode:
authorSeth Forshee <seth.forshee@canonical.com>2011-03-27 09:53:34 +0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2011-03-29 10:34:48 +0400
commitf3cf5c4fedbe13880cd80a9fa1aebae79ebef20e (patch)
treeb7149d1105463e694a1f45e48bb44c0bd101336a /drivers/input/sparse-keymap.c
parentd51ca07634b8a441f731e087e93775a67d629a8c (diff)
downloadlinux-f3cf5c4fedbe13880cd80a9fa1aebae79ebef20e.tar.xz
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: Seth Forshee <seth.forshee@canonical.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input/sparse-keymap.c')
-rw-r--r--drivers/input/sparse-keymap.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/input/sparse-keymap.c b/drivers/input/sparse-keymap.c
index 337bf51bc984..74bca5d2f6dc 100644
--- a/drivers/input/sparse-keymap.c
+++ b/drivers/input/sparse-keymap.c
@@ -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;
@@ -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) {