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

Implicitly confine the cursor when it can't leave to another display #5210

Merged
merged 4 commits into from
Jun 6, 2022

Conversation

Susko3
Copy link
Member

@Susko3 Susko3 commented May 29, 2022

Previously, moving the mouse outside the window in fullscreen would warp it and give back control to the OS. The OS would then warp the cursor back into the game window. In this short period, the cursor would jitter between being inside and outside the window.

The solution provided is not perfect, the cursor can still jitter if Sensitivity < 1:
Eg. on a 1920x1080 display, it can go down to 1079.9999999999, but will warp to 1079 flat. Importantly, it'll never leave the window.

This can probably be fixed by checking if there are adjacent displays, and then warping if > 1079 instead of >= 1080, but it's not really that important. (Always checking for > 1079 would leave the cursor in an invalid position when it's in-between two displays—potentially preventing it from escaping the window.)

@peppy
Copy link
Member

peppy commented Jun 6, 2022

Conceptually this makes sense. Going to get it in for battle testing.

@peppy peppy enabled auto-merge June 6, 2022 06:10
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.

hitboxes on the mods/random/options buttons are a bit wacky
2 participants