% This is the main function of the Eyelink toolbox

% For general advice, try:
help Eyelink

% For a more detailed explanation of any Eyelink function, just add a question mark “?”.
% E.g. for ‘Initialize’, try either of these equivalent forms:
Eyelink Initialize?

% If you think you’ve found a bug, please report it
on the forum, see: http://psychtoolbox.org/

% Initialize or shutdown Eyelink connection:
[status =] Eyelink(‘Initialize’ [, displayCallbackFunction])
[status =] Eyelink(‘InitializeDummy’ [, displayCallbackFunction])
[status =] Eyelink(‘IsConnected’)
[status =] Eyelink(‘SetAddress’, ipaddress);
oldlevel = Eyelink(‘Verbosity’ [,level]);
[status =] Eyelink(‘OpenFile’, filename [, dontOpenExisting=0])
[status =] Eyelink(‘CloseFile’)
[status =] Eyelink(‘ReceiveFile’,[‘filename’], [‘dest’], [‘dest_is_path’])
[status =] Eyelink(‘SendFile’, src, dest, dest_is_path)

% Calibration:
[result =] Eyelink(‘StartSetup’ [, stype=0])
[status = ] Eyelink(‘DriftCorrStart’, x, y [,dtype=0][, dodraw=1][, allow_setup=0])
[result = ] Eyelink(‘ApplyDriftCorr’)
[result, tx, ty] = Eyelink(‘TargetCheck’)
[result = ] Eyelink(‘AcceptTrigger’)
[result, messageString =] Eyelink(‘CalMessage’)

% Start or stop recording and acquiring data:
[startrecording_error =] Eyelink(‘StartRecording’ [,file_samples, file_events, link_samples, link_events] )
error = Eyelink(‘CheckRecording’)
eyeused = Eyelink(‘EyeAvailable’)
NewOrOld = Eyelink(‘NewFloatSampleAvailable’)
sample = Eyelink(‘NewestFloatSample’)
[sample, raw] = Eyelink(‘NewestFloatSampleRaw’ [, eye])
type = Eyelink(‘GetNextDataType’)
item = Eyelink(‘GetFloatData’, type)
[item, raw] = Eyelink(‘GetFloatDataRaw’, type [, eye])
[samples, events, drained] = Eyelink(‘GetQueuedData’[, eye])

% Miscellaneous functions to communicate with Eyelink:
result = Eyelink(‘ButtonStates’)
[status =] Eyelink(‘Command’, ‘formatstring’, […])
[status =] Eyelink(‘Message’, ‘formatstring’, […])
[result =] Eyelink(‘SendKeyButton’, code, mods, state)
[time =] Eyelink(‘TrackerTime’)
[offset =] Eyelink(‘TimeOffset’)
[status =] Eyelink(‘RequestTime’)
[time =] Eyelink(‘ReadTime’)
[mode =] Eyelink(‘TrackerMode’)
[result, reply =] Eyelink(‘ReadFromTracker’, VariableName)

% Miscellaneous Eyelink functions:
[result =] Eyelink(‘WaitForModeReady’, maxwait)
[result =] Eyelink(‘ImageModeDisplay’)
mode = Eyelink(‘CurrentMode’)
result = Eyelink(‘CalResult’)
[version, versionString] = Eyelink(‘GetTrackerVersion’)
[time =] Eyelink(‘TrackerTime’)
[offset =] Eyelink(‘TimeOffset’)
[status] = Eyelink(‘ImageTransfer’, imagePath [, xPosition=0][, yPosition=0][, width=0][, height=0][, trackerXPosition=0][, trackerYPosition=0][, xferoptions=0])
[status] = Eyelink(‘ImageTransfer’, imageArray [, xPosition=0][, yPosition=0][, width=0][, height=0][, trackerXPosition=0][, trackerYPosition=0][, xferoptions=0])
[versionString] = Eyelink(‘EDKVersion’)

% Eyelink Velocity related functions:
[vel, acc, fsample]= Eyelink(‘CalculateOverallVelocityAndAcceleration’ [, sample_model])
[vel,fsample] = Eyelink(‘CalculateVelocity’ [,sample_model] )
[x_vel,y_vel,fsample] = Eyelink(‘CalculateVelocityXY’ [,sample_model] )

% EyelinkToolbox version for the OpenGL PsychToolbox
% The EyelinkToolbox was developed by:

Frans Cornelissen  
Enno Peters  
John Palmer  
Chris Burns  
Mario Kleiner  
Erik Flister  
Nuha Jabakhanji  
Brian Richardson  
Kurt Debono  
Marcus Johnson  

The EyelinkToolbox can be used to ceate eye-movement experiments and
control the SR-Research Eyelink gazetrackers (https://www.sr-research.com/)
from within Octave and Matlab.

It is incorporated into the PsychToolbox (http://www.psychtoolbox.org/)
and uses the functions provided by the PsychToolbox for graphics and sound.

To use Eyelink, you must also install the SR-Research runtime libraries,
downloadable from the Support Section of their website (see above).

For a complete list of available functions type “Eyelink” in the command
window. For an explanation of any particular Eyelink function just add a
question mark “?” after a command.

E.g. for ‘Initialize’, try either of these equivalent forms:
Eyelink Initialize?

[optional arguments]:
Brackets in the function list, e.g. [remport], indicate optional arguments,
not matrices. Optional arguments must be in order, without omitting earlier

If you need examples to get you started, check out the EyelinkDemos
folder (help EyelinkDemos).

More information on this toolbox can be found in the file:
EyelinkToolbox/contents.m (help EyelinkToolbox)

The EyeLink Toolbox requires the EyeLink Developers Kit installed to
provide the dependency libraries. Please register a user account (free)
at https://www.sr-support.com for access to all support related
information and software downlaods from SR-Research