evden and horizontal wheel

Dan Nicholson dbn.lists at gmail.com
Mon Oct 6 10:06:17 PDT 2008


On Mon, Oct 6, 2008 at 9:50 AM, Ander Conselvan de Oliveira
<ander at c3sl.ufpr.br> wrote:
> Em Monday 06 October 2008 13:23:48 Dan Nicholson escreveu:
>> 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?
>
> His mouse is a Logitech V150.

Huh, OK. Let me take another look when I get home and make sure that
the behavior is as I described it.

>> 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:
>
> The kernel seems to output the correct values (he's using a kernel with the
> above commit) [0]. The way I see it, this should not work with the current
> evdev driver, since wheel_right_button clicks are posted when the value
> reported by the kernel is positive.
>
>        [0] https://qa.mandriva.com/show_bug.cgi?id=44309#c19

I hadn't looked at the code in xf86-input-evdev before, but it does
make sense as you've described it. I don't know why the behavior I was
seeing was different. AFAIK, there hadn't been any remapping on my
system except for the kernel patch I produced.

--
Dan



More information about the xorg mailing list