phillbush / xmenu

a x11 menu utility
Other
296 stars 26 forks source link

[FEATURE REQUEST] Warp pointer on scroll #26

Closed jzbor closed 3 years ago

jzbor commented 3 years ago

Hi, first of all thanks for the great work. I really appreciate xmenu. I find myself often trying to scroll thorough the entries to select one. Unfortunately to actually confirm/enter the entry one must either use the Enter-key which is difficult to reach when using the mouse or using the pointer which slows me personally down (it also makes the scrolling kinda obsolete). So i thought it would be great to have an option, where the mouse gets warped to the current entry when scrolling or entering a new submenu. I look forward to hear your opinion about it, Cheers.

phillbush commented 3 years ago

I don't quite understand what you want, sorry.

I find myself often trying to scroll thorough the entries to select one.

Do you mean scrolling with the mouse scroll or with the keyboard arrows?

Unfortunately to actually confirm/enter the entry one must either use the Enter-key which is difficult to reach when using the mouse

Using the mouse you can left-click on the entry to enter it.
You can also use the right-arrow key as an alias to the Enter key.

So i thought it would be great to have an option, where the mouse gets warped to the current entry when scrolling or entering a new submenu. I look forward to hear your opinion about it,

I don't see how this would help on the problem of accessibility.

jzbor commented 3 years ago

Sorry my post was admittedly misleading. I am talking only about using the mouse. I know about the keyboard shortcuts, but unfortunately they are all on the right hand side so they are very hard to use parallel with the mouse. In my experience using the scroll wheel much faster than using the pointer (certainly a personal preference) so I would really like was if navigating the menu with the scroll wheel on the mouse were possible. I also have a much simpler idea than mouse warping: You could just alias the middle click to the Enter-Key.

phillbush commented 3 years ago

I added support for mouse scrolling in the last commit.

jzbor commented 3 years ago

Thanks man really appreciate it! I found a bug though: If you enter a submenu it first warps you two the second entry then if you scroll down one unit it warps you to the first entry. It isn't really a problem to me just wanted to point it out.

phillbush commented 3 years ago

I reuse the same functions for selecting with up/down to scroll with the mouse scroll, so the scroll cycles to the first entry when it reaches the last entry. Does your submenu has only two entries? If it is the case it is just cycling to the first one.

I could not reproduce the warp-to-the-second-entry error here. Does your mouse send a scroll down event when you middle-click? Can you check it with xev(1)?

jzbor commented 3 years ago

I made a quick screencast. I used nothing but the scroll wheel (not middle click) and left click there...

This is the menu:

menu="DWM
      Fullscreen       dwmc togglefullscr
      Floating         dwmc togglefloating
      Zoom             dwmc zoom
      Close            dwmc killclient

Favourites
      Terminal         $TERMINAL
      Web              $BROWSER
      Media            mpv
      Mail             thunderbird
      Files            $FILEBROWSER
Applications            notify-send test
$(xdg-xmenu | sed -e 's/^/  /')

Menu                    menu.sh
System Menu             menu.sh system
Power Menu
      Shutdown         poweroff || sudo poweroff
      Reboot           reboot || sudo reboot
      Log out          pkill -15 -t tty\"$XDGVTNR\" Xorg"
phillbush commented 3 years ago

I used nothing but the scroll wheel (not middle click) and left click there

The problem of making left click work with both the mouse scrolling and mouse selection use case is that it has now to play two different behaviors depending on the context. So, for this use case, I have made the middle click be the button to use to enter an entry when selecting via mouse scroll. That is, use the middle click instead, because if I change the left click behavior, it would break the other use case.

jzbor commented 3 years ago

Ah thanks - works perfect! Great job!!!