Script scriptHandler
[hide private]
[frames] | no frames]

Module scriptHandler

source code

Functions [hide private]
 
_makeKbEmulateScript(scriptName) source code
 
_getObjScript(obj, gesture, globalMapScripts) source code
 
findScript(gesture) source code
 
getScriptName(script) source code
 
getScriptLocation(script) source code
 
_queueScriptCallback(script, gesture) source code
 
queueScript(script, gesture) source code
 
executeScript(script, gesture)
Executes a given script (function) passing it the given gesture.
source code
integer
getLastScriptRepeatCount()
The count of how many times the most recent script has been executed.
source code
 
isScriptWaiting() source code
boolean
isCurrentScript(scriptFunc)
Finds out if the given script is equal to the script that isCurrentScript is being called from.
source code
Variables [hide private]
  _numScriptsQueued = 0
  _lastScriptTime = 0
  _lastScriptRef = None
hash(x)
  _lastScriptCount = 0
  _isScriptRunning = False
Function Details [hide private]

executeScript(script, gesture)

source code 

Executes a given script (function) passing it the given gesture. It also keeps track of the execution of duplicate scripts with in a certain amount of time, and counts how many times this happens. Use getLastScriptRepeatCount to find out this count value.

Parameters:
  • script (callable.) - the function or method that should be executed. The function or method must take an argument of 'gesture'.
  • gesture (inputCore.InputGesture) - the input gesture that activated this script

getLastScriptRepeatCount()

source code 

The count of how many times the most recent script has been executed. This should only be called from with in a script.

Returns: integer
a value greater or equal to 0. If the script has not been repeated it is 0, if it has been repeated once its 1, and so forth.

isCurrentScript(scriptFunc)

source code 

Finds out if the given script is equal to the script that isCurrentScript is being called from.

Parameters:
  • scriptFunc (Instance method) - the script retreaved from ScriptableObject.getScript(gesture)
Returns: boolean
True if they are equal, False otherwise