Is it possible to avoid having the escape key exit fullscreen in a WebGl build?


I know that the escape key exitting fullscreen is a secutiry feature of most browsers and I know that it is also a user experience feature. However my play testers have all said they would love to be able to close menus in my game by pressing escape without leaving full screen. How would I go about this or is this just one of those “That’s the price of making a browser game”.

I have tried searching online but all answers that I could find to this issue were very old and were based on the old webplayer and thus do not work.


That’s the price of making a browser game

Exactly. This feature is not for improving user experience, it’s a safety feature. A web page cannot be allowed to do things that keep the user from closing it. This is why the “This website asks you to stay on it” popup is implemented through a simple flag, and the browser handles it, not the web page.

Giving devs the ability to “re-bind” escape would open up ways for a lot of malicious websites.

Yea thought as much, and it makes a lot of sense as well I agree with it. Just gonna bind my menu stuff to tab - thanks =)