diff options
author | Peter Hutterer <peter@cs.unisa.edu.au> | 2008-04-30 18:10:08 +0930 |
---|---|---|
committer | Peter Hutterer <peter@cs.unisa.edu.au> | 2008-05-02 11:17:57 +0930 |
commit | 8b7738457feef13e1fab88bb30c94093dd8bfcc5 (patch) | |
tree | f8cb894d02758e18cc340854e9cc0a3fe9482172 | |
parent | 1b9deb8e7e50a905f94a371ab0aa39e09a703052 (diff) |
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).
-rw-r--r-- | src/evdev.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/evdev.c b/src/evdev.c index f2ecdd2..9b1ea4f 100644 --- a/src/evdev.c +++ b/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; } |