[Overview][Constants][Types][Classes][Index] Reference for unit 'ptc' (#ptc)

IPTCConsole.NextEvent

Returns the next event from the event queue and removes it from the queue.

Declaration

Source position: baseconsoled.inc line 60

function IPTCConsole.NextEvent(

  out AEvent: IPTCEvent;

  AWait: Boolean;

  const AEventMask: TPTCEventMask

):Boolean;

Arguments

AEvent

  

The event returned by the function.

AWait

  

Whether the function should wait for an event if necessary.

AEventMask

  

The event mask.

Function result

Whether the function has returned an event.

Description

Returns the first event from the event queue, that matches the specified event mask and removes it from the queue. The event is returned in the AEvent parameter. Please note that this is both an input and output parameter. On entry, the function frees the event, passed by the AEvent parameter and then makes it point to the event returned by the function. This event must be freed by the application, otherwise a memory leak will occur. To peek for an event, without removing it from the queue, the IPTCConsole.PeekEvent function should be used instead. If no event that matches the specified mask is currently present on the event queue, the function returns NIL if the AWait parameter is FALSE or blocks and waits for such an event to arrive if the AWait parameter is TRUE.