-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Implement Cursor Locking and input focus checks for it #9697
Conversation
Lock Mouse Cursor is disabled by default, right? |
Yes |
This works extremely well in practice with always hide mouse cursor and no matter how hard I tried to break it, I couldn't manage to get out of the window. |
f6d7be9
to
81b4017
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a good implementation for locking the cursor and seems to deal with all the issues I've encountered when handling the cursor in a locked area, such as accounting for aspect ratio. You can't really get any better than the OS call ClipCursor
. I recommend merging this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code changes seem sane to me
I attempted to break this in every way I knew how. Render to Main also tested. Wii and GC games, though I'm not sure why you'd want to lock the cursor in GC games maybe some people use mouse for c-stick. |
Add mouse cursor lock/capture setting to render widget on Qt (disabled by default):
When clicking on the render widget, the mouse get "trapped" inside of in, making the widget gain what is defined as "Full Focus". The mouse lock area follows the game aspect ratio, so the wiimote cursor won't accidentally get outside of the "listen" range.
There is also a hotkey to release/unlock the mouse, but ALT+TAB (or any window focus loss trigger) also does it.
Also added tooltips explaining the new setting and related ones.
The main advantages of cursor locking are:
Bug fixes:
Additional notes:
"Fixes":