mousetracker.log

getMouseTracker(id).log() Will add a line in the results file at the end of the trial reporting the mouse coordinates between and . See the discussion and example script on the page for more information about the format of the string reporting the coordinates.

mousetracker.callback

getMouseTracker(id).callback( command ) or getMouseTracker(id).callback( function ) Will run the PennController command(s) or javascript function passed as arguments whenever the mouse moves after and before have been called. If you pass a function, it will be receive two arguments when executed, corresponding to the current X and Y coordinates. Example: [js highlight=”9-15″ try=”true”]newButton(“Click then move …

mousetracker.stop

getMouseTracker(id).stop() Stops tracking the mouse cursor coordinates. Make sure to use this command to stop tracking and prevent your results file from growing too much. Example: [js highlight=”18″ try=”true”]newButton(“Start”) .print(“center at 50vw”, “center at 50vh”) .wait() .remove() , newMouseTracker(“mouse”).log().start() , newCanvas(“left”, “40vw”, “40vh”) .css(“background”,”red”) .print(“center at 25vw”,”center at 50vh”) , newCanvas(“right”, “40vw”, “40vh”) .css(“background”,”blue”) .print(“center …

mousetracker.start

getMouseTracker(id).start() Starts tracking the mouse cursor coordinates. The MouseTracker element will not collect any data points until start is executed and unless is called. Make sure to use to stop tracking and prevent your results file from growing too much. Example: [js highlight=”6″ try=”true”]newButton(“Start”) .print(“center at 50vw”, “center at 50vh”) .wait() .remove() , newMouseTracker(“mouse”).log().start() , …