Improve mouse navigation in overlay menus #748
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
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.