mpv icon indicating copy to clipboard operation
mpv copied to clipboard

wayland: several mouse buttons are detected wrong

Open Nikoli opened this issue 13 years ago • 15 comments

Not sure it is mpv bug or wayland or xkbcommon, but using mouse with mpv in weston-1.2.0 does not work fine. I have these lines in /etc/mpv/input.conf:

MOUSE_BTN0 cycle pause
MOUSE_BTN0_DBL ignore
MOUSE_BTN1 quit
MOUSE_BTN2 cycle fullscreen
MOUSE_BTN3 cycle sub
MOUSE_BTN4 cycle audio
MOUSE_BTN7 add volume -1
MOUSE_BTN8 add volume 1

With X11 config works fine, but with wayland many buttons do wrong commands:

MOUSE_BTN0 cycle pause
MOUSE_BTN0_DBL ignore
MOUSE_BTN1 cycle fullscreen
MOUSE_BTN2 quit
MOUSE_BTN3 cycle sub
MOUSE_BTN4 cycle audio
MOUSE_BTN7 cycle sub
MOUSE_BTN8 cycle audio

Nikoli avatar Jul 16 '13 15:07 Nikoli

Can you post the output of mpv when you run it with the following environment variable set?

WAYLAND_DEBUG=1

The file will probably be very big so don't run mpv too long.

giselher avatar Jul 17 '13 06:07 giselher

Here it is http://bpaste.net/raw/115061/

Nikoli avatar Jul 17 '13 19:07 Nikoli

Started mpv and pressed right mouse button.

Nikoli avatar Jul 17 '13 19:07 Nikoli

Sorry I can't reproduce this behavior. Have you tried it with a different mouse with less buttons? Because it looks like 2 buttons are switched and the other 2 buttons do the same thing.

Also could you please post a log where you press every mouse button and post your mouse model.

giselher avatar Jul 18 '13 07:07 giselher

Same problem with "normal" (2 buttons+wheel = 5 buttons) mouse.

Nikoli avatar Jul 24 '13 17:07 Nikoli

log was provided to you in irc.

Nikoli avatar Jul 24 '13 17:07 Nikoli

Sorry I can't find the WAYLAND_DEBUG log in my irc logs. Could you please post a link here. The problem is that I am always online but not always on my personal computer.

giselher avatar Jul 24 '13 18:07 giselher

http://bpaste.net/raw/115061/

Nikoli avatar Jul 24 '13 18:07 Nikoli

I mean a log where you press every button on the mouse plus mouse wheel.

giselher avatar Jul 24 '13 18:07 giselher

http://bpaste.net/raw/117049/

Nikoli avatar Jul 24 '13 19:07 Nikoli

Thank you, could you also please post the output of the following line, just in case.

grep BTN_LEFT /usr/include/linux/input.h

giselher avatar Jul 24 '13 19:07 giselher

I guess the first button you pressed was the left mouse button, then right and as last you pressed mousewheel? The only strange thing I noticed is that there is no left putton release event sent

giselher avatar Jul 24 '13 19:07 giselher

$ grep BTN_LEFT /usr/include/linux/input.h 
#define BTN_LEFT                0x110

I pressed left button, right button, rotated wheel both directions, pressed 2 additional buttons, pressed wheel.

Nikoli avatar Jul 24 '13 19:07 Nikoli

Current State: BTN3 and BTN4 are hardcoded for mouse axis events (mouse wheel), which is bad imo.

A suitable solution would be to add new input identifiers like AXIS_LEFT/UP/DOWN/RIGHT and while we're at it we should also add a scale factor to the properties which take numerals. This would make it possible to use precise seeking through precise scrolling of input devices that support such a hardware feature.

giselher avatar Aug 05 '13 18:08 giselher

This is fixed f364a1e3dfb78239985b3068e079544bbff6d66f . But now you have to add AXIS_UP/DOWN events in your input.conf file and assign it the same function as BTN3/BTN4. Sadly now it behaves differently than the other backends.

giselher avatar Aug 07 '13 20:08 giselher