[bug]Pressing escape switches the game to windowed mode

MiscEtc

  • *
  • Posts: 162
If you've toggled fullscreen at least once before, and are in currently in fullscreen, pressing esc will switch the game to windowed.
None of my code tells the game to do that. Esc isn't even a control in the game settings.

letmethink

  • *
  • Posts: 2547
Are you running the game on Flash or Windows? I remember seeing code that would replicate this behaviour in the Engine, but I thought it was commented out.
~Letmethink


NobodyX

  • *
  • Posts: 1228
This is really important for releasing a commercial-quality game where esc is expected to bring up a menu, I hope it's going to get sorted out.

letmethink

  • *
  • Posts: 2547
Around line 400 of Engine.hx you will see something like this:
Code: [Select]
private function onKeyDown(e:KeyboardEvent = null)
{
if(e.keyCode == Key.ESCAPE)
{
toggleFullscreen(true);
}
}

Change it so it is like this:

Code: [Select]
private function onKeyDown(e:KeyboardEvent = null)
{
#if flash
if(e.keyCode == Key.ESCAPE)
{
toggleFullscreen(true);
}
#end
}
~Letmethink

MiscEtc

  • *
  • Posts: 162
Thanks letmethink, that fixed it.
This really should be officially changed in future Stencyl releases.

captaincomic

  • *
  • Posts: 6109
Done in build 9013.