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

Improve mouse navigation in overlay menus #748

Merged
merged 2 commits into from
Jul 12, 2023

Conversation

mbarnes
Copy link
Contributor

@mbarnes mbarnes commented Jun 25, 2023

Two changes to FeOverlay::event_loop():

  • In the event of a mouse move, reset the mouse position to the middle of the window if it strays outside the mouse capture area.

  • Do not wrap around the selected menu item if the first or last menu item was reached by a mouse move event.

This makes overlay menus easier to navigate using a trackball or rotary spinner that presents as a mouse device.

Additional context:

I use Attract-Mode in a cocktail-style arcade cabinet with swappable control panels. For panels where the only directional control is a trackball or rotary spinner, I have Attract-Mode's input map configured to include Mouse Up for up and Mouse Down for down:

$ cat ~/.attract/attract.cfg
...
input_map
        ...
        up                   Up
        up                   R
        up                   Mouse Up
        down                 Down
        down                 F
        down                 Mouse Down
        ...

But mouse navigation in the overlay menus -- even just the exit confirmation dialog -- has been quite difficult. Mouse movement is erratic and hard to control with any precision. This pull request attempts to fix it.

@mbarnes mbarnes force-pushed the mouse-menu-navigation branch 3 times, most recently from c1330c3 to 9bb46e0 Compare June 25, 2023 18:05
Two changes to FeOverlay::event_loop():

- In the event of a mouse move, reset the mouse position to the
  middle of the window if it strays outside the mouse capture area.

- Do not wrap around the selected menu item if the first or last
  menu item was reached by a mouse move event.

This makes overlay menus easier to navigate using a trackball or
rotary spinner that presents as a mouse device.
mbarnes added a commit to mbarnes/arcade-ansible that referenced this pull request Jun 26, 2023
Back to my own fork again, which is 2.7.0 plus my pull request to
improve mouse navigation in overlay menus.

mickelson/attract#748
@mickelson mickelson merged commit bee4233 into mickelson:master Jul 12, 2023
4 checks passed
@mickelson
Copy link
Owner

thanks!

@mbarnes mbarnes deleted the mouse-menu-navigation branch August 29, 2023 22:01
@mbarnes mbarnes restored the mouse-menu-navigation branch August 30, 2023 08:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants