From: Krzysztof A. Sobiecki Date: Tue, 25 Nov 2014 01:33:53 +0000 (+0100) Subject: Ignore devices that have joystick buttons X-Git-Tag: 0.7.0~17 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7ae555a4a2b981bf47ffa0936183d878e0697b52;p=platform%2Fupstream%2Flibinput.git Ignore devices that have joystick buttons This patch allows libinput to ignore devices that have joystick buttons. Signed-off-by: Krzysztof Sobiecki Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer --- 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))) {