Is there a workaround to receive keyboard input events without having to click once to focus the window?

Here is a basic playground with an on keyboard observable

I’m using Chrome browser on a laptop computer. It seems like the keyboard observable doesn’t work unless I first click on the scene with my mouse. Camera controls don’t work either unless I click on the canvas at least once. This causes confusion when my players expect to be able to move the camera right away as soon as the scene loads.

Is there a work around for this?

PG -

window.addEventListener("keydown",function (event) {
1 Like

Thanks! This works.

1 Like