Fixing shift and exclusive mouse mode #472
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.
Fixes an issue with shift not being called correctly on multiple windows. It now follows where your keyboard is focused. Also resets shift state when the focus is lost (will be gained again if still being held on return to window)
Fix multiple issues with exclusive mode:
Removed the raw input requiring the view_hwnd, it just goes off of where your keyboard has focus.
Added a raise exception to show information on possible NULL issue with the
_view_hwnd
.Was tested in Windows 10. Any feedback and additional testing appreciated.
Note:
There is still an issue with random hierarchy issues where the mouse can become visible again in exclusive mode, if the window rapidly loses/gains focus, but it seems pretty rare. It seems some libraries (SDL2) just have a schedule that checks every so often if the ClipCursor area was superseded by another window and then re-applies it. Not sure we need to go that intensive on it.