summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@bitplanet.net>2013-08-13 14:55:39 -0700
committerKristian Høgsberg <krh@bitplanet.net>2013-08-20 16:11:09 -0700
commitafe2ab604caa2f66802855467035f0ae48366fc9 (patch)
treed1a9413bd8f902021f546df1cf85f7189aeb84fd
parentce55406ec246d9daa6cb2493bc7a48265ad4457e (diff)
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.
-rw-r--r--src/evdev.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/evdev.c b/src/evdev.c
index fccbaaac..3d225bcb 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;