I have this code:
Keyboard On SPACE pressed -> Browser Request Fullscreen Keyboard On ESCAPE pressed -> Browser Close
if I hit SPACE, game goes fullscreen, then ESCAPE, game goes back to windowed, hit ESCAPE again, game closes.
if I hit F11, game goes fullscreen, then ESCAPE, game immediately close.
is there a way to make the game do the latter and immediately close when hitting ESCAPE? (when hitting SPACE to make the game fullscreen and not F11?)
I think the ESC-Key is occupied by the browser in Fullscreen. So no key press comes through and isn't recognize. I think the easiest way is to choose another key like F12.
Develop games in your browser. Powerful, performant & highly capable.
Asmodean ah excellent thanks!