From afe2ab604caa2f66802855467035f0ae48366fc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristian=20H=C3=B8gsberg?= Date: Tue, 13 Aug 2013 14:55:39 -0700 Subject: [PATCH] evdev: Ignore joystick devices We don't handle them in any way now and having your steering wheel move the cursor isn't useful. Applications can still open evdev devices and access them directly like they already do. --- src/evdev.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/evdev.c b/src/evdev.c index fccbaaac9..3d225bcb2 100644 --- a/src/evdev.c +++ b/src/evdev.c @@ -445,6 +445,16 @@ evdev_handle_device(struct evdev_device *device) ioctl(device->fd, EVIOCGBIT(EV_ABS, sizeof(abs_bits)), abs_bits); + + if (TEST_BIT(abs_bits, ABS_WHEEL) || + TEST_BIT(abs_bits, ABS_GAS) || + TEST_BIT(abs_bits, ABS_BRAKE) || + TEST_BIT(abs_bits, ABS_HAT0X)) { + weston_log("device %s is a joystick, ignoring\n", + device->devnode); + return 0; + } + if (TEST_BIT(abs_bits, ABS_X)) { ioctl(device->fd, EVIOCGABS(ABS_X), &absinfo); device->abs.min_x = absinfo.minimum;