|Lets you check for the presence of input events without having to stop and wait for them. More...|
Lets you check for the presence of input events without having to stop and wait for them.
If you use the "Get" routines, the system always stops and waits for the event you specify to occur. If you use the "Enable" routines, you normally call Await_Event() to stop and wait for any enabled event to occur. But you also have the option of checking events occasionally, without blocking.
Check_For_Events() returns a value, if zero, indicates there are no events ready. If the value is non-zero, it indicates that there are at least that many events ready. The "ready" events can be retrieved, one at a time, with Await_Event() .
The most common use for checking-without-stopping is in cases where you're involved in a long laborious calculation in the background checking without stopping gives the user a chance to get a word in edgewise.
Check_For_Events() is generally used by calling it in a loop ("awaiting" and dispatching one event per loop cycle) until the return value becomes zero. Then you can go on until you need to abort the long calculation.