This "feature" makes mouse locking unreliable in all GDevelop games

Go to any gdevelop FPS game/Third person game or any game where the mouse is locked on the application to move the camera’s angle, or make one yourself.

You’ll find that pressing the ESC key gets you out of the mouse lock that the game has and displays your cursor, stopping the first person camera, and not executing any events where “if ESC is pressed” unless you press it a second time. I’ve done a little bit of research, and I might be wrong, but I believe this is not a problem with the extension or GDevelop, but a default behaviour related to Javascript/Chromium/Electron, and I can’t really figure out a way to export a game without this thing turned on against my will.

I’m aware that this feature might make sense for browser games and all that, since browsers are designed to make life easier for the user at all costs, but this sucks TREMENDOUSLY for standalone desktop games where we want to create a pause menu ourselves whenever the player presses the Escape key, which is the standard in almost every single 3D game that locks your mouse in some way, from Half Life 1 to Cyberpunk 2077. How are we supposed to work around this? Can anything be changed to remove this?

1 Like

I was able to kiiiind of work around this by adding a pause menu with a cooldown whenever your mouse is not locked, but y’know now I can’t unlock my mouse during normal gameplay or else the pause menu triggers so.

1 Like