[][src]Function libeyelink_sys::terminal_break

pub unsafe extern "C" fn terminal_break(assert: INT16)

ASYNCHRONOUS BREAKOUTS *********/ Because Windows is multi-tasking, some other event (i.e. a timer event or ALT-TAB) may affect your application during loops or calibration. Your event handlers can call these functions to stop ongoing operations

call from Windows event handlers when application must exit forces calibration or drift correction to exit with result=27 when is nonzero, will caused break_pressed() to test true continuously, also causes getkey() to return TERMINATE_KEY If is 0, will restore break_pressed() and getkey() to normal This function can be called in an event handler to signal that the program is terminating. Calling this function with an argument of \c 1 will cause \c break_pressed() to return \c 1, and \c getkey() to return \c TERMINATE_KEY. These functions can be re-enabled by calling \c terminal_break() with an argument of \c 0.

@param assert \c 1 to signal a program break, \c 0 to reset break.

\b Example:

\code

#include 

switch (message)
{
case WM_CLOSE:        // If ALT-F4 pressed, force program to close
PostQuitMessage(0);
terminal_break(1);// break out of loops
break;

case WM_DESTROY:      // Window being closed by ALT-F4
PostQuitMessage( 0 );
...
terminal_break(1);// break out of loops
break;

case WM_QUIT:         // Needs to break out of any loops
terminal_break(1);
break;
...
}
\endcode

\sa \c break_pressed() and \c getkey()