TorqueScript Reference
Public Member Functions | List of all members
ActionMap Class Reference

#include <actionMap_ScriptBinding.h>

Inherits SimObject.

Public Member Functions

void bind (device, action, [modifier, mod...], command)
 
void bindCmd (device, action, makeCmd, breakCmd)
 
void bindObj (device, action, [modifier spec, mod...], command, object)
 
String getBinding (command)
 
String getCommand (device, action)
 
String getDeadZone (device, action)
 
Float getScale (device, action)
 
Boolean isInverted (device, action)
 
void pop ()
 
void push ()
 
void save ([fileName][, append])
 
void unbind (device, action)
 
void unbindObj (device, action, object)
 
- Public Member Functions inherited from SimObject
void assignFieldsFrom (SimObject)
 
Integer clone ([copyDynamicFields=false]?)
 
void delete ()
 
Integer getId ()
 
void setName (newName)
 
String getName ()
 
String getClassNamespace ()
 
String getSuperClassNamespace ()
 
void setClassNamespace (nameSpace)
 
void setSuperClassNamespace ()
 
Boolean isMethod (string methodName)
 
String call (methodName, [args] *)
 
void dumpClassHierarchy ()
 
void dump ()
 
Boolean isMemberOfClass (string classname)
 
String getClassName ()
 
String getFieldValue (fieldName)
 
Boolean setFieldValue (fieldName, value)
 
Boolean setEditFieldValue (fieldName, value)
 
Integer getDynamicFieldCount ()
 
String getDynamicField (index)
 
Integer getFieldCount ()
 
String getField (int index)
 
void setProgenitorFile (file)
 
String getProgenitorFile ()
 
Integer getType ()
 
String getFieldType (fieldName)
 
void setInternalName (string InternalName)
 
String getInternalName ()
 
Boolean isChildOfGroup (groupID)
 
Integer getGroup ()
 
Boolean startTimer (callbackFunction, float timePeriod, [repeat]?)
 
void stopTimer ()
 
Boolean isTimerActive ()
 
Integer schedule (time, command, [arg] *)
 
void startListening (SimObject)
 
void stopListening (SimObject)
 
void addListener (SimObject)
 
void removeListener (SimObject)
 
void removeAllListeners ()
 
void postEvent (String eventName, String data)
 
Boolean save (fileName, [selectedOnly]?)
 
void addFieldFilter (fieldName)
 
void removeFieldFilter (fieldName)
 

Member Function Documentation

◆ bind()

void bind ( device  ,
action  ,
command   
)

Use the bind method to associate a function to a keystroke or other device input. The command bound via the bind function must be specified as a flat name with no elipses or semi-colon termination and will be called on make and break events (i.e. key press and release for a mapped key). Args: Warning: When a function is bound to a keystroke or other device input, and no other versions of the binding are provided, the function will be called even if a modifier key like CTRL, ALT, or SHIFT is also pressed.

Parameters
deviceName of the device to bind the command to.
actionName of the action to watch for.
modifierSpecial modifiers (mouse only), such as dead spot, etc.
commandThe function to be called on make and break.
Returns
No return value.
See also
bindCmd, getBinding, unbind

◆ bindCmd()

void bindCmd ( device  ,
action  ,
makeCmd  ,
breakCmd   
)

Use the bindCmd method to associate up to two functions to a keystroke or other device input. The makeCmd is bound to the make event and the breakCmd is bound to the break event and in both cases, the commands are specified as complete scripts, with all arguments, elipses, and the terminating semi-colon. Either of these commands may be non-specified (NULL strings). For clarification, see 'Bind Sample' example below.

Parameters
deviceName of the device to bind the command to (see 'Device Table' below).
actionName of the action to watch for(see 'Action Table' below).
makeCmdThe function to be called on make event.
breakCmdThe function to be called on break event.
Returns
No return value.
See also
bind, getBinding, unbind

◆ bindObj()

void bindObj ( device  ,
action  ,
command  ,
object   
)

