Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Removing "Press Esc to exit fullscreen" message

Discussion in 'Editor & General Support' started by Factoid, Mar 30, 2008.

  1. Factoid

    Factoid

    Joined:
    Mar 30, 2008
    Posts:
    69
    Hi folks,

    I'm working on an application targeting both the web and standalone, it's important to me to get a consistent user experience on both platforms.

    I'm using the following script to toggle between fullscreen and windowed mode, which is activated by clicking on a custom gui widget in the top right corner of the screen.

    Code (csharp):
    1. private var windowHeight = 0;
    2. private var windowWidth = 0;
    3.  
    4. function Start()
    5. {
    6.     windowHeight = Screen.height;
    7.     windowWidth = Screen.width;
    8. }
    9.  
    10. function OnGUILeftUp()
    11. {
    12.     if( !Screen.fullScreen )
    13.         Screen.SetResolution( Screen.currentResolution.width, Screen.currentResolution.height, true, 0 );
    14.     else
    15.         Screen.SetResolution( windowWidth, windowHeight, false, 0 );
    16. }
    Are there any params I can give to the unity web player to make it disable the "Press esc" message? I've got no problem with the "esc" from fullscreen function (in addition to my own toggle), I just don't want that message showing up in the webplayer, since it doesn't in the standalone client.
     
  2. NicholasFrancis

    NicholasFrancis

    Joined:
    Apr 8, 2005
    Posts:
    1,587
    No, that message is a security feature to prevent fullscreen unity web players from being used for phising and the like.

    There is no way to prevent it showing up.

    It's a real shame, but it's just one of the things you have to factor in when developing for the web.
     
  3. Jessy

    Jessy

    Joined:
    Jun 7, 2007
    Posts:
    7,325
  4. mrepetto

    mrepetto

    Joined:
    May 30, 2009
    Posts:
    10
    Is it possible to use OTHER key than the esc key? because esc key usually bring out the pause menu or other types of menu and when in fullscreen it get inconsistent.

    I agree and understand on the issue of phishin and that the dialog its a must have, but can we redefine that esc key to something else? and have that appear in the dialog?
     
  5. HiggyB

    HiggyB

    Unity Product Evangelist

    Joined:
    Dec 8, 2006
    Posts:
    6,183
    No, and it's not likely something that we're going to implement either (sorry for the gruff reply I'm just being honest about the state of affairs). So you'll have to find another key to use in your games for menus and the like as escape is reserved for exiting full-screen as well as unlocking cursor-lock/hide.
     
  6. mrepetto

    mrepetto

    Joined:
    May 30, 2009
    Posts:
    10
    For the record, we are not asking to remove the functionality of having some "hardcoded" key for leaving fullscreen nor even take that dialog out, I think it has to be there and you guys are right, what we need is the ability to redefine that "esc" key, because as you may be aware, is usually the pause in many many games, also is intuitive when you are playing :D. We could then redefine CONTROL+ESC to leave fullscreen or ALT+ESC or you what have you, and that new info should appear in the hardcoded fullscreen dialog for the user to know.
    Hi there HiggyB,

    The main problem that we have is that our game brings out the pause menu in window mode, and when in fullscreen, you want to pause and you are being taked out of fullscreen and then paused its really annoying and the game experience gets "corrupted". There are several other web browser big games out there with the same problem that reached a solution by using the esc key for menu. Shiva has an FPS example that shows this, also quake live has the same behavior than us and they use the esc bringing the pause menu and to leave fullscreen you just quit the game.

    I've also see the point you've mention in fullscreen plugins for casual games, being the esc a default to get out of fullscreen (flash games and the like) but we are pushing the limits of unity trying to do something unique and big, and this really affects the experience. I will submit a request to feedback but I am guessing we will have no answer, not in the short term tho, and we are about to launch.

    Sorry for the gruff comment as well, but I think that not allowing us to redefine the esc key is a step in the wrong direction as many games in the browser are getting more big and potentially hardcore, and in PC gaming history the esc key was usually used for the pause menu. I know that the "browser" its a different story, but right now we are seeing more and more that the browser is just another vehicle to get desktop like content with desktop like features and functionality.

    thanks anyway,

    btw: we have a workaround that is indeed not pretty at all, but it does the trick.

    regards,

    Martin
     
  7. jedy

    jedy

    Joined:
    Aug 1, 2010
    Posts:
    579
    I agree, Esc could be used for removing mouse focus from the application, but F11 is much more cleaner option for fullscreen.

    Most of the gamers are used to the Esc key in the "Show me the menu" scenario, and it could be pretty troublesome. Switching that functionality in full screen to the F11 key ( used for switching the browsers fullscreen state ) would prove only as a plus.

    Atop of that if someone is trying to create a full screen that could not be stopped there are a few workarounds that work decently well, which acutally makes sticking to the Escape key pretty redundant.
     
  8. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    for normal games that true about esc. normal game means standalone

    but for web stuff, ESC is defacto the standard for "exit into default state", especially exit from fullscreen, that includes movie players as well as flash in general.

    You can decide to not like it if you want, but then you won't develop for web.
    After all what the key esc, for those who have forgotten it also known as ESCAPE, is about and has always been about.
    desktop games just use the exit in a different context than the rest
     
  9. jedy

    jedy

    Joined:
    Aug 1, 2010
    Posts:
    579
    Okay, fair enough.

    If it can not be set from developers side, there is an option that could satisfy all sides.

    Leave the Escape key as it is. Just add a box in the Unity3d setup ( http://cdn2.unity3d.com/setup-3.x/ ) for the user himself to chose the most efficient key for himself, and with Escape the default option.

    Slick, clean everyone is happy.
     
  10. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    No, not everyone.
    Users of web applications are used to ESC for leaving fullscreen, thats the standard.
    So its not open to debate if that is going to work like that or not. Its just like that, just cause a few unity devs think that cheap desktop to web ports would "benefit from breaking the standard" it won't happen.
    You have the option to get corresponding buttons on the screen if you want to show a menu without a different button or use P as it used to be in games before the ESC missuse started (cause P is the by far most logical key for it due to Pause). That being said not even today ESC is consistent, some use it to get into pause, others to get out of the menues back into the game and stuff like that. Something between laughable and just stupid to not have it exiting to one designated state and point (ie escape to the 'exit point' for what the key was meant)


    If you want to let the user configure an additional key to get out of the fullscreen, then thats open to debate naturally, but does not require any unity addition as you already can do that.
     
  11. jedy

    jedy

    Joined:
    Aug 1, 2010
    Posts:
    579
    I didn't meant letting the user remap the Escape key.

    My scenario example:

    Anyway I have the feeling that noone even considers giving the USER the ability to choose what suits himself and leaving the default option the Escape.
     
  12. omaclouly

    omaclouly

    Joined:
    Oct 5, 2011
    Posts:
    1
    Hello,

    This is the second time I see someone using the excuse that Unity can`t let programmers disable the Press Esc for security reasons.

    I have a suggestion to solve that problem. Could you give us the option to select the language of that message? I am doing a facebook game, and all texts are in Portuguese, except that annoying message in English. That is a major interface BUG.

    Come on guys, lets fix this thing!
     
    Last edited: Oct 5, 2011
  13. grim2594

    grim2594

    Joined:
    Nov 5, 2010
    Posts:
    104
    Yes, everyone can still be happy with the ESC key's functionality having the ability to be changed to another key. This does not mean that the "exit key" will not be displayed when the user is entering full screen mode. It simply means that it is assigned to another key. In any case, the correct key to use to exit full screen or to unlock the cursor will always be displayed at the appropriate time.

    I know this issue isn't going to be changed any time soon. However, that doesn't mean that it should be hard-coded into the engine, preventing the developer from being able to create their game in the way that they choose to.

    When you are trying to target a population of stand-alone players, like I am, it is a good thing to replicate that play style onto the web player as well. By hard-coding this "feature" into the engine, it prevents developers from trying to make things easier for their target audience.

    Sure, we can hackishly work around it... but why force us to do hackish things?
     
  14. jedy

    jedy

    Joined:
    Aug 1, 2010
    Posts:
    579
    I agree with GRIM. Usually the default for getting the browser off fullscreen is F11 and if it's clearly stated, as the escape key currently is - it should not be much of a change for the users, nor a giant pitfall of doom where users would not be able to exit the application.
    This goes for any key used.
     
  15. maraoz

    maraoz

    Joined:
    Nov 15, 2012
    Posts:
    20
    +1 for message internationalization!