It looks like you're new here. If you want to get involved, click one of these buttons!
Is there a way to create invisible boundary triggers with open sesame? The effect that I want to achieve is to tabulate how many trials participants move their gaze from a central fixation before prompted to do so.
There isn't a ready-made plug-in, but you could use an inline_script to do so using exp.eyelink.sample() (see here). An example script that waits until the gaze position has been moved too far from a central fixation point:
(place the following in the Run phase of an inline_script item)
# import relevant stuff
from openexp.canvas import canvas
# max deviation
maxdev = 60 # pixels from fixation dot
# fixation position at half the screen width and half the screen height (i.e.: the screen center)
fixpos = (self.get("width")/2, self.get("height")/2)
# draw and show the fixation canvas
cv = canvas(exp)
# show canvas and wait for movement
moved = False
t0 = cv.show()
while not moved:
x, y = exp.eyelink.sample() # the sample method returns the most recent x and y gaze coordinates
if (x-fixpos)**2 + (y-fixpos)**2 > maxdev**2:
t1 = self.time()
moved = True
# save some variables, to use in the OpenSesame GUI
Does this help?