disable esc to exit full screen?

I realize that the web player uses Esc as a safety mechanism for users to exit full screen. However, I want to use Esc for doing other things in my game, like canceling an action. Is it possible to disable to "Esc to exit full screen" functionality? I have a button on my interface, with code that toggles full screen, so I don't need the Esc to exit.

3 Answers

3

That's not a up to you. If you have the webplayer installed Unity content on a webpage will load automatically. It's much more important for the user to have a save way to get the focus back and exit the full screen. Otherwise you can trap the user in your application without a way to get out.

So the simple answer to the question is: NO.

Use another key for menu (since “escape” is even more suitable for “get me outa here” than “open the menu”). I know, most standalone games use escape for menus or navigation but the webplayer is something different. You have to live with it.

Yep, it would be really bad if it was possible to disable this functionality. Maybe you're being nice and providing an alternate way of getting out of fullscreen, but not everybody is necessarily going to do that, leaving you stuck in fullscreen with no way out. It's not feasible to allow that to happen by disabling expected behavior.

That's a lame comment. Stupidity is universal.

Eric, I understand the reasoning behind it, but I think it would be better if the Unity player automatically confirmed with the user before going into fullscreen, rather than using up a commonly used key within games. After all, I can't imagine that the standalone builds exit full screen with Esc, though the same argument exists regarding getting stuck in full screen mode. The only difference is that the web player will automatically start (hence the confirmation). Oh well. I guess players will have to get used to it.

Hi @Bunny83 , I understand that this logic should be in the WebGL Build. However, this seems counter intuitive with standard Standalone builds. I do expect the menu to be in Escape every single time. Can this esc to escape full screen function be disabled on Standalone builds? Thanks!

why not use tilde (~) instead. it's close enough to escape to be useful for things like that.

Well, that depends on your keyboard layout ;). On my keyboard(german) the tilde is the third case on my plus(+) key, that would not be a nice key for me :D. Below the escape key i have the circumflex (^). It's not that easy to find a key that stays the same on all keyboard layouts. Well, you can use Application.systemLanguage to do a switch case for each language :D

Hi @Bunny83 , I understand that this logic should be in the WebGL Build. However, this seems counter intuitive with standard Standalone builds. I do expect the menu to be in Escape every single time. Can this esc to escape full screen function be disabled on Standalone builds? Thanks!