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

HTML5 backend doesn't support setMouseLock #1730

Open
BSlug opened this issue Dec 9, 2023 · 1 comment
Open

HTML5 backend doesn't support setMouseLock #1730

BSlug opened this issue Dec 9, 2023 · 1 comment

Comments

@BSlug
Copy link

BSlug commented Dec 9, 2023

The HTML5 backend's function to lock the pointer is currently NOP.

Only calling the canvas field's requestPointerLock() method is insufficient. Rather than using a mousemove event's movementX/movementY fields to determine relative mouse movement, the backend currently uses cached clientX and clientY, which has the unfortunate side-effect of not working when the pointer is locked.

BSlug added a commit to BSlug/lime that referenced this issue Dec 9, 2023
@joshtynjala
Copy link
Member

I'm guessing that requestPointerLock() didn't exist at the time that mouse lock was originally implemented for the other targets that support it, so that's why it's NOOP for now.

It's probably not too difficult to switch to movementX/movementY once support is added.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants