diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2009-02-26 12:09:33 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2009-02-26 14:35:46 +1000 |
commit | 178435832f5f6988e58fddc4ffe82ddc032d9dce (patch) | |
tree | 91268fba3cf55b9a75837a97409e6e46c4fa66b9 | |
parent | c9cab83bac32275f6851d2616bb749b3b2621ed6 (diff) |
If scrollwheels are found, bump the button number by 4 (or up to 7).
Scrollwheel data is always posted as buttons, so we need to advertise at least
enough buttons to accommodate for 6/7 (horizontal wheel).
Note that this may mean that if you have a device that has scroll wheels and
axes, but no buttons, it may be interpreted as a mouse.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r-- | src/evdev.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/evdev.c b/src/evdev.c index d9e1367..c53e3af 100644 --- a/src/evdev.c +++ b/src/evdev.c @@ -1450,6 +1450,11 @@ EvdevProbe(InputInfoPtr pInfo) TestBit(REL_HWHEEL, pEvdev->rel_bitmask)) { xf86Msg(X_INFO, "%s: Found scroll wheel(s)\n", pInfo->name); has_scroll = TRUE; + if (!num_buttons) + xf86Msg(X_INFO, "%s: Forcing buttons for scroll wheel(s)\n", + pInfo->name); + num_buttons = (num_buttons < 3) ? 7 : num_buttons + 4; + pEvdev->buttons = num_buttons; } if (TestBit(ABS_X, pEvdev->abs_bitmask) && |