diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2009-02-24 11:32:40 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2009-02-26 09:11:14 +1000 |
commit | c9cab83bac32275f6851d2616bb749b3b2621ed6 (patch) | |
tree | 66d318d4b98db960569a7aca214758092b56f72b /src/evdev.c | |
parent | 43dd2a959243877c1628a08b4fc6c07c9ae6bac0 (diff) |
Ignore REL_WHEEL, REL_HWHEEL and REL_DIAL during axis initialisation.
We don't post the events for them anyway, so lets ignore them completely.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'src/evdev.c')
-rw-r--r-- | src/evdev.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/evdev.c b/src/evdev.c index 7112c11..d9e1367 100644 --- a/src/evdev.c +++ b/src/evdev.c @@ -1012,6 +1012,15 @@ EvdevAddRelClass(DeviceIntPtr device) if (num_axes < 1) return !Success; + /* Wheels are special, we post them as button events. So let's ignore them + * in the axes list too */ + if (TestBit(REL_WHEEL, pEvdev->rel_bitmask)) + num_axes--; + if (TestBit(REL_HWHEEL, pEvdev->rel_bitmask)) + num_axes--; + if (TestBit(REL_DIAL, pEvdev->rel_bitmask)) + num_axes--; + pEvdev->num_vals = num_axes; memset(pEvdev->vals, 0, num_axes * sizeof(int)); @@ -1024,7 +1033,11 @@ EvdevAddRelClass(DeviceIntPtr device) for (axis = REL_X; axis <= REL_MAX; axis++) { + pEvdev->axis_map[axis] = -1; + /* We don't post wheel events, so ignore them here too */ + if (axis == REL_WHEEL || axis == REL_HWHEEL || axis == REL_DIAL) + continue; if (!TestBit(axis, pEvdev->rel_bitmask)) continue; pEvdev->axis_map[axis] = i; |