diff options
author | Adam Jackson <ajax@redhat.com> | 2008-08-07 09:21:26 +0930 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2008-08-07 10:40:14 +0930 |
commit | 8fe38b228702bddebe26a6d2c5c170a2a91d6ebc (patch) | |
tree | 90aa95b1c25440e2a0849ad263830cf5de1527e9 | |
parent | Actually close the fd on DEVICE_CLOSE (bug#16948) (diff) | |
download | xf86-input-evdev-8fe38b228702bddebe26a6d2c5c170a2a91d6ebc.tar.gz xf86-input-evdev-8fe38b228702bddebe26a6d2c5c170a2a91d6ebc.tar.bz2 xf86-input-evdev-8fe38b228702bddebe26a6d2c5c170a2a91d6ebc.zip |
Print a warning if a keycode exceeds the range accepted by the server.
Keycodes over 255 are silently ignored in the server. The least we can do is
put a warning in the logs.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit c1f7f8c3d22ecae7839f82ea8b584069f54f1f5e)
-rw-r--r-- | src/evdev.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/evdev.c b/src/evdev.c index 164346a..a857db3 100644 --- a/src/evdev.c +++ b/src/evdev.c @@ -131,6 +131,9 @@ PostButtonClicks(InputInfoPtr pInfo, int button, int count) static void PostKbdEvent(InputInfoPtr pInfo, struct input_event *ev, int value) { + int code = ev->code + MIN_KEYCODE; + static char warned[KEY_MAX]; + /* filter repeat events for chording keys */ if (value == 2 && (ev->code == KEY_LEFTCTRL || ev->code == KEY_RIGHTCTRL || @@ -141,7 +144,14 @@ PostKbdEvent(InputInfoPtr pInfo, struct input_event *ev, int value) ev->code == KEY_SCROLLLOCK)) /* XXX windows keys? */ return; - xf86PostKeyboardEvent(pInfo->dev, ev->code + MIN_KEYCODE, value); + if (code > 255 && ev->code < KEY_MAX) { + if (!warned[ev->code]) + xf86Msg(X_WARNING, "%s: unable to handle keycode %d\n", + pInfo->name, ev->code); + warned[ev->code] = 1; + } + + xf86PostKeyboardEvent(pInfo->dev, code, value); } static void |