raylib icon indicating copy to clipboard operation
raylib copied to clipboard

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

Open Moros1138 opened this issue 8 months ago • 3 comments

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.

Moros1138 avatar May 28 '25 12:05 Moros1138

@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 avatar May 29 '25 10:05 raysan5

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

https://github.com/user-attachments/assets/6881cd6b-cae6-459f-8e6f-16d6ebcb8e69

Moros1138 avatar May 29 '25 10:05 Moros1138

@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 avatar May 29 '25 10:05 Moros1138

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

Moros1138 avatar Aug 09 '25 17:08 Moros1138

@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 avatar Aug 12 '25 08:08 raysan5

Just reviewed required code to add a new state.

raysan5 avatar Aug 12 '25 09:08 raysan5