Torque 3D 3.8
_ActionMapbind1 Function
static ConsoleDocFragment _ActionMapbind1("@brief Associates a function to an input event.\n\n" "When the input event is raised, the specified function will be called.\n\n" "@param device The input device, such as mouse or keyboard.\n" "@param action The input event, such as space, button0, etc.\n" "@param command The function to bind to the action. Function must have a single boolean argument.\n" "@return True if the binding was successful, false if the device was unknown or description failed.\n\n" "@tsexample\n" "// Simple function that prints to console\n" "// %val - Sent by the device letting the user know\n" "// if an input was pressed (true) or released (false)\n" "function testInput(%val)\n" "{\n" " if(%val)\n" " echo(\"Key is down\");\n" " else\n" " echo(\"Key was released\");\n" "}\n\n" "// Bind the \'K\' key to the testInput function\n" "moveMap.bind(keyboard, k, testInput);\n\n" "@endtsexample\n\n\n", "ActionMap", "bool bind( string device, string action, string command );");

Console interop version.

Copyright (c) 2015. All rights reserved.
What do you think about this topic? Send feedback!