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 log is called. Make sure to use stop 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()
,
newCanvas(“left”, “40vw”, “40vh”)
.css(“background”,”red”)
.print(“center at 25vw”,”center at 50vh”)
,
newCanvas(“right”, “40vw”, “40vh”)
.css(“background”,”blue”)
.print(“center at 75vw”,”center at 50vh”)
,
newSelector(“choice”).add(getCanvas(“left”),getCanvas(“right”)).log().wait()
,
getMouseTracker(“mouse”).stop()[/js]

Will start tracking mouse movements after a click on Start and stop once one of the two Canvas elements is clicked.

Published by Jeremy

Researcher in semantics and pragmatics; Programmer of PennController for IBEX