diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2009-09-30 12:05:17 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2009-10-07 12:55:22 +1000 |
commit | 941391ca34a7537542f0bb894fc0f02e200165b4 (patch) | |
tree | 577213d3cd91e48eb6207304dc335e5b12cdcdd7 /src | |
parent | Remove unused has_xy. (diff) | |
download | xf86-input-evdev-941391ca34a7537542f0bb894fc0f02e200165b4.tar.gz xf86-input-evdev-941391ca34a7537542f0bb894fc0f02e200165b4.tar.bz2 xf86-input-evdev-941391ca34a7537542f0bb894fc0f02e200165b4.zip |
Add explicit options to ignore relative or absolute axes.
The X server cannot deal with devices that have both relative and absolute
axes. Evdev tries to guess wich axes to ignore given the device type and
disables absolute axes for mice and relative axes for tablets, touchscreens
and touchpad. This guess is sometimes wrong and causes exitus felis
domesticae parvulae.
Two new configuration options are provided to explicitly allow ignoring an
axis. Mouse wheel axes are exempt and will work even if relative axes are
ignored. No property, this option must be set in the configuration.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Daniel Stone <daniel@fooishbar.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/evdev.c | 31 |
1 files changed, 23 insertions, 8 deletions
diff --git a/src/evdev.c b/src/evdev.c index 2b41343..59cdd0d 100644 --- a/src/evdev.c +++ b/src/evdev.c @@ -1776,6 +1776,7 @@ EvdevProbe(InputInfoPtr pInfo) { int i, has_rel_axes, has_abs_axes, has_keys, num_buttons, has_scroll; int kernel24 = 0; + int ignore_rel, ignore_abs; EvdevPtr pEvdev = pInfo->private; if (pEvdev->grabDevice && ioctl(pInfo->fd, EVIOCGRAB, (void *)1)) { @@ -1791,6 +1792,9 @@ EvdevProbe(InputInfoPtr pInfo) ioctl(pInfo->fd, EVIOCGRAB, (void *)0); } + ignore_rel = xf86SetBoolOption(pInfo->options, "IgnoreRelativeAxes", FALSE); + ignore_abs = xf86SetBoolOption(pInfo->options, "IgnoreAbsoluteAxes", FALSE); + has_rel_axes = FALSE; has_abs_axes = FALSE; has_keys = FALSE; @@ -1825,13 +1829,6 @@ EvdevProbe(InputInfoPtr pInfo) } if (has_rel_axes) { - xf86Msg(X_INFO, "%s: found relative axes\n", pInfo->name); - pEvdev->flags |= EVDEV_RELATIVE_EVENTS; - if (TestBit(REL_X, pEvdev->rel_bitmask) && - TestBit(REL_Y, pEvdev->rel_bitmask)) { - xf86Msg(X_INFO, "%s: Found x and y relative axes\n", pInfo->name); - } - if (TestBit(REL_WHEEL, pEvdev->rel_bitmask) || TestBit(REL_HWHEEL, pEvdev->rel_bitmask) || TestBit(REL_DIAL, pEvdev->rel_bitmask)) { @@ -1843,6 +1840,20 @@ EvdevProbe(InputInfoPtr pInfo) num_buttons = (num_buttons < 3) ? 7 : num_buttons + 4; pEvdev->num_buttons = num_buttons; } + + if (!ignore_rel) + { + xf86Msg(X_INFO, "%s: found relative axes\n", pInfo->name); + pEvdev->flags |= EVDEV_RELATIVE_EVENTS; + + if (TestBit(REL_X, pEvdev->rel_bitmask) && + TestBit(REL_Y, pEvdev->rel_bitmask)) { + xf86Msg(X_INFO, "%s: Found x and y relative axes\n", pInfo->name); + } + } else { + xf86Msg(X_INFO, "%s: relative axes present but ignored.\n", pInfo->name); + has_rel_axes = FALSE; + } } for (i = 0; i < ABS_MAX; i++) { @@ -1852,7 +1863,11 @@ EvdevProbe(InputInfoPtr pInfo) } } - if (has_abs_axes) { + if (ignore_abs && has_abs_axes) + { + xf86Msg(X_INFO, "%s: absolute axes present but ignored.\n", pInfo->name); + has_abs_axes = FALSE; + } else if (has_abs_axes) { xf86Msg(X_INFO, "%s: found absolute axes\n", pInfo->name); pEvdev->flags |= EVDEV_ABSOLUTE_EVENTS; |