Use the bindObj method to associate a function to a keystroke or other device input. The command bound via the bind function must be specified as a flat name with no elipses or semi-colon termination and will be called on make and break events (i.e. key press and release for a mapped key). Args: Warning: When a function is bound to a keystroke or other device input, and no other versions of the binding are provided, the function will be called even if a modifier key like CTRL, ALT, or SHIFT is also pressed.

Parameters
deviceName of the device to bind the command to.
actionName of the action to watch for.
modifierSpecial modifiers (mouse only), such as dead spot, etc.
commandThe function to be called on make and break.
objectThe explicit object (it defaults to NULL when you call bind() )
Returns
No return value.
See also
bindCmd, getBinding, unbind

◆ getBinding()

String getBinding ( command  )

Use the getBinding method to get the binding for a specified command.

Parameters
commandThe function to seek a binding for.
Returns
Returns a string containing the binding as a field (TAB separated string), or a NULL string meaning 'no binding found'.
See also
bind, bindCmd

◆ getCommand()

String getCommand ( device  ,
action   
)

Use the getCommand method to get the function associated with a specific device + action pair.

Parameters
deviceName of the device to bound to a command (see 'Device Table' below).
actionName of the action to watch for (see 'Action Table' below).
Returns
Returns the function name or specification associated with the specified device + action pair, or a NULL-string meaning 'no binding found'.
See also
bind, bindCmd, getBinding

◆ getDeadZone()

String getDeadZone ( device  ,
action   
)

Use the getDeadZone method to get the dead-zone associated with a specific device + action pair.

Parameters
deviceName of the device to bound to a command (see 'Device Table' below).
actionName of the action to watch for (see 'Action Table' below).
Returns
Returns a dead-zone specification, or \0 0\ meaning that there is no dead-zone, or a NULL string meaning the mapping was not found.
See also
bind, bindCmd

◆ getScale()

Float getScale ( device  ,
action   
)

Use the getScale method to get the scale associated with a specific device + action pair.

Parameters
deviceName of the device to bound to a command (see 'Device Table' below).
actionName of the action to watch for (see 'Action Table' below).
Returns
Returns 1 if no scale is associated with the specified device + action pair, or the mapping was not found.
See also
bind, bindCmd

◆ isInverted()

Boolean isInverted ( device  ,
action   
)

Use the Purpose method to determine if a specific device + action pair in inverted. This only applies to scrolling devices.

Parameters
deviceName of the device to bound to a command (see 'Device Table' below).
actionName of the action to watch for (see 'Action Table' below).
Returns
Returns 1 if the mouse (or other scrolling device) is inverted, 0 otherwise.
See also
bind, bindCmd

◆ pop()

void pop ( )

Use the pop method to de-activate an ActionMap and remove it from non-global ActionMap stack.

Returns
No return value.
See also
push

◆ push()

void push ( )

Use the push method to activate an ActionMap and place it at the top of the non-global ActionMap stack.

Returns
No return value.
See also
pop

◆ save()

void save ( )

Use the save method to save an entire action map specification to a file. If append is not specified, or specified as false, fileName will be overwritten, otherwise the action map will be appended to the file.

Parameters
fileNameFull path to file in which to store action map definition.
appendIf true, do not overwrite the file, else start from scratch.
Returns
No return value

◆ unbind()

void unbind ( device  ,
action   
)

Use the unbind method to remove a previosly specified device + action pair from the action map.

Parameters
deviceName of the device to bound to a command (see 'Device Table' below).
actionName of the action to watch for (see 'Action Table' below).
Returns
No return value.
See also
bind, bindCmd

◆ unbindObj()

void unbindObj ( device  ,
action  ,
object   
)

Use the unbind method to remove a previosly specified device + action pair from the action map.

Parameters
deviceName of the device to bound to a command (see 'Device Table' below).
actionName of the action to watch for (see 'Action Table' below).
objectExplicit object (it defaults to NULL when you call unbind() ).
Returns
No return value.
See also
bind, bindCmd