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() , …

PennController.UploadRecordings

PennController.UploadRecordings() (since PennController 1.8) or PennController.UploadRecordings(“label”) or PennController.UploadRecordings(“label” , “noblock”) Creates a trial which, when executed, will send the recordings collected so far via the to the URL provided to . You can specify a label so as to control when the UploadRecordings is to be run in the flow of your experiment, by referencing …

PennController.EyeTrackerURL

PennController.EyeTrackerURL(url) (since PennController 1.8) Tells the script where to send the data collected via the EyeTracker elements. The URL should point to a PHP script that is able to parse incoming data. See for more information.

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.test.ready

getEyeTracker(id).test.ready() (since PennController 1.8) Tests whether the participant has granted webGazer access to their webcam, as required by the EyeTracker. Use this early in your experiment, and most usefully in the command of a Button to proceed only after access has been granted. Example: [js highlight=”3,4″ try=”true”]newButton(“Start”) .print() .wait( newEyeTracker().test.ready() .failure( newText(“Please grant access to …

eyetracker.test.calibrated

getEyeTracker(id).test.calibrated() (since PennController 1.8) Tests whether the EyeTracker went through a calibration procedure (regardless of whether it was successful). You probably won’t make use of this, unless you don’t want to calibrate the tracker before your trials nor on every trial, but still need to calibrate it at least on the first trial, and your …

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”), …