Game Development Community

Using Accelerator For MessageBoxOK

by Scott Doerrfeld · in Torque Game Engine · 10/30/2007 (10:53 am) · 1 replies

I am trying to do something seemingly simple --- when a MessageBoxOK gets pushed to the screen I would like the user to be able to press the "Enter" key to close the message.

I have it all set up but for some reason it only works AFTER I push and pop another GuiControl on top of the MessageBoxOK window.

Any advice?

#1
10/30/2007 (1:00 pm)
I SORT OF have a solution. It's a bit on the junktacular side but when I push my MessageBoxOK to the screen I have to call makeFirstResponder(0) on whatever control is the current first responder then call makeFirstResponder(1) on the MBOKButton. Then, when the control gets popped I have to restore the previous first responder to set things back to normal.

Wish it were more elegant but that's what I have for now!