diff options
author | Krzysztof A. Sobiecki <sobkas@gmail.com> | 2014-11-25 02:33:53 +0100 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2014-11-26 07:57:36 +1000 |
commit | 7ae555a4a2b981bf47ffa0936183d878e0697b52 (patch) | |
tree | 343265fe562c30b334cf9ec5b4a742be8f1ae49a | |
parent | 6a4ceed2b91f5bbd28991d61615b17dc4a707fe3 (diff) | |
download | libinput-7ae555a4a2b981bf47ffa0936183d878e0697b52.tar.gz |
Ignore devices that have joystick buttons
This patch allows libinput to ignore devices that have joystick buttons.
Signed-off-by: Krzysztof Sobiecki <sobkas@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r-- | src/evdev.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/evdev.c b/src/evdev.c index 908a8bad..baa1c514 100644 --- a/src/evdev.c +++ b/src/evdev.c @@ -1266,6 +1266,15 @@ evdev_configure_device(struct evdev_device *device) has_keyboard = 0; has_touch = 0; + for (i = BTN_JOYSTICK; i < BTN_DIGI; i++) { + if (libevdev_has_event_code(evdev, EV_KEY, i)) { + log_info(libinput, + "input device '%s', %s is a joystick, ignoring\n", + device->devname, devnode); + return -1; + } + } + if (libevdev_has_event_type(evdev, EV_ABS)) { if ((absinfo = libevdev_get_abs_info(evdev, ABS_X))) { |