Don't allow relative and absolute axes on the same device.

This is a bit of a mess. The MS Optical Desktop 2000 registers both relative
and absolute axes on the same device (the mouse). The absolute axes have a
valid min/max range for x/y and thus overwrite the x/y relative axes in the
server (no, this is not a server bug). And I wouldn't be surprised if other
devices have similar issues.

Since the device only sends relative events after that, the mouse is
essentially restricted to the min..max range of 0..255. The server simply
doesn't do unrestricted relative axis and restricted absolute axis on the same
device (not for the same axis numbers anyway).
master
Peter Hutterer 18 years ago
parent 1b9deb8e7e
commit 8b7738457f
  1. 13
      src/evdev.c

@ -832,10 +832,19 @@ EvdevInit(DeviceIntPtr device)
EvdevAddKeyClass(device);
if (pEvdev->flags & EVDEV_BUTTON_EVENTS)
EvdevAddButtonClass(device);
/* We don't allow relative and absolute axes on the same device. Reason
Reason being that some devices (MS Optical Desktop 2000) register both
rel and abs axes for x/y.
The abs axes register min/max, this min/max then also applies to the
relative device (the mouse) and caps it at 0..255 for both axis.
So unless you have a small screen, you won't be enjoying it much.
FIXME: somebody volunteer to fix this.
*/
if (pEvdev->flags & EVDEV_RELATIVE_EVENTS)
EvdevAddRelClass(device);
if (pEvdev->flags & EVDEV_ABSOLUTE_EVENTS)
EvdevAddAbsClass(device);
else if (pEvdev->flags & EVDEV_ABSOLUTE_EVENTS)
EvdevAddAbsClass(device);
return Success;
}

Loading…
Cancel
Save