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 Capture Handling #4842

Merged
merged 5 commits into from
Mar 24, 2020

Conversation

Web-eWorks
Copy link
Member

@Web-eWorks Web-eWorks commented Mar 24, 2020

See the commit messages for detailed information; this PR resolves a blocker for #4821 and fixes #4783.

In short, this PR removes the global, always-on mouse capturing when holding mouse buttons and replaces it with more intelligent, extensible handling via Input::SetCapturingMouse().

I've cleaned up mouse cursor handling as a follow-on to #4827, and fixed the input deadlock that was possible to enter as a result of the change to how we draw modals.

Opening the options window with Escape while in screenshot mode would
not draw the window, but would steal focus and deadlock the game's input

This is resolved by simply adding a path to draw modals even if
the UI is in "screenshot only" mode, as the escape menu should be
irrespective of that mode.
Moved mouse capture functionality from the renderer to Input
Temporarily patched ModelViewer, pending a major refactor to make it compatible with the input class.
Clean up mouse cursor code to use ImGuiMouseCursor_None
Ignore Pi::DrawGUI as it doesn't make sense for cursors
Among other reasons, this makes the cursor visible when interacting with radial menus
Lays more groundwork for better mouse handling
Copy link
Contributor

@fluffyfreak fluffyfreak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me

@Web-eWorks Web-eWorks merged commit a34b236 into pioneerspacesim:master Mar 24, 2020
@Web-eWorks Web-eWorks deleted the input-capture-mode branch March 24, 2020 19:44
@Web-eWorks Web-eWorks mentioned this pull request Jul 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

UI Stuck in state, can't get out after TAB TAB ESC
2 participants