Back to main

 

Function 23 - wait for events with a timeout

 

If the message queue is empty, waiting for the message in the queue to appear, but not more than the specified time. Then reads the message from the queue.

 

Options:

  * eax = 23 - function number

  * ebx = timeout (in hundredths of a second)

Return value:

  * eax = 0 - the message queue is empty

  * otherwise eax = event (see the list of events)

 

Remarks:

  Only those events that are included in the mask set by function 40 are taken into account. By default, these are redrawing events, pressing keys and buttons.

  To check if there is a message in the queue, use function 11. To wait indefinitely, use function 10.

  Passing ebx = 0 results in an instant return of eax = 0.

  In the current implementation, an immediate return from the function with eax = 0 will occur if the addition of ebx with the current value of the time counter causes a 32-bit overflow.

 

Constants for registers:

  eax - SF_WAIT_EVENT_TIMEOUT (23)