kitao / pyxel

A retro game engine for Python
MIT License
15.31k stars 847 forks source link

Web app unable to capture input focus once lost #540

Closed helpcomputer closed 3 months ago

helpcomputer commented 5 months ago

If you play a Pyxel web game and click outside the window you're unable to recapture input focus of the app.

I tried it with the the below games, same behaviour for both, in Chrome and Firefox:

https://fbrzd.itch.io/tiny-tale https://helpcomputer.itch.io/vortexion

It seems fine when the game launches in full screen, for example in the case of the below game, you can click outside the game but can regain input capture:

https://aged99oow.github.io/mario/

helpcomputer commented 3 months ago

Just an addition to this, users also reporting the same issue with the game uploaded to itch, I think it will be worth looking into this soon to avoid further issues (https://helpcomputer.itch.io/vortexion): image

kitao commented 3 months ago

I updated Emscripten and other Web-related external libraries by updating Pyxel's code. https://fbrzd.itch.io/tiny-tale looks fine but https://helpcomputer.itch.io/vortexion doen't work (probably, by some another reason).

Please check it.

helpcomputer commented 3 months ago

It's a real problem that a web game can break without the developer of the game changing anything.

But, I fixed the new issue with sound/music play so it works again. Input is also working again now, thanks!