Hi all. I recently noticed something that seems odd to me on 4.1 and 4.2 (but not 3.3 or 5.0alpha). I’m tempted to switch to 5.0, but this is for a public project, so I’d like to stick with the stable version (4.2) for now. Just wondering if anyone is aware of a temporary fix I can use until 5.0 is fully ready. Here are the details:
I want my users to be able to control the camera with both a mouse and a keyboard. When my scene initially loads, it does not respond to the keyboard. It is only after moving the camera with the mouse that the keyboard becomes responsive.
Even clicking on the canvas doesn’t seem to activate the keyboard. Only click and drag (to move the camera) does.
Here’s a playground: https://playground.babylonjs.com/#GFUP5D#3
After 1 second, the playground sets focus on the canvas and shows an alert message. After that (but without touching the scene with your mouse!), press the up arrow key. On 4.1 and 4.2, it does not respond to the keyboard. Now rotate the camera with your mouse and press the up arrow key again. It does respond.
In case it helps, here’s a demo scene outside the playground (using 4.2) so you can verify that it’s not because of the playground’s editor: https://durrantlab.com/tmp/babylon_probs/
Is there something I can add to my code to fix this behavior, without having to switch to 5.0alpha?