Game Development Community

Alt+Tab and Alt+Enter don't work when GuiTextCtrl present

by Bruno Campolo · in Torque Game Builder · 04/29/2010 (2:20 pm) · 5 replies

I searched the forums for a bit, but couldn't find anything useful. I'm sure there is something I'm missing, but when trying to do Alt+Tab or Alt+Enter in my game it works fine except when there is a GuiTextCtrl on the screen. I think the Text Control is intercepting the key combinations, but I'm not sure how to prevent this. I think Alt+Tab, Alt+Enter and possibly other combinations should work regardless of whether you are in a text control or not.

Has anyone run into this or know what I'm missing?

About the author

Creator of Bantam City Games, a one-man independent game development studio. To learn more, check out 'A Game Developer's Saga', a game development blog at: http://www.bantamcity.com/blog


#1
04/30/2010 (5:11 am)
I would look into setFocus() or something like that.
#2
05/01/2010 (5:35 am)
I'm not sure how setting focus could solve this problem... could you be more specific?
#3
05/01/2010 (6:51 am)
You have the text control in focus. That is why its "intercepting" the keyboard input. How is it supposed to know what keystrokes to let pass by and what keystrokes to process?
#4
05/02/2010 (6:20 am)
That makes sense, but then is there a way to react to the Alt+Tab, Alt+Enter from within one of the GuiTextCtrl methods? I basically want these two combos to work whether the user is in a text control or not. Someone must have run into this, right?
#5
05/02/2010 (3:38 pm)
My first approach would go something like this:
1. onKeyDown of the text control - look for Alt being pressed
2. When it sees Alt, send the entire string to the system.
3. Clear text from text control

Step 2 is the fuzzy point. I don't know how to force a string into the system... I would start looking at what a scenegraph does with keyboard input. Scenegraph.setFocus()? Sorry I can't be of more help on that topic.