How to confirm driftcorrection with another key? (Eyelink toolbox)

Dear all,

in one of our experiments a driftcorrection is implemented and our subjects are right now confirming their fixation via the spacebar. I'd rather would like them to be able to do so via a gamepad button, but fail to find a solution.

Driftcorrection is called via


Eyelink('DriftCorrStart',cfg.Screen.center(1),cfg.Screen.center(2),1,1,1);


in our code.


This brings up a fixation dot to the screen and waits for the spacebar to be pressed. I think this directly calls the mex-file into action.


An alternative seems to be a call to

EyelinkDoDriftCorrect.m

but in line 58 (or 82?) it potentially would just again call the mex-file.


I'm a little lost here... any ideas where to start are appreciated.


Best,

Milosz



Normally the drift correction functions (cfe. EyelinkGetTrackerImageDemo) would call PsychEyelinkDispatchCallback periodically to get feedback from the PTB machine to the Eyelink tracker machine. That in turn would call EyelinkGetKey, which uses KbCheck to get keyboard input.

You can make a private copy of PsychEyelinkDispatchCallback.m, under a new filename and function name, then customize it to your needs, and then tell EyelinkInit() to use your callback, e.g., EyelinkInit([], 'myCallback') if your function is myCallback.m.

Or you just override EyellinkGetKey.m with your own copy that is stored in a folder earlier on your Octave/Matlab path so it overrides PTB's version.

If your custom input device is adressable via KbCheck(deviceIndex) for a suitable deviceIndex, you could also just set el.devicenumber = deviceIndex after EyelinkInitDefaults, then call EyelinkUpdateDefaults(el).

Btw. error handling if something goes wrong in the callback function is essentially to either do nothing or to crash iirc, so be careful, debugging is not much fun there.

Oh and all this adivce is untested, just based on memory.
-mario