Logo Search packages:      
Sourcecode: libcaca version File versions  Download package

unsigned int caca_wait_event ( unsigned int  event_mask  ) 

Wait for the next mouse or keyboard input event.

This function returns the first mouse or keyboard event in the queue that matches the event mask. If no event is pending, it blocks until a matching event is received. event_mask must have a non-zero value. See also caca_get_event() for a non-blocking version of this function.

Parameters:
event_mask Bitmask of requested events.
Returns:
The next event in the queue.

Definition at line 123 of file event.c.

References CACA_EVENT_NONE.

{
    if(!event_mask)
        return CACA_EVENT_NONE;

    for( ; ; )
    {
        unsigned int event = _get_next_event();

        if(event & event_mask)
            return event;

        _caca_sleep(10000);
    }
}


Generated by  Doxygen 1.6.0   Back to index