evden and horizontal wheel

Dan Nicholson dbn.lists at gmail.com
Mon Oct 6 09:23:48 PDT 2008


On Mon, Oct 6, 2008 at 7:41 AM, Ander Conselvan de Oliveira
<ander at c3sl.ufpr.br> wrote:
> Hello,
>
> I have a user reporting his horizontal wheel is inverted using the evdev input
> driver. If I understand correctly, evdev handles positive values as "to the
> right" and negative as "to the left":
>
>            case REL_HWHEEL:
>                if (value > 0)
>                    PostButtonClicks(pInfo, wheel_right_button, value);
>                if (value < 0)
>                    PostButtonClicks(pInfo, wheel_left_button, -value);
>                break;
>
> But the, somewhat recent, kernel commit
> 740f370dc61dc478d891d7d47660bb3ae39ddb4f, by Dan Nicholson states:
>
> "Some Logitech mice have a tilt wheel which register as HWHEEL buttons. The
> events are positive for a click to the right and negative for a click to the
> left. Applications expect the opposite, though."
>
> Since I have no mice with horizontal scroll wheels, I have no idea what is the
> correct way to handle this.

This should definitely be fixed at the kernel level instead of hacking
around it in userspace. What kind of mouse does he have? I have 3 mice
with horizontal wheels: two Logitech and one Microsoft. I found that
the Logitech mice sent the events reversed to what the applications
expected. I.e., pushing the wheel to the right caused a gtk+
application to scroll left, and vice versa. With the Microsoft mouse,
pushing the wheel to the right caused the application to scroll to the
right.

The above commit message a wrote was simply the behavior I noticed,
and I don't know authoritatively what value applications expect. I do
know my mice work correctly with recent kernel (with above commit) and
recent xf86-input-evdev. A good way to test what the kernel is
outputting without X getting in the way is evtest, which google will
point you to, but I used the one from the linux-input CVS:

http://linuxconsole.sourceforge.net/quick.html#download

--
Dan



More information about the xorg mailing list