A bug (I presume) with the Escape key and minimizing.

Started by CapnDingo, Fri 25/09/2009 19:45:39

Previous topic - Next topic

CapnDingo

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.

GarageGothic

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

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.

GarageGothic

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

Quote from: Pumaman on Sat 26/09/2009 18:00:48
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

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?

GarageGothic

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

#7
Quote from: Pumaman on Sat 26/09/2009 23:26:44
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?

Pumaman

So do you get the problem in windowed mode as well?

Radiant

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

Quote from: Radiant on Wed 30/09/2009 00:10:17
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

Quote from: Crimson Wizard on Fri 16/10/2009 18:39:11
Quote from: Radiant on Wed 30/09/2009 00:10:17
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.
Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)

Knox

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

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

Quote from: monkey_05_06 on Fri 04/10/2013 15:47:52
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

Quote from: monkey_05_06 on Fri 04/10/2013 15:47:52
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:


Quote from: Crimson Wizard on Fri 04/10/2013 17:27:06
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

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

This thread was just lost and forgotten and we never got back to fixing this...

SMF spam blocked by CleanTalk