Skip to content

[rcore][web] Support mouse position update on HideCursor() #4955

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

Closed

Conversation

Moros1138
Copy link
Contributor

Fixes Issue #4940

The problem is relatively simple, CORE.Input.Mouse.cursorHidden was being used for both hiding the cursor and locking the cursor. This PR adds a variable to track when the cursor is locked so that the 2 states can be tracked independently of eachother.

@raysan5
Copy link
Owner

raysan5 commented May 29, 2025

@Moros1138 My concern with this change is if it will change examples behaviour between platforms... if that's the case it should be addressed on all platforms.

@raysan5 raysan5 changed the title [rcore][web] fix mouse position locking in HideCursor [rcore][web] Support mouse position update on HideCursor() May 29, 2025
@raysan5 raysan5 added the platform: Web Web platform label May 29, 2025
@Moros1138
Copy link
Contributor Author

Sorry for the after-editing, I compared the behavior with windows and made further changes to make the way web handles it closer to how it works on windows.. Here's a video

demo-mouse-hide-lock.mp4

@Moros1138
Copy link
Contributor Author

Moros1138 commented May 29, 2025

@Moros1138 My concern with this change is if it will change examples behaviour between platforms... if that's the case it should be addressed on all platforms.

@raysan5 I was seeking to make the web platform work more as it does on windows. See video in previous post.

@Moros1138
Copy link
Contributor Author

Is there a blocker for this PR that I have missed?

@raysan5
Copy link
Owner

raysan5 commented Aug 12, 2025

@Moros1138 Just tested it and it breaks DisableCursor() behaviour, you can test core_3d_camera_first_person.

Please, be careful testing those PRs, there are many platforms and use cases involved and one solution for one of those could break other things.

@raysan5
Copy link
Owner

raysan5 commented Aug 12, 2025

Just reviewed required code to add a new state.

@raysan5 raysan5 closed this Aug 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform: Web Web platform
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants