- Home /
Is it possible to avoid having the escape key exit fullscreen in a WebGl build?
Hi!
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.
references:
https://docs.unity3d.com/Manual/webgl-cursorfullscreen.html
https://stackoverflow.com/questions/42799229/escape-input-key-with-unity3d-web-gl-build?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa
https://docs.unity3d.com/Manual/webgl-input.html
Answer by FlaSh-G · May 28, 2018 at 01:20 PM
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 =)
Your answer
![](https://koobas.hobune.stream/wayback/20220612163324im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Problem on full screen web-gl virtual joystic 0 Answers
Can I keep the computer awake using Unity WebGl? 0 Answers
How to use CursorLockMode in webGL 0 Answers
Set aspect ratio in fullscreen WebGL? 2 Answers