-
Notifications
You must be signed in to change notification settings - Fork 19
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
Menu closes immediately on opening with "ESC" #756
Comments
Proximal cause is that in |
This is weird - once mouse mode is entered, the mouse should be moved to the keyboard mouse position (aligned with the relevant menu item) via PositionKbdMouse, but if the mouse is at x=0 the wrong coordinates are returned via the GetAndReturnEvent call, for some iteration of the event loop inside MenuSelectImpl. |
I still haven't spotted it, but there's some subtlety where |
Hey @frankmilliron - was this in Virtual ][ ? I can repro in Virtual ][ but not in MAME (via Ample) so I'm wondering if this is actually an emulation issue. |
Indeed this is an emulation issue with Virtual ][. MAME correctly moves the mouse pointer to the active menu window as well, which V2 does not. I need to set up my //c so I can finally test this on real hardware. |
I'll report to Gerard. Thanks for confirming! |
Keyboard menu support (rejiggered only slightly in 5582bf0) was basically a hack on top of mouse menu control. During event checking, if keyboard control was enabled, then keys would effectively be translated into mouse deltas, which would in turn drive the menu selection. This caused the pointer to move during keyboard menu operations, and to be nice necessitated position save/restore logic. This is rewritten to make keyboard control inherent in the menu event loop. The current highlighted item is now decoupled from the mouse position, so keyboard control of the menu doesn't move the mouse at all. One feature or bug - I've heard it both ways - that goes away is that the previously keyboard-selected menu item is not the first one shown when Esc is pressed to enter the menu selection mode. Now, selection always starts on the first menu. This may be less convenient for power users, but is more predictable. Similarly, the unused and undocumented SetMenuSelection MGTK call is removed, since it controlled this state. As a side effect, this resolves #756, since menu behavior is not dependent on having POSMOUSE work correctly. And as usual in this code-base, any change which makes things work more sensibly tends to save bytes.
New keyboard menu logic works around this. |
To replicate:
place arrow pointer in farthest upper-left corner, hit "ESC" to open menus.
Menu closes immediately upon opening.
The text was updated successfully, but these errors were encountered: