emscripten_request_pointerlock() regression?

24 views
Skip to first unread message

Floh

unread,
Jul 30, 2020, 3:54:29 PM7/30/20
to emscripten-discuss
Hi,

is anybody using the emscripten pointerlock functions and noticed any problems that pointer lock doesn't activate when emscripten_request_pointerlock() is called from within a mouse button event handler? I definitely had this working in old SDK versions (2 years ago or so, for instance see here: https://floooh.github.io/oryol-samples/wasm/BulletPhysicsBasic.html), but with the current SDK version it looks like I always get a EMSCRIPTEN_RESULT_FAILED_NOT_DEFERRED result even though I'm sure I'm calling it from within an event handler type which doesn't require deferred execution (specifically: on left mouse button down).

I'm requesting pointer-lock like this:

emscripten_request_pointerlock(canvas_name, false);

I'm now working around the problem by not calling emscripten_request_pointerlock() and emscripten_exit_pointerlock() but instead use my own EM_JS() functions, this appears to work fine (called from the same place where I called the emscripten API functions).

The pointerlockchange_callback works fine though.

Cheers,
-Floh.


Alon Zakai

unread,
Aug 3, 2020, 1:04:26 PM8/3/20
to emscripte...@googlegroups.com
We don't have CI tests for pointerlock, so it's possible something regressed. It would be great if someone has time to look into puppeteer or another test framework that supports that.

I'd suggest bisecting to find when that happened. If it regressed, we should add a test to `tests/test_interactive.py` which we at least run manually now and then.

--
You received this message because you are subscribed to the Google Groups "emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to emscripten-disc...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/emscripten-discuss/fbe7df6d-7cef-4a5f-9b91-da70bcb58b0an%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages