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

mouseEntered and mouseExited do not work with Emscripten #6789

Closed
Jonathhhan opened this issue Nov 27, 2021 · 1 comment
Closed

mouseEntered and mouseExited do not work with Emscripten #6789

Jonathhhan opened this issue Nov 27, 2021 · 1 comment

Comments

@Jonathhhan
Copy link
Contributor

And my problem is, if the dragged mouse has left the window and is released outside of the window, it is still dragged if it enters the window again. You can test it with the sliders: https://puredatagui.handmadeproductions.de/
Is it possible to update the current mouse events, if the mouse enters the window?

@Jonathhhan
Copy link
Contributor Author

Jonathhhan commented Dec 1, 2021

I think I found a solution and added:

emscripten_set_mouseenter_callback("#canvas",this,1,&mouseenter_cb);
emscripten_set_mouseleave_callback("#canvas",this,1,&mouseleave_cb);

to:
https://github.com/Jonathhhan/openFrameworks/blob/AudioWorklet/addons/ofxEmscripten/src/ofxAppEmscriptenWindow.cpp

Only for fullscreen mode I still need to change something in the Emscripten code for calculating mouse coordinates. Would be nice to handle that in OF, too: https://github.com/emscripten-core/emscripten/blob/main/src/library_html5.js
emscripten-core/emscripten#15517

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