break_pressed

Function break_pressed 

Source
pub unsafe extern "C" fn break_pressed() -> INT16
Expand description

@ingroup keyinput Tests if the program is being interrupted. You should break out of loops immediately if this function does not return \c 0, if \c getkey() return \c TERMINATE_KEY, or if \c eyelink_is_connected() returns \c 0.

@remarks Warning: Under Windows XP, this call will not work in realtime mode at all, and will take several seconds to respond if graphics are being drawn continuously. This function works well in realtime mode under Windows 2000. @return \c 1 if CTRL-C is pressed, \c terminal_break() was called, or the program has been terminated with ALT-F4; \c 0 otherwise.

\b Example:

\code

#include 

eyelink_flush_keybuttons(0);

while(1)
{
if((error=check_recording())!=0) return error;

if(break_pressed())
return ABORT_EXPT;

if(escape_pressed())
return SKIP_TRIAL;

...
}
\endcode

\sa \c echo_key(), \c escape_pressed() and \c getkey()