HTML5 Canvas Input Focus

Hi,
I have a commercial HTML5 project with a 1st person camera. I’d like the mouse to become focused to the Canvas (so mouse movement will be locked to the canvas). Currently the mouse is simply overlying the canvas which picks up movement only when the mouse is moved when over it, which means you can only turn slightly before the canvas looses focus.

How can I make the html5 canvas take mouse input focus?

thanks

You can use emscripten_request_pointerlock from the emscripten API. for now. I know, Its an open bug for UE4, not too sure about the timeframe though.

emscripten API

Great, i’ll give that a go. Appreciate the reply, good to know it’s in hand :slight_smile:

This should be in main as of 2 weeks or so back