[][src]Function libeyelink_sys::message_pump

pub unsafe extern "C" fn message_pump() -> INT16

allows messages to operate in loops returns nonzero if app terminated eats key events, places on key queue for getkey() getkey() and echo_key() also call this function

calling this in loops allows Windows to process messages returns nonzero if application terminated (ALT-F4 sent to window) set <dialog_hook> to handle of modeless dialog in order to properly handle its messages as well Almost all experiments must run in a deterministic fashion, executing sequentially and in loops instead of the traditional Windows event-processing model. However, Windows messages must still be dispatched for keyboard input and other events. Calling \c getkey() will dispatch messages and return keys. The \c message_pump() function also dispatches messages, but does not read the keys. It can also handle messages for a modeless dialog box.

@return \c 0 normally, \c 1 if ALT-F4 or CTRL-C pressed, or if \c terminal_break() called. Any loops should exit in this case.

\b Example: The following two programs works together to show the use of \c message_pump() function. In this case, writes a message to EDF file when the left mouse button is pressed.

\code
#include 

while(1)
{
...

message_pump(NULL);
}
\endcode

\code

#include 
switch (message)
{
case WM_KEYDOWN:
case WM_CHAR:
process_key_messages(hwnd, message, wparam, lparam);
break;

case WM_LBUTTONDOWN:
eyemsg_printf("Left button is down");
break;
...
}
\endcode

\b Output:

\code
MSG	11661891 SYNCTIME 1
MSG	11662745 left button is down
MSG	11663048 left button is down
BUTTON	11665520	4	1
MSG	11665521 ENDBUTTON 4
\endcode

\sa \c pump_delay()