mav_eventsCheck(3)

NAME
mav_eventsCheck - Check for input device events.

LEVEL
Maverik Level 1

SYNTAX
int mav_eventsCheck(void);

DESCRIPTION
This function calls the check event function for each registered input device, in the order in which they were registered. If any of the devices' check event functions detects an event has occurred on that device, and an appropriate callback has been registered for that event type, the callback is executed and mav_eventsCheck returns immediately.

The return value of the callback forms the return value of this function. If no events are detected the return value is zero. If, and how, this return value is interpreted is an application-specific issue. For example, it could be used to control the drawing of frames. Consider the following three rendering loops:

<cod>
    while ( 1 ) {
       if ( mav_eventsCheck() ) {
         /* draw frame */
       }
    }

    while ( 1 ) {
       mav_eventsCheck();
       /* draw frame */
    }
    while ( 1 ) {
       while ( mav_eventsCheck() ) {}
       /* draw frame */
    }
</cod>
The first loop would only draw a new frame in response to an event occurring
for which the callback function returns a true value. The second loop
ignores the return value and draws frames in a continuous loop. The
third example processes all outstanding events before drawing a frame.

SEE ALSO
mav_deviceNew