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
Settingsclass. 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:
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.
Example:
tracker.send_message("TRIALID 1") tracker.send_message("STIMULUS_ONSET image.png") tracker.send_message(f"RESPONSE key={response} rt={rt:.3f}")
Direct pylink Access
For full low-level control, the underlying pylink.EyeLink object is available
as the tracker attribute. This gives access to every method in SR Research’s
pylink library.
# Access the underlying pylink.EyeLink object
el = tracker.tracker # pylink.EyeLink instance
# Use any pylink method directly
el.sendCommand("calibration_type = HV9")
el.getNewestSample()
el.isRecording()
el.getTrackerVersion()
# Read tracker responses
el.readRequest("sample_rate")
result = el.readReply()
See Also
EyeLink Commands Reference – Full list of all EyeLink commands
Default Settings – Default values for settings exposed through the Python API