Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

key_moveup and key_movedown mapped to WHEEL_UP and WHEEL_DOWN jump two items in osd #133

Closed
Lovecraft-github opened this issue Nov 23, 2023 · 5 comments

Comments

@Lovecraft-github
Copy link

I have
key_showplaylist=SHIFT+ENTER MBTN_MID
key_moveup=UP WHEEL_UP
key_movedown=DOWN WHEEL_DOWN
key_playfile=ENTER MBTN_LEFT
key_closeplaylist=ESC SHIFT+ENTER MBTN_MID

to use the script with the mouse

Show and close the OSD and play the file selected with left click work fine but the mouse wheel jumps two items up and down instead of one.

mpv v0.37.0-7-g86b498ecc0 Copyright © 2000-2023 mpv/MPlayer/mplayer2 projects
built on Nov 22 2023 17:27:28
libplacebo version: v6.338.0-58-g2385b367
FFmpeg version: N-112826-g707e46dc54
FFmpeg library versions:
libavutil 58.32.100
libavcodec 60.34.100
libavformat 60.17.100
libswscale 7.6.100
libavfilter 9.13.100
libswresample 4.13.100

Ubuntu 23.10 with gnome 45.0

@jonniek
Copy link
Owner

jonniek commented Nov 23, 2023

I'm not able to reproduce this. If you do key_movedown=WHEEL_DOWN does it work correctly?

Could this be an issue with your mouse? Could you run mpv --input-test --force-window --idle and observe that when you scroll down only 1 input event is happening?

@Lovecraft-github
Copy link
Author

Lovecraft-github commented Nov 23, 2023

I'm not able to reproduce this. If you do key_movedown=WHEEL_DOWN does it work correctly?

Not, continue to jump from 1 to 3 to 5 etc

Could this be an issue with your mouse? Could you run mpv --input-test --force-window --idle and observe that when you scroll down only 1 input event is happening?

Seems to be 2 events

        input: Key WHEEL_DOWN is bound to:
        input: 1.  'add volume -2' in <builtin>:1 (default)
        input: 2.  'seek -10' in /home/user/.config/mpv/input.conf:43
        input: 3.  'script-binding osc/__keybinding10' in section {input} in <api>:6
        input: Key WHEEL_DOWN is bound to:
        input: 1.  'add volume -2' in <builtin>:1 (default)
        input: 2.  'seek -10' in /home/user/.config/mpv/input.conf:43
        input: 3.  'script-binding osc/__keybinding10' in section {input} in <api>:6

I tried 3 different mouses and happens with all of them

with xev it only show one event (press and release)

ButtonPress event, serial 38, synthetic NO, window 0xa00001,
root 0x3d1, subw 0x0, time 150021329, (157,1), root:(307,188),
state 0x10, button 5, same_screen YES

ButtonRelease event, serial 38, synthetic NO, window 0xa00001,
root 0x3d1, subw 0x0, time 150021329, (157,1), root:(307,188),
state 0x1010, button 5, same_screen YES

ButtonPress event, serial 38, synthetic NO, window 0xa00001,
root 0x3d1, subw 0x0, time 150023001, (157,1), root:(307,188),
state 0x10, button 4, same_screen YES

ButtonRelease event, serial 38, synthetic NO, window 0xa00001,
root 0x3d1, subw 0x0, time 150023001, (157,1), root:(307,188),
state 0x810, button 4, same_screen YES

@jonniek
Copy link
Owner

jonniek commented Nov 23, 2023

Interesting. It seems from my scripts point of view it is behaving correctly if we are in fact receiving 2 wheel down events from mpv. Could you just double check that this issue also applies to native mpv functionality like pause (instant pause and unpause on one scroll down).

I would recommend maybe opening an issue in mpv repository if you think it's an issue in mpv rather than your operating system or hardware.

@Lovecraft-github
Copy link
Author

Lovecraft-github commented Nov 23, 2023

Interesting. It seems from my scripts point of view it is behaving correctly if we are in fact receiving 2 wheel down events from mpv. Could you just double check that this issue also applies to native mpv functionality like pause (instant pause and unpause on one scroll down).

with WHEEL_DOWN cycle pause in input.conf

        input: Key WHEEL_DOWN is bound to:
        input: 1.  'add volume -2' in <builtin>:1 (default)
        input: 2.  'cycle pause' in /home/user/.config/mpv/input.conf:44
        input: 3.  'script-binding osc/__keybinding10' in section {input} in <api>:6
        input: Key WHEEL_DOWN is bound to:
        input: 1.  'add volume -2' in <builtin>:1 (default)
        input: 2.  'cycle pause' in /home/user/.config/mpv/input.conf:44
        input: 3.  'script-binding osc/__keybinding10' in section {input} in <api>:6

Same

I would recommend maybe opening an issue in mpv repository if you think it's an issue in mpv rather than your operating system or hardware.

I think I found the problem.

Is the wayland session. In a Xorg session using imwheel to change the scroll lines of the wheel button it obeys the value 1 lines, 2 lines, etc. Works fine without any imwheel modification too

But in the wayland session imwheel doesn't work and I don't know how to change the value and it seems to be 2 lines for event.

Do you think that is worth to post the problem in mpv?

@jonniek
Copy link
Owner

jonniek commented Nov 23, 2023

Nice debugging!

Do you think that is worth to post the problem in mpv?

Probably worth it. On a quick look it seems there is some wayland specific code in mpv. Not sure if that has anything to do with inputs though. If it consistently happens with all applications, then probably the issue is in wayland and could be reported elsewhere.

I'll close this issue as resolved!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants