Possible bug with input handling
tiago.vignatti at linux.intel.com
Thu Dec 8 15:01:42 PST 2011
On 12/08/2011 09:34 PM, Christopher Michael wrote:
> On 12/08/11 10:14, Tiago Vignatti wrote:
>> Hi, sorry for late reply.
>> On 11/29/2011 08:30 PM, Christopher Michael wrote:
>>> I found an issue while working on some local code, that may be a bug in
>>> the input handling of Wayland.
>>> In my function to process button events (from mouse), the 'btn'
>>> parameter that gets returned to my handler seems incorrect for Wheel
>>> Basically, mouse wheel down events are coming in as BTN_EXTRA, and mouse
>>> wheel up events are coming in as BTN_SIDE. This seems incorrect to me :/
>>> In my opinion, these should be perhaps BTN_FORWARD/BTN_BACK or maybe
>>> In <linux/input.h> there resides a BTN_WHEEL value ... perhaps that
>>> should be used for the returned 'btn' parameter, and the 'state'
>>> parameter could be set to BTN_GEAR_UP/DOWN ?? It would make more sense
>>> imo. Here is some short 'pseudo' code to illustrate what I mean.
>>> _cb_handle_button(void *data, struct wl_input_device *dev, uint32_t t,
>>> uint32_t btn, uint32_t state)
>>> if (btn == BTN_WHEEL)
>>> if (state == BTN_GEAR_DOWN)
>>> printf("Mouse Wheel Scrolled Down\n");
>>> else if (state == BTN_GEAR_UP)
>>> printf("Mouse Wheel Scrolled Up\n");
>>> As I am fairly new to Wayland, I am not sure where the issue actually
>>> resides or what the proper fix would be, so I cannot provide a patch to
>>> fix it :/
>> BTN_WHEEL event is quite bizarre because it doesn't seem to be forwarded
>> by any device. Are you using X11 or drm compositor btw? Can you run
>> evtest  and show the output when you scroll up/down?
>>  http://cgit.freedesktop.org/evtest/
> I am using the X11 compositor. Here is the output from evtest when
> scrolling up/down on the wheel:
oh, that's "expected" behavior within X11 compositor cause, even with
the last chances from today, we're not forwarding wheel events as they
should to clients cause requires protocol changes. We're not treating
correct either on drm compositor (evdev) case.
If you wanna hack around your code, you can take a look on a branch I
was playing with axis and wheel, on evdev:
More information about the wayland-devel