Author Topic: A bug (I presume) with the Escape key and minimizing.  (Read 4727 times)

CapnDingo

  • Lead Game Designer, Three-Headed Dingo
    • I can help with play testing
    • I can help with proof reading
I presume this is a bug because I've not altered in any way the function of the Escape key. I use it to bring up my main menu GUI, and that's all. It's a single line of code.

Normally, the Escape key works just fine. However, when I minimize/maximize the game, it refuses to acknowledge the Escape key anymore unless I press any other key on the keyboard first. Then it works just fine.

Awkward, yes?

Edit: To clarify, this happens both on my system and on a tester's system.
« Last Edit: 25 Sep 2009, 19:47 by CapnDingo »

Re: A bug (I presume) with the Escape key and minimizing.
« Reply #1 on: 26 Sep 2009, 16:23 »
I've also had some problems with minimizing/maximizing or Alt-Tab'ing out of the game in recent AGS versions. I can't really tell if it's because I'm now using Vista, but whenever I return to the game all speech text is running at hyperspeed, skipping through whole dialogs within a few game loops. As far as I can tell there's no way to resolve it other than quitting and restarting the game. Highly annoying when you're multitasking to take screenshots or similar.

Pumaman

  • Creator of AGS
  • I sense danger.
    • Lifetime Achievement Award Winner
    • Pumaman worked on one or more games that was nominated for an AGS Award!
Re: A bug (I presume) with the Escape key and minimizing.
« Reply #2 on: 26 Sep 2009, 18:00 »
Are you running full-screen or windowed?

If you're regularly task-switching to take screenshots and stuff, it's easier to run the game in a window.

Re: A bug (I presume) with the Escape key and minimizing.
« Reply #3 on: 26 Sep 2009, 18:26 »
The hyperspeed text thing also happens in windowed mode, just tested it on Blackwell Convergence (AGS 3.02). Then I tried 5 Days a Stranger (AGS 2.62) and Alt-Tabbing there doesn't create any issues. Can't tell for sure on which AGS version it started to happen without further research.

CapnDingo

  • Lead Game Designer, Three-Headed Dingo
    • I can help with play testing
    • I can help with proof reading
Re: A bug (I presume) with the Escape key and minimizing.
« Reply #4 on: 26 Sep 2009, 18:53 »
Are you running full-screen or windowed?

If you're regularly task-switching to take screenshots and stuff, it's easier to run the game in a window.


Full-screen. My concern wasn't so much my own issues with it, but the possible issues players may have with it. Personally, I take my screenshots with Fraps, but they could want to task switch for any number of reasons.

Obviously I could tell them to just not minimize, or to hit another key after maximizing to fix Escape not working. I don't think I've experienced the hyperspeed thing GarageGothic has though. It always goes the proper speed.

But, perhaps it is a combination of a Vista thing and one of the updates to the engine. I run Vista, as does the tester.

It sucks because I can't really help you identify the problem much beyond that. The best I can say is, if you'd like a reproduction, create a game, make a GUI that becomes visible upon pressing Escape. It should work, until you minimize/maximize the game again, then it will stop working until you feed it a different key press. Clicking with the mouse however doesn't seem to re-enable the Escape key. Only keyboard presses.

Pumaman

  • Creator of AGS
  • I sense danger.
    • Lifetime Achievement Award Winner
    • Pumaman worked on one or more games that was nominated for an AGS Award!
Re: A bug (I presume) with the Escape key and minimizing.
« Reply #5 on: 26 Sep 2009, 23:26 »
Hmm, I've heard of the hyperspeed text thing before in full-screen mode, where on some systems the TAB key seemed to get stuck down after you used ALT+TAB and you had to press tab once you were back in the game to fix it. But I've never heard of it happening in windowed mode before, and I can't reproduce it myself.

CapnDingo, is it just the ESC key that it doesn't recognise, or is it a general problem where it doesn't recognise the first key you press after returning to the game?

Re: A bug (I presume) with the Escape key and minimizing.
« Reply #6 on: 26 Sep 2009, 23:46 »
You're right, it does seem to be the Alt+TAB key combination that does it - if you change focus to another window by clicking on it and then returning by clicking on the game's entry in the taskbar everything works fine. Unfortunately, on my system pressing TAB again once back in the game doesn't help to remedy the situation. I'm guessing I'll just have to change the skip speech mode from anykey to mouse only to avoid others having that problem.

CapnDingo

  • Lead Game Designer, Three-Headed Dingo
    • I can help with play testing
    • I can help with proof reading
Re: A bug (I presume) with the Escape key and minimizing.
« Reply #7 on: 28 Sep 2009, 21:57 »
Hmm, I've heard of the hyperspeed text thing before in full-screen mode, where on some systems the TAB key seemed to get stuck down after you used ALT+TAB and you had to press tab once you were back in the game to fix it. But I've never heard of it happening in windowed mode before, and I can't reproduce it myself.

CapnDingo, is it just the ESC key that it doesn't recognise, or is it a general problem where it doesn't recognise the first key you press after returning to the game?

It's just the Escape key. It recognizes other key presses on the first try.

And when it recognizes any other key press except Escape, Escape begins working again.

I suppose I should clarify, I've isolated a finer reproduction. It also only happens when you specifically alt+tab out, then bring the game back up. Simply clicking on another window and putting it in front of the game window, or hitting the Windows button, won't do it.

Escape key not playing well with alt+tab?
« Last Edit: 28 Sep 2009, 22:06 by CapnDingo »

Pumaman

  • Creator of AGS
  • I sense danger.
    • Lifetime Achievement Award Winner
    • Pumaman worked on one or more games that was nominated for an AGS Award!
Re: A bug (I presume) with the Escape key and minimizing.
« Reply #8 on: 29 Sep 2009, 19:10 »
So do you get the problem in windowed mode as well?

Radiant

  • Return once more to the Two Kingdoms!
    • I can help with publishing
    • I can help with story design
    • Radiant worked on one or more games that won an AGS Award!
    •  
    • Radiant worked on one or more games that was nominated for an AGS Award!
Re: A bug (I presume) with the Escape key and minimizing.
« Reply #9 on: 30 Sep 2009, 00:10 »
I've had something similar. If I press the control key and release it, then the escape key won't function until I press another key. Doesn't bother me much, but it's a bit strange.

Crimson Wizard

  • Local Moderator
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Lifetime Achievement Award Winner
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
Re: A bug (I presume) with the Escape key and minimizing.
« Reply #10 on: 16 Oct 2009, 18:39 »
I've had something similar. If I press the control key and release it, then the escape key won't function until I press another key. Doesn't bother me much, but it's a bit strange.
*bump*
To be precise: this happens when you press either CTRL or ALT.

Dualnames

  • AGS Baker
  • Pretty Badass
    • Dualnames worked on one or more games that won an AGS Award!
    •  
    • Dualnames worked on one or more games that was nominated for an AGS Award!
Re: A bug (I presume) with the Escape key and minimizing.
« Reply #11 on: 17 Oct 2009, 10:58 »
I've had something similar. If I press the control key and release it, then the escape key won't function until I press another key. Doesn't bother me much, but it's a bit strange.
*bump*
To be precise: this happens when you press either CTRL or ALT.

True, I've reproduced it and indeed it happens.
No more military army stuff. I'm alive and back.

Knox

  • Storm Behind The Badge
Re: A bug (I presume) with the Escape key and minimizing.
« Reply #12 on: 03 Oct 2013, 04:06 »
Ok, really sorry for re-opening a 3 year old thread, but I've come across the same issue (went through my code trying to find the mistake for a good while before finding this thread).

If I press control or alt, my esc key gets totally disabled. However, pressing the shift key "unlocks" my esc key once again. Its not too big an issue other than I have a few keys mapped with control or alt combinations and that makes the esc key disabled (which is used to close menus, etc). It can seem like a bug to the player, so I guess this can get annoying after a while.

Any idea on if this can be fixed?
--All that is necessary for evil to triumph is for good men to do nothing.

monkey0506

  • SEND PIZZA.
    • Best Innovation Award Winner 2017, for his work to help AGS games reach the widest possible audience - through popular distribution platforms (Steam, Galaxy) as well as other operating systems (Android, Linux)
    • monkey0506 worked on one or more games that won an AGS Award!
    •  
    • monkey0506 worked on one or more games that was nominated for an AGS Award!
Re: A bug (I presume) with the Escape key and minimizing.
« Reply #13 on: 04 Oct 2013, 15:47 »
Hey Knox, just so you don't think you're being ignored, Radiant recently reported the same error. It seems it was related to a bug in Allegro. I'm not actually clear if the fix has been pushed to the latest versions or not. Better to check with CW or JJS on that.

Crimson Wizard

  • Local Moderator
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Lifetime Achievement Award Winner
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
Re: A bug (I presume) with the Escape key and minimizing.
« Reply #14 on: 04 Oct 2013, 17:27 »
Hey Knox, just so you don't think you're being ignored, Radiant recently reported the same error. It seems it was related to a bug in Allegro. I'm not actually clear if the fix has been pushed to the latest versions or not. Better to check with CW or JJS on that.
JJS made a separate branch with updated libs in his personal repository, but I forgot to check that.
Also, I am still unaware of how safe it would be to switch to newer lib. I remember CJ mentioned making hacks in the Allegro code to make something work differently. Call me paranoid... but I don't like to do this while trying to make a final 3.3.0 release.
To put this straight, I'd vote to make a stable 3.3.0 release first, and update library later.

Knox

  • Storm Behind The Badge
Re: A bug (I presume) with the Escape key and minimizing.
« Reply #15 on: 04 Oct 2013, 17:29 »
Hey Knox, just so you don't think you're being ignored, Radiant recently reported the same error. It seems it was related to a bug in Allegro. I'm not actually clear if the fix has been pushed to the latest versions or not. Better to check with CW or JJS on that.
Hey Monkey! Ah its cool, Im a patient guy! :wink:


To put this straight, I'd vote to make a stable 3.3.0 release first, and update library later.
No probs here, didn't know Radiant brought this up recently.
--All that is necessary for evil to triumph is for good men to do nothing.

JSH

  • Founder of Clifftop Games
    • JSH worked on one or more games that won an AGS Award!
    •  
    • JSH worked on one or more games that was nominated for an AGS Award!
Re: A bug (I presume) with the Escape key and minimizing.
« Reply #16 on: 26 Apr 2016, 22:35 »
This bug had me scratching my head for a while, for Kathy Rain I've just done a quick hack since we're really pressed for time:

Found the culprit in \Engine\libsrc\allegro-4.2.2-agspatch\win\wkeybd.c
Look for /* ignore special Windows keys (alt+tab, alt+space, (ctrl|alt)+esc) */

Commented out that section and it resolved the problem. There's likely some underlying problem with that code and how held shift/alt/ctrl keys are cached, but anyone who builds from source and needs a quick fix could use this hack :)

Crimson Wizard

  • Local Moderator
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Lifetime Achievement Award Winner
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
Re: A bug (I presume) with the Escape key and minimizing.
« Reply #17 on: 26 Apr 2016, 23:14 »
This thread was just lost and forgotten and we never got back to fixing this...