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

Web: Lock cursor in FullScreen #53

Open
eprikazchikov opened this issue Dec 31, 2024 · 2 comments
Open

Web: Lock cursor in FullScreen #53

eprikazchikov opened this issue Dec 31, 2024 · 2 comments

Comments

@eprikazchikov
Copy link

Hello! First of all thank you for your effort of maintaining this lib.
Could you help me to understand how to handle mouse in lock/hide mode in Full Screen?
Seems like glfm doesn't supports this mode?
And probably Resize canvas as well.

image

@eprikazchikov
Copy link
Author

eprikazchikov commented Jan 2, 2025

I have spent some time to investigate this bit deeper. You are handing mouse inputs trough set of callbacks like
glfm__mouseCallback

In mouse lock mode event->targetX stays the same. But event->movementX contains the delta of movement. Unfortunately I haven't found any related callback in GLFM to push this data to application.
Will appreciate for any suggestions.

@eprikazchikov
Copy link
Author

Regarding ResizedFunc callback. I have noticed that function triggers each frame in case of Browser Zoom value is different from 100%. I suppose this behavior is related to code:
int displayChanged = EM_ASM_INT_V({
Seems like it returns always positive in this case.

At the same time it doesn't handles the full screen case. It should be done using separate callback: emscripten_set_fullscreenchange_callback

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

1 participant