Game Development Community

Binding Two Functions to One Key

by John Klotz · in Torque Game Builder · 06/08/2006 (11:59 am) · 4 replies

moveMap.bindCmd(keyboard, "a", "mooseleft()" && "moveleft", "moosestop();");

Is this possible?

And if so what syntax do I have to use?

#1
06/08/2006 (1:34 pm)
Not 100% positive, but I doubt this is possible.

Why not have your mooseleft function call the moveleft function?
#2
06/08/2006 (3:46 pm)
@John - I think this should work...

moveMap.bindCmd(keyboard, "a", "mooseleft(); moveleft();", "moosestop();");
#3
06/08/2006 (4:01 pm)
Or you could bind to a single function that calls your other two functions.
#4
06/08/2006 (5:20 pm)
I would go with Robert's suggestion here...

something like

moveMap.bindCmd(keyboard, "a", "aKeyDown();", "aKeyUp();");