Gaze-contingent script pausing
I am quite new to Pylink and Pygaze, so apologies if this question might come across as a bit naive.
I have set up a simple experiment which presents a sequence of images paired with a sound. I would like the trials to pause as soon as the participant (a baby) looks away from the screen.
I haven't been able to find any re-usable code with this purpose: I only have the vague intuition that it should be done with some native Pylink classes like tracker.getNewestSample() or Event.getRightEye().getGaze(). I am not sure at which point of the code this should be done, in other words how to make sure that at all times the program checks that the gaze is within the screen.
Thanks so much in advance for the help!!!