Improving input control
by Toks · in Torque Game Engine · 06/21/2007 (7:12 am) · 2 replies
Hey everyone,
I could do with some help to get me started. I'm looking for a way to improve the input control, allowing me not only process the pressing of keys, but also the releasing. (so when a key was pressed, and you release it again it should call some function or something like that) (kind of like the onTriggerUp thing in statemachines i realize now). How should i tackle this?
thanks everyone
I could do with some help to get me started. I'm looking for a way to improve the input control, allowing me not only process the pressing of keys, but also the releasing. (so when a key was pressed, and you release it again it should call some function or something like that) (kind of like the onTriggerUp thing in statemachines i realize now). How should i tackle this?
thanks everyone
#2
06/21/2007 (7:48 am)
The mode Tim describes above is with the ActionMap.bind(...) mapping..if you want even more flexibility, the ActionMap.bindCmd(...) mode allows you to call one function on the key down (called the "make event"), and a different function on the key up (called the "break event")--although with this mode, no value is sent to either of the functions.
Torque Owner Tim Heldna
function foo(%val) { if(%val) echo("key pressed down"); else echo("key released"); }