diff options
-rw-r--r-- | src/evdev.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/evdev.c b/src/evdev.c index 3a9fb0e..490fa44 100644 --- a/src/evdev.c +++ b/src/evdev.c @@ -362,6 +362,10 @@ EvdevProcessEvent(InputInfoPtr pInfo, struct input_event *ev) switch (ev->type) { case EV_REL: + /* Ignore EV_REL events if we never set up for them. */ + if (!(pEvdev->flags & EVDEV_RELATIVE_EVENTS)) + break; + /* Handle mouse wheel emulation */ if (EvdevWheelEmuFilterMotion(pInfo, ev)) break; @@ -392,6 +396,10 @@ EvdevProcessEvent(InputInfoPtr pInfo, struct input_event *ev) break; case EV_ABS: + /* Ignore EV_ABS events if we never set up for them. */ + if (!(pEvdev->flags & EVDEV_ABSOLUTE_EVENTS)) + break; + if (ev->code > ABS_MAX) break; pEvdev->vals[pEvdev->axis_map[ev->code]] = value; @@ -1179,9 +1187,13 @@ EvdevInit(DeviceIntPtr device) FIXME: somebody volunteer to fix this. */ - if (pEvdev->flags & EVDEV_RELATIVE_EVENTS) + if (pEvdev->flags & EVDEV_RELATIVE_EVENTS) { EvdevAddRelClass(device); - else if (pEvdev->flags & EVDEV_ABSOLUTE_EVENTS) + if (pEvdev->flags & EVDEV_ABSOLUTE_EVENTS) + xf86Msg(X_INFO,"%s: relative axes found, ignoring absolute " + "axes.\n", device->name); + pEvdev->flags &= ~EVDEV_ABSOLUTE_EVENTS; + } else if (pEvdev->flags & EVDEV_ABSOLUTE_EVENTS) EvdevAddAbsClass(device); #ifdef HAVE_PROPERTIES |