Connector Class

This class provides methods for interacting with the Eyelink from psychopy.

class pylinkwrapper.connect(window, edfname)

Provides functions for interacting with the EyeLink via Pylink.

Parameters:
  • window – Psychopy window object.
  • edfname – Desired name of the EDF file.
calibrate(cnum=13, paval=1000)

Calibrates eye-tracker using psychopy stimuli.

Parameters:
  • cnum (int) – Number of points to use for calibration. Options are 3, 5, 9, 13.
  • paval (int) – Pacing of calibration, i.e. how long you have to fixate each target.
drawIA(x, y, size, index, color, name)

Draws square interest area in EDF and a corresponding filled box on eye-tracker display.

Parameters:
  • x (float or int) – X coordinate in degrees visual angle for center of check area.
  • y (float or int) – Y coordinate in degrees visual angle for center of check area.
  • size (float or int) – length of one edge of square in degrees visual angle.
  • index (int) – number to assign interest area in EDF
  • color (int) – color of box drawn on eye-tracker display (0 - 15)
  • name (str) – Name interest area in EDF
drawText(msg)

Draws text on eye-tracker screen.

Parameters:msg (str) – Text to draw.
endExperiment(spath)

Closes and transfers the EDF file.

Parameters:spath (str) – File path of where to save EDF file. Include trailing slash.
fixCheck(size, ftime, button)

Checks that fixation is maintained for certain time.

Parameters:
  • size (float or int) – Length of one side of box in degrees visual angle.
  • ftime (int) – Length of time to check for fixation in seconds.
  • button (char) – Key to press to recalibrate eye-tracker.
recordOFF()

Stops recording.

recordON(sendlink=False)

Starts recording. Waits 50ms to allow eyelink to prepare.

Parameters:sendlink (bool) – Toggle for sending eye data over the link to the display computer during recording.
sendCommand(cmd)

Sends a command to the Eyelink.

Parameters:cmd (str) – Command to send.
sendMessage(txt)

Sends a message to the tracker that is recorded in the EDF.

Parameters:txt (str) – Message to send.
sendVar(name, value)

Sends a trial variable to the EDF file.

Parameters:
  • name (str) – Name of variable.
  • value (float, str, or int) – Value of variable.
setStatus(message)

Sets status message to appear while recording.

Parameters:message (str) – Text object to send, must be < 80 char
setTrialID(idval=1)

Sends message that indicates start of trial in EDF.

Parameters:idval – Values to set TRIALID.
setTrialResult(rval=0, scrcol=0)

Sends trial result to indiciate trial end in EDF and clears screen on EyeLink Display.

Parameters:
  • rval (float, str, or int) – Value to set for TRIAL_RESULT.
  • scrcol – Color to clear screen to. Defaults to black.