Game Development Community

GuiInputCtrl

by Bryan Zarnett · in Torque Game Builder · 08/19/2009 (5:10 pm) · 3 replies

I'm trying to use the GuiInputCtrl to intercept the escape key in order to close a specific open GUI.

When I put the control down, the editor freezes. I've noticed that this problem has been described before but I could not find any resolutions? Is this still an issue?

Is this the control I should use to intercept the escape key for the GUI or is there another approach?

Cheers,
Bryan

#1
08/19/2009 (8:03 pm)
Is there a problem with using something like,
moveMap.bindCmd(keyboard, "escape", "closeMyGUI();", "Closes a specific open GUI");

I've not played around with guiInputCtrls so I don't know why it would cause the editor to crash but I think the above should work as long as you can close the gui in a normal function.
#2
08/19/2009 (9:44 pm)
Hi Nate,

That is what I actually ended up doing. Just before the GUI is shown, I bind the escape key to do just as you illustrated above. I was trying to get a better grasp of the GUI components, and thus, my implementation idea.

=-)
#3
09/07/2009 (11:36 am)

As for the freezing: GuiInputCtrl locks the mouse which is why the GUI Editor appears to have frozen. As is, the control needs to be placed manually outside the editor (i.e. directly in script).