Binding to the Tab key
by Morphonix LLC · in Torque Game Engine · 07/01/2005 (8:15 am) · 7 replies
Having trouble getting actions bound to "tab" key
For my help system....
// works for space bar
helpSystemMap.bind( keyboard, space, hsSpaceAction );
// doesn't work...
helpSystemMap.bind( keyboard, tab, hsTabAction );
// doesn't work...
helpSystemMap.bindcmd(keyboard, "tab", "", "hsTabAction(0);");
// works
GlobalActionMap.bindcmd(keyboard, "tab", "", "hsTabAction(0);");
What am I missing? I would like to be able to bind a command to the tab key in my help system's action map, which gets pushed and popped when necessary.
However, the only way I have been able to get the tab key bound is by putting it into the GlobalActionMap.
I've been stepping through the action map code, but I've not found an answer yet...
Any help or explainations appreciated.
For my help system....
// works for space bar
helpSystemMap.bind( keyboard, space, hsSpaceAction );
// doesn't work...
helpSystemMap.bind( keyboard, tab, hsTabAction );
// doesn't work...
helpSystemMap.bindcmd(keyboard, "tab", "", "hsTabAction(0);");
// works
GlobalActionMap.bindcmd(keyboard, "tab", "", "hsTabAction(0);");
What am I missing? I would like to be able to bind a command to the tab key in my help system's action map, which gets pushed and popped when necessary.
However, the only way I have been able to get the tab key bound is by putting it into the GlobalActionMap.
I've been stepping through the action map code, but I've not found an answer yet...
Any help or explainations appreciated.
About the author
#2
Nothing else appears to be trying to use or disable the tab key.
Does the engine treat the tab key as a special case in any way?
07/01/2005 (9:47 am)
I've searched every script file (*.cs) in my hierarchy for "bind", "bindCmd", and "unbind".Nothing else appears to be trying to use or disable the tab key.
Does the engine treat the tab key as a special case in any way?
#3
07/01/2005 (9:48 am)
Hmm well it uses it to switch from first to third person, so must either be somwhere in the scripts or hard coded.
#5
07/01/2005 (9:50 am)
I use the tab key for a zoom function right now , and it works fine, i only changed the defaultbind and pressed ctrl o in the game and changed it.
#6
I do rember that working before I removed it though.
Since this doesn't seem to be ringing any alarm bells for anyone as a known issue, I guess I need to step through it and see what I've broken ;-)
I'll follow up if I find anything alarming. (i.e. something other than my own stupidity..)
07/01/2005 (2:30 pm)
@Matthew - I've removed that binding in default.bind.cs. my game is strictly first person. (but thanks)I do rember that working before I removed it though.
Since this doesn't seem to be ringing any alarm bells for anyone as a known issue, I guess I need to step through it and see what I've broken ;-)
I'll follow up if I find anything alarming. (i.e. something other than my own stupidity..)
#7
09/13/2005 (1:44 pm)
If you are using the mouse cursor in your program, you will need to comment out the following lines in guiCanvas.cc. Its a ditry fix but it works:/*
if ( isCursorON() && ( event->objInst == KEY_TAB ) )
{
if (size() > 0)
{
if (event->modifier & SI_SHIFT)
{
tabPrev();
return true;
}
else if (event->modifier == 0)
{
tabNext();
return true;
}
}
}
*/
Torque 3D Owner Billy L
It should work like you do.