Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

Sampling eye data while waiting for response


I have an (EEG) experiment where I would like to check whether pp hold fixation using an Eyelink 1000 while they perform visual search. I have written some code that worked in the past. However, in this experiment I am using the keyboard response item and now I am not really sure how to implement my code. Basically, I need to continuously sample x, y coordinates while waiting for the response. If I understand the keyboard item correct, however, the experiment basically freezes untill a response is given or response time is running out.

How could I get around this?




  • Hi Dirk,

    Yes, you are right. The experiment freezes during a keyboard item. But, you can easily get what you want by using an inline_script instead of the response item. In that inline_script you have a while loop that keeps on running until a timeout or a response was given. Importantly, you set the timeout of "keyboard.get_key(timeout = 0)" to a very low value (doesn't really matter which). Once that is set up you can add the eyelink functionality to the while loop (exp.pygaze_eyetracker.sample()) and you should have all you need.

    Does that make sense?


  • Hi Eduard,

    Thanks yes that makes a lot of sense actually. For some reason I thought there would be another way but this sounds easy enough. Thanks!

Sign In or Register to comment.