You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now on macOS, the cursor just gets locked to its current location, instead of getting locked to the area of the window. A proper solution that locks the cursor to the window exists and is documented, but hasn't been implemented yet.
Can anyone merge this PR? This feature is critical for developing cross-platform video games. If we cannot set mouse grab on macOS, then camera movement will become quite weird there.
Sorry for mistaking this as a PR. If it's the OS's fault, then that's acceptable limitation. Also I just found out that it works when locking is used after setting the cursor to somewhere in the window.
Activity
panda2134 commentedon Oct 16, 2022
Can anyone merge this PR? This feature is critical for developing cross-platform video games. If we cannot set mouse grab on macOS, then camera movement will become quite weird there.
kchibisov commentedon Oct 16, 2022
@panda2134 this is not a PR, it's an issue. macOS has locking, but not confining.
panda2134 commentedon Oct 16, 2022
Sorry for mistaking this as a PR. If it's the OS's fault, then that's acceptable limitation. Also I just found out that it works when locking is used after setting the cursor to somewhere in the window.
kchibisov commentedon Oct 16, 2022
Yes, the cursor should be in the window to lock it. that's how it works on most OSes.
swiftcoder commentedon Oct 16, 2022
You can simulate proper cursor grabbing with the cursor lock API, by only locking after the user first clicks in the window.
(I believe this is required for Web anyway, because you can only grab the cursor in response to user interaction?)
Do not grab cursor on MacOS
Do not grab cursor on MacOS