[PATCH weston 4/8] shell: Update bindings to conform to pointer axis protocol

Jonas Ådahl jadahl at gmail.com
Fri Sep 28 06:09:26 PDT 2012


On Fri, Sep 28, 2012 at 2:47 PM, Pekka Paalanen <ppaalanen at gmail.com> wrote:
> On Fri, 28 Sep 2012 14:30:18 +0200
> Jonas Ådahl <jadahl at gmail.com> wrote:
>
>> On Fri, Sep 28, 2012 at 2:13 PM, Pekka Paalanen <ppaalanen at gmail.com> wrote:
>> > I have an old discrete-stepped mouse wheel, it reports:
>> >
>> > Event: time 1348834027.330811, type 2 (EV_REL), code 8 (REL_WHEEL), value 1
>> > Event: time 1348834027.330812, -------------- SYN_REPORT ------------
>> >
>> > and the other direction:
>>
>> Which one did you scroll downward?
>
> Negative is down, positive is up.
>
>> > Event: time 1348834027.906825, type 2 (EV_REL), code 8 (REL_WHEEL), value -1
>> > Event: time 1348834027.906827, -------------- SYN_REPORT ------------
>> >
>> > So it reports literally the number of "steps" it rotates. In urxvt on X,
>> > each step seems to scroll 5 lines.
>>
>> Ok, so to emulate the axis movement for the event it needs to move a
>> number of pixels per event. For the X11 compositor I made it move 10
>> pixels units per step, maybe can do the same with evdev. Is it worth
>> having discrete scroll events handled separately in another way (or
>> even both ways) as it could be good to be able to detect discrete
>> scroll movements correctly as well?
>
> Do you mean adding more protocol for discrete axis motion? I don't
> know. At first thought it seems just emitting motion in steps of 10 or
> whatever is good enough.
>
> Btw. the clarify pointer axis event -commit didn't make too much sense
> until I thought of touchpads. On mice, the motion and wheel are
> inherently in different, arbitrary units. One might even argue, that
> for wheels, the motion is an angle instead of a length. I don't have
> any strong opinions here, and I don't know how existing smooth
> scrolling works.
>

It makes most sense on touchpads indeed, but it is more or less the
only coordinate space we can relate to, as I see it. The other way to
make it more like the traditional protocols is to have 1 "step" be 1
unit, and have "smooth" scroll wheels or touchpads use fractions of 1
to step smaller steps. This would however make the coordinate space of
the axis event harder to relate to a surface, and I don't think it's
better.

Jonas


More information about the wayland-devel mailing list