| Reference | Downloads | Github

End routine when mouse is on specific location(component)

I’m building an experiment where the participants have to be looking at the fixation point before starting each trials.

As it turns out the eyetracker I bought(tobii 4c) does not provide any raw data for me to work with.

So I came up with a creative solution to use Gaze Point(tobii Dynavox) as a mouse input, so the participants will have to ‘click’ the fixation point with their gaze in order to start the next trial.

However, “the click when dwelling on the button for certain amount of time” does not work on psychopy, so I thought that by using ‘mouse.getPos()’, and ‘mouse.time’ I would be able to make a routine where the routine ends when the participant makes the mouse(Controlled by their gaze) linger on the fixation point for more than 100ms.

To my dismay, this does not work. Is there a way for me to make this work?

To clarify what I’m trying to achieve is

  1. make the routine end when the mouse lingers on a certain component for more than 100ms


  1. find a way to make the participants ‘click’ with out using the mouse and only using their gaze(with tobii 4c and without the pro SDK)

if np.any(mouse.getPos()== polygon2) && len(mouse.time()) > 0.1:
continueRoutine = False

ah I solved it!

by using

 while polygon2.contains(mouse):
       continueRoutine = False 

in the each frame tab.