[][src]Function libeyelink_sys::do_drift_correct

pub unsafe extern "C" fn do_drift_correct(
    x: INT16,
    y: INT16,
    draw: INT16,
    allow_setup: INT16
) -> INT16

PERFORM DRIFT CORRECTION ON TRACKER Performs a drift correction, with target at (x,y). * If operator aborts with ESC, we assume there's a setup * problem and go to the setup menu (which may clear the * display). Redraw display if needed and repeat the * call to do_drift_correct() in this case. * ARGS: x, y: position of target * draw: draws target if 1, 0 if you draw target first * allow_setup: 0 disables ESC key setup mode entry * RETURNS: 0 if OK, 27 if Setup was called, TERMINATE_KEY if pressed * Performs a drift correction before a trial.

@remarks When the 'ESC' key is pressed during drift correction, \c <allow_setup> determines the result. If \c 1, the EyeLink Setup menu is accessed. This will always clear the display, so redrawing of hidden stimuli may be required. Otherwise, the drift correction is aborted. Calling \c exit_calibration() from an event handler will cause any call to \c do_drift_correct() in progress to return immediately. In all cases, the return code will be \c 27 (\c ESC_KEY). @param x X Position of drift correction target. @param y Y Position of drift correction target. @param draw If \c 1, the drift correction will clear the screen to the target background color, draw the target, and clear the screen again when the drift correction is done. If \c 0, the fixation target must be drawn by the user. @param allow_setup If \c 1, accesses Setup menu before returning, else aborts drift correction. @return \c 0 if successful, \c 27 if 'ESC' key was pressed to enter Setup menu or abort.

\b Example:

\code

#include 

int target_shown = 0;
int draw_own_target = 1;

while(1)
{
if(!eyelink_is_connected())
return ABORT_EXPT;

if (draw_own_target && !target_shown)
{
target_shown = 1;
}

error = do_drift_correct(SCRWIDTH/2, SCRHEIGHT/2,
draw_own_target, 1);

if(error!=27)
break;
else
target_shown = 0;
}
\endcode

\sa \c do_tracker_setup() and \c set_dcorr_sounds()