mirror of
https://gitlab.freedesktop.org/wayland/weston.git
synced 2026-05-08 11:18:43 +02:00
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.
This commit is contained in:
parent
ce55406ec2
commit
afe2ab604c
1 changed files with 10 additions and 0 deletions
10
src/evdev.c
10
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;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue