[−][src]Function libeyelink_sys::eyelink_flush_keybuttons
pub unsafe extern "C" fn eyelink_flush_keybuttons(
enable_buttons: INT16
) -> INT16
@ingroup elbutton Causes the EyeLink tracker and the EyeLink library to flush any stored button or key events. This should be used before a trial to get rid of old button responses. The \c <enable_buttons> argument controls whether the EyeLink library will store button press and release events. It always stores tracker key events. Even if disabled, the last button pressed and button flag bits are updated.
@param enable_buttons Set to \c 0 to monitor last button press only, \c 1 to queue button events. @return Always \c 0.
\b Example:
\code UINT32 wait_time = 5000; int i; eyelink_flush_keybuttons(0); wait_time += current_msec(); while(eyelink_is_connected()) { if(getkey()==27 || !eyelink_is_connected()) break; i = eyelink_last_button_press(NULL); if(i) { eyemsg_printf("WAITBUTTON %d", i); break; } if(current_time() > wait_time) { eyemsg_printf("WAITBUTTON TIMEOUT"); break; } } \endcode
\b Output:
\code BUTTON 19585661 5 1 MSG 19585662 WAITBUTTON 5 BUTTON 19586005 5 0 \endcode
\sa \c eyelink_button_states(), \c eyelink_last_button_press(), \c eyelink_read_keybutton() and \c eyelink_send_keybutton()