mousetracker.log

description

Will add a line in the results file at the end of the trial reporting the mouse coordinates between start and stop.

syntax

getMouseTracker(ELEMENT_NAME).log()

notes

  • See the discussion and example script on the MouseTracker element page for more information about the format of the string reporting the coordinates.
  • Additionally you can log click by writing the command: mousetracker.log(“click”) .

example(s)


@newTrial(
@  newButton("Start")
@    .print("center at 50vw", "middle at 50vh").wait().remove()
@  ,
@  newMouseTracker("mouse")
$   .log()
$   .start()
@  ,
@  newCanvas("left", "40vw", "40vh")
@   .css("background","red")
@   .print("center at 25vw", "middle at 50vh")
@  ,
@  newCanvas("right", "40vw", "40vh")
@   .css("background","blue")
@   .print("center at 75vw", "middle at 50vh")
@  ,
@  newSelector("choice")
@   .add( getCanvas("left") , getCanvas("right") )
@   .log()
@   .wait()
@  ,
@  getMouseTracker("mouse")
$   .stop()
)
  • This code initaties the mouse tracker. The mouse tracker tracks the coordinates between start and stop.