SystemEvent
returns Is this a system event (i.e., a DA event)?
SystemEvent is called by the Event Manager as a way to watch for certain events and pass some of them directly to DAs, without b othering your
application. This function should not be called by applications.
theEvent is the address of a 16-byte EventRecord. It contains information Returns: A Boolean; it identifies whether the event should be handled by an application or a DA. It is one of:
FALSE (0) This event should be passed to the application. It may be a system event the application should handle by calling
TRUE (1) This event should be handled by the system (i.e., a DA). It will not be forwarded to the application.
idea is to avoid clogging up your event loop; let the system handle such
events as keystrokes, mouse-ups, updates, and activate events occuring in a
DA window.
If you want to get a look at all events, you can store a 0 in the 1-byte
global variable SEvtEnb (at 0x015c). This will cause GetNextEvent to forward all unmasked events to you.
When a DA creates a window ( including a modeless dialog) it must set the
windowKind to its refnum, which is a negative number. When the
your window is a modeless dialog you would call IsDialogEvent, which SystemEvent) checks the windowKind looking for a value of 2 (for
dialogs). Since your dialog's windowKind is a negative number, the DA's
refnum, IsDialogEvent does nothing. The solution is to change the windowKind of your window to 2 before calling IsDialogEvent. This allows the Dialog Manager to recognize and handle the event properly. Be sure to restore the windowKind to its former value before returning to
with the same event (it should pass all events to the Dialog Manager if it has