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 …
Wiki Category Archives:
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() , …
eyetracker.showFeedback
getEyeTracker(id).showFeedback() (since PennController 1.8) Shows the red dot estimating your looks, which is hidden by default after calibration. Example: [js highlight=”11″ try=”data”]newTrial( newButton(“Start”).print().wait(newEyeTracker().test.ready()) ) newTrial( newEyeTracker(“tracker”).calibrate(70) , newText(“Left”).css(“padding”,”20vw”).print(“20vw”, “40vh”), newText(“Right”).css(“padding”,”20vw”).print(“60vw”, “40vh”) , getEyeTracker(“tracker”) .add( getText(“Left”) , getText(“Right”) ) .showFeedback() .start() , newTimer(1000).callback( getEyeTracker(“tracker”).hideFeedback() ).start() , newSelector().add( getText(“Left”) , getText(“Right”) ).wait() )[/js] Will still show the …
eyetracker.trainOnMouseMove
getEyeTracker(id).trainOnMouseMove() (since PennController 1.8) or getEyeTracker(id).trainOnMouseMove(false) (since PennController 1.8) Tells the model to use mouse movements for its estimations or, if you pass false, to NOT use them. Use this command after calling . Example: [js highlight=”7″ try=”data”]newTrial( newButton(“Start”).print().wait(newEyeTracker().test.ready()) ) newTrial( newEyeTracker(“tracker”) .calibrate(70) .train(true) .trainOnMouseMove(false) , newButton(“Click here first”).print(“20vw”,”40vh”).wait().remove(), newButton(“Now Click here”).print(“60vw”,”40vh”).wait().remove() , newText(“Left”).css(“padding”,”20vw”).print(“20vw”, “40vh”), …
eyetracker.log
getEyeTracker(id).log() (since PennController 1.8) Tell the EyeTracker element to send the collected data points to the PHP script provided by at the end of the trial. If you do not call log on the EyeTracker element, your server will never receive the eye-tracking data.
eyetracker.callback
getEyeTracker(id).callback( function ) (since PennController 1.8) Tell the script to continuously execute the specified javascript function as long as an element is being looked at. The function takes is passed two arguments, the estimated X and Y coordinates. The keyword this in the callback function points to the PennElement instance corresponding to the looked-at element. …
eyetracker.add
getEyeTracker(id).add( element1 , element2, … ) (since PennController 1.8) Adds elements to be tracked. Any commands passed to will be executed on every cycle (or span of cycles) where the estimated looks fall on one of the specified elements. Once you add elements to the tracker and use , the tracker will report 1 (looked-at) …
eyetracker.train
getEyeTracker(id).train() (since PennController 1.8) or getEyeTracker(id).train(true) Starts using mouse movements and clicks to train the model that estimates looks. Pass true as a parameter to make the red dot visible. By default the model is only trained during the calibration phase, but you can train it further with this command. Use to stop training the …
eyetracker.stopTraining
getEyeTracker(id).stopTraining() (since PennController 1.8) Stops using mouse movements and clicks to train the model that estimates looks. By default the model is only trained during the calibration phase, but you can train it further with the command . Example: [js highlight=”15″ try=”data”]newTrial( newButton(“Start”).print().wait(newEyeTracker().test.ready()) ) newTrial( newEyeTracker(“tracker”) .calibrate(70) .train(true) , newButton(“Click here first”).print(“20vw”,”40vh”).wait().remove(), newButton(“Now Click here”).print(“60vw”,”40vh”).wait().remove() …