Direct Tracker Control

PyeLink wraps common EyeLink operations through its Python API, but you always have full access to send any command directly to the tracker hardware. This is essential for advanced configurations or commands not yet exposed through the Settings class.

Sending Commands

EyeLink.send_command(command)[source]

Send a raw command to the EyeLink tracker.

This gives direct access to any EyeLink command, including those not exposed through the Settings class. Commands configure tracker behavior but are not recorded in the data file.

See EyeLink Commands Reference for a full list of available commands.

Parameters:

command (str) – EyeLink command string (same syntax as INI files on Host PC)

Return type:

None

Example:

# Change sample rate
tracker.send_command("sample_rate = 500")

# Set screen coordinates
tracker.send_command("screen_pixel_coords = 0 0 1919 1079")

# Configure parser thresholds
tracker.send_command("select_parser_configuration 0")

# Any command from the EyeLink Host PC INI files works
tracker.send_command("heuristic_filter 1 2")

Sending Messages

EyeLink.send_message(message)[source]

Send a timestamped message recorded in the EDF data file.

Messages are annotations in the data file, useful for marking events during recording (trial starts, stimulus onsets, responses, etc.). Each message is timestamped by the tracker with microsecond precision.

Parameters:

message (str) – Message string to record in EDF file

Return type:

None

Example:

tracker.send_message("TRIALID 1")
tracker.send_message("STIMULUS_ONSET image.png")
tracker.send_message(f"RESPONSE key={response} rt={rt:.3f}")

See Also