Game Development Community

Dialogs and InputMaps(RESOLVED)

by Christopher Perkins · in Torque X 2D · 07/31/2009 (2:09 am) · 3 replies

Ok, I have a little GUI going on and am running into a small(well big to me) problem. You see, Im try to implement a simple little message box that allows you to do choices and had decided to use GuiControl as a DialogControl to do it. Alls great, it displays and what not, but after setting up the InputMap, its not getting any input events:(. I haven't assigned any other Input Maps along the GUI chain, so this is rather frustrating.

Anywho, I probably messed up something simple along the way, but I feel like I did everything. Anywho to set up the InputMap I did this inside the GUIControl:
int keyboardId = InputManager.Instance.FindDevice("keyboard");
InputMap.BindCommand(keyboardId, (int)Microsoft.Xna.Framework.Input.Keys.Down, null, MoveDown);
InputMap.BindCommand(keyboardId, (int)Microsoft.Xna.Framework.Input.Keys.Up, null, MoveUp);
InputMap.BindCommand(keyboardId, (int)Microsoft.Xna.Framework.Input.Keys.Enter, null, Select);

Ths is all I did, so if Im missing something, please tell me. Yes, the delegates are set up:).

#1
07/31/2009 (6:32 am)
there's a bug on the input set up
check out a few posts down from this one
or look at Scott Zarnke's posts for a fix
#2
07/31/2009 (2:48 pm)
If you are talking about it being funky when having multiple things bound to the same button, this is the first time Ive bound anything in the program. There is no other input binding code in my code right now.
#3
07/31/2009 (6:32 pm)
I figured it out. I just had to push its InputMap to the InputManager(and pop it when removed)... Works out fine.