| Reference | Downloads | Github

Simple mouse tracking experiment

This is the first time I’m trying to code an experiment in PsychoPy. I’m trying to replicate an eye tracking study I programmed in Experiment Builder with the Eyelink hardware, and also used TrajTracker, a mouse tracking program to run the experiment on a touch screen computer, or while using a mouse. But I’d like to create a PsychoPy version so I can run it online.

Participants start in a small square at the bottom center of the screen and click and hold the mouse down through the duration of each trial.
Participants begin by moving the clicked mouse out of the start box.
After a time delay (which should be variable using a csv I assume) a visual stimulus (there are 8 possible stimuli images which should be randomized) appears directing the participant to move their mouse to one of tow targets either on the left or right of the screen.
I would like to continuously track the position, and velocity of the mouse movements through time, and also capture the time at which the participant reaches one of the targets.
After reaching a target the next trial should begin, with the participant placing their mouse in the start square, clicking and holding, then moving out of the box. These trials are repeated with variable delays of the onset of the randomized stimuli. I have attached an image of what a single trial might look like.

It’s not clear what your specific question is, but most of this should be available just using the settings within the mouse component.

Set it to end the routine on a valid click, and put the names of the clickable stimuli in the appropriate field. Also set the component to record the trajectory continuously, rather than just the mouse clicks.

Create a stimulus to act as the mouse pointer and put something like your_mouse_component_name.pos in its position field, set to update on every frame.

Ok, thanks Michael. Sorry if I over complicated the description. I am starting from square 1 with no experience, so I was simply not sure where to start. Thanks for the suggestion. Also, if you have a suggestion for other online resources that would be useful in creating a mouse tracking experiment, that would be great. I appreciate your help.

Do you think this is something I can create in the Builder? Again, I want to track mouse position continuously on every trial. Need to control the timing of presentation of a visual image, based on when participants move the mouse out of a start square and toward one of two targets. I can currently run this in Expyriment using preexisting code from I’m hoping to convert it to a working experiment in PsychoPy.