[open] Using a GazePoint GP3 eye tracker with OpenSesame
Dear fellow Opensesame users,
I've been looking in to using a gazepoint GP3 eye tracker with Opensesame, with some success, but I'm concerned I'm doing this in an inelegant, or even dangerous way. (note: I have of course read the existing threads about the using a gazetracker eye tracker with Opensesame).
The GP3 is treated as a network device, and it's possible to communicate with it via the API through XML commands. I can communicate with it using sockets and python inline scripts- this is all fine.
I am wanting to log certain data from the eye tracker (left/right eye focus at a particular time etc.) during experimental trials, which are of a variable length - terminating upon a keypress event in the experimental trial. (nb. I also want to record the keypress data).
I've created a global variable to flag when the eyetracker should be recording. The experimental trial runs parallel (in a parallel item) with an inline script that polls the eye tracker continuously whilst the previously mentioned flag is true. When the experimental trial is finished (e.g. a key has been pressed), another inline script (below the keypress event) sets the global flag to zero. This stops the recording (and writing the x,y and time co-ordinates to the log file via self.log(). Hopefully this makes sense.
Is there a better way to run the script to collect the eye tracking data for an arbitrary period of time? Does what I have done make you want to physically vomit? If so, and you have a superior / safer way of doing this, I would be really grateful if you could let me know.
Also, to try and record timing for the eye tracker data relative to logging data from the keypress event, I've used another global variable that records the time at the start of the trial. Again, I suspect this is quite a crime.
If you think how I might better achieve my aims, I'd be really grateful!