Event Manager Reference (Not Recommended)

Framework
Carbon/Carbon.h
Declared in
CarbonEvents.h
CarbonEventsCore.h
Events.h

Overview

The Event Manager is a legacy System 7 technology that was created to support the cooperative, multitasking environment available on Macintosh computers at the time. This environment allowed users to switch between many open applications and allows other applications to receive background processing time.

The Carbon Event Manager, introduced in Mac OS X, offers a simple yet flexible approach to event handling that greatly reduces the amount of code needed to write a basic application. Moreover, the Carbon Event Manager's streamlined event handling enhances system performance on Mac OS X through more efficient allocation of processing time. Applications that use the Carbon Event Manager not only run better on Mac OS X, they help improve overall performance and responsiveness.

Since the introduction of the Macintosh computer, Mac applications have used the Event Manager to receive information about actions performed by the user, to receive notices of changes in their processing, and to communicate with other applications. For example, an application can retrieve information from the Event Manager about whether the user has pressed a key or the mouse button, whether one of the application’s windows needs updating, or whether some other hardware-related or software-related action requires a response from the application.

Applications also used the Event Manager to support the cooperative, multitasking environment available on versions of the Mac OS that preceded Mac OS X. This environment allows users to switch between many open applications and allows other applications to receive background processing time. By using Event Manager routines, an application allowed the system software to coordinate the scheduling of processing time between it and other applications.

Carbon supports the majority of the Event Manager.

High-level events APIs (as contained in EPPC.h) are not supported. You should use Apple events instead.

Carbon does not support the diskEvt event. Support for volume mount and unmount events will be available in the Carbon Event Manager.

Carbon does not set the convertClipboardFlag in the EventRecord to indicate that the scrap has changed while the application was suspended. You should call the Scrap Manager function GetCurrentScrap instead.

Low-level event queue functions, such as GetEvQHdr and PPostEvent, are no longer supported.

Application-defined function-key procedures are not supported in Carbon.

Functions by Task

Accessors for Low-Memory Globals

Getting Timing Information

Making Keyboard Settings

Reading the Keyboard

Receiving Events

Sending Events

Miscellaneous

Functions

CheckEventQueueForUserCancel

Checks the event queue for an user-cancel event.

Boolean CheckEventQueueForUserCancel (
   void
);
Return Value

Returns true if a user-cancel event is in the queue, false otherwise.

Availability
  • Available in OS X v10.0 and later.
Declared In
CarbonEvents.h

GetCaretTime

Obtains the suggested difference in ticks that should exist between blinks of the caret (usually a vertical bar marking the insertion point) in editable text.

UInt32 GetCaretTime (
   void
);
Return Value

The blink delay, in ticks.

Discussion

If your application supports editable text, your application should use the value returned by GetCaretTime to determine how often to blink the caret. If your application uses only TextEdit, you can use TextEdit functions to automatically blink the caret at the time interval that the user specifies in the General Controls panel.

Availability
  • Available in OS X v10.0 and later.
  • Not available to 64-bit applications.
Declared In
Events.h

GetCurrentKeyModifiers

Returns the current state of the keyboard modifier keys.

UInt32 GetCurrentKeyModifiers (
   void
);
Parameters
Return Value

A bit mask indicating which keyboard modifier keys are pressed. See “Event Modifier Constants” for a list of possible values.

Discussion

GetCurrentKeyModifiers provides a more convenient way to get the modifier key state than calling GetNextEvent. It returns a value whose individual bits indicate which keyboard modifier keys are currently being pressed. You can test for the Caps Lock, Shift, Control, Option, and Command keys.

Availability
  • Available in OS X v10.0 and later.
Related Sample Code
Declared In
CarbonEventsCore.h

GetDblTime

Determines whether a sequence of mouse events constitutes a double click.

UInt32 GetDblTime (
   void
);
Return Value

The suggested maximum elapsed time, in ticks, between a mouse-up event and a mouse-down event.

Discussion

The GetDblTime function returns the suggested maximum elapsed time, in ticks, between a mouse-up event and a mouse-down event. The user can adjust this value using the Mouse control panel.

If your application distinguishes a double click of the mouse from a single click, your application should use the value returned by GetDblTime to make this distinction. If your application uses TextEdit, the TextEdit functions automatically recognize and handle double clicks of text within a TextEdit edit structure by appropriately highlighting or unhighlighting the selection.

The ratio of ticks to value in the DoubleTime global variable is 1:1. However, the Finder multiplies DoubleTime by 2 to determine double click time because it needs to account for user problems that typically occur during icon arrangement. Therefore, the Finder uses DoubleTime*2 whereas the rest of the system uses DoubleTime.

Incidentally, the Finder does not limit the DoubleTime to 64 ticks. In most places, it treats it like a byte although in some others it treats it like a longword. The best method would be to provide a one-second double-byte (two seconds in the Finder).

Availability
  • Available in OS X v10.0 and later.
  • Not available to 64-bit applications.
Declared In
Events.h

GetGlobalMouse

Obtains the position of the mouse, in global coordinates.

void GetGlobalMouse (
   Point *globalMouse
);
Parameters
globalMouse

The position of the mouse, as a global point.

Availability
  • Available in OS X v10.0 and later.
  • Not available to 64-bit applications.
Declared In
CarbonEventsCore.h

GetKeys

Obtains the current state of the keyboard.

void GetKeys (
   KeyMap theKeys
);
Parameters
theKeys

On output, the current state of the keyboard, including the keypad, if any.

Discussion

You can use the GetKeys function to determine the current state of the keyboard at any time. For example, you can determine whether one of the modifier keys is down by itself or in combination with another key using the GetKeys function.

Availability
  • Available in OS X v10.0 and later.
Declared In
Events.h

LMGetKbdLast

Returns a value that specifies the last physical keyboard type used.

UInt8 LMGetKbdLast (
   void
);
Return Value

The last physical keyboard type used.

Availability
  • Available in OS X v10.0 and later.
Declared In
Events.h

LMGetKbdType

Returns a value that specifies the physical keyboard type.

UInt8 LMGetKbdType (
   void
);
Return Value

The physical keyboard type.

Availability
  • Available in OS X v10.0 and later.
Related Sample Code
Declared In
Events.h

LMGetKeyRepThresh

Returns the low-memory auto-key rate.

SInt16 LMGetKeyRepThresh (
   void
);
Return Value

The auto-key rate, that is, the amount of time, in ticks, that must elapse before the Event Manager generates a subsequent auto-key event.

Availability
  • Available in OS X v10.0 and later.
Declared In
Events.h

LMGetKeyThresh

Returns the low-memory auto-key threshold.

SInt16 LMGetKeyThresh (
   void
);
Return Value

Returns the auto-key threshold, that is, the amount of time, in ticks, that must elapse before the Event Manager generates an auto-key event.

Availability
  • Available in OS X v10.0 and later.
Declared In
Events.h

LMSetKbdLast

Sets a value that specifies the last physical keyboard type used.

void LMSetKbdLast (
   UInt8 value
);
Parameters
value

The physical keyboard type you want to set.

Availability
  • Available in OS X v10.0 and later.
  • Not available to 64-bit applications.
Declared In
Events.h

LMSetKbdType

Sets the keyboard type.

void LMSetKbdType (
   UInt8 value
);
Parameters
value

The physical keyboard type you want to set.

Availability
  • Available in OS X v10.0 and later.
  • Not available to 64-bit applications.
Declared In
Events.h

LMSetKeyRepThresh

Sets the low-memory auto-key rate.

void LMSetKeyRepThresh (
   SInt16 value
);
Parameters
value

The low-memory auto-key rate you want to set.

Discussion

LMSetKeyRepThresh sets the low-memory auto-key rate, that is, the amount of time, in ticks, that must elapse before the Event Manager generates a subsequent auto-key event.

Availability
  • Available in OS X v10.0 and later.
  • Not available to 64-bit applications.
Declared In
Events.h

LMSetKeyThresh

Sets the low-memory auto-key threshold.

void LMSetKeyThresh (
   SInt16 value
);
Parameters
value

The low-memory auto-key threshold you want to set.

Discussion

LMSetKeyThresh sets the low-memory auto-key threshold, that is, the amount of time, in ticks, that must elapse before the Event Manager generates an auto-key event.

Availability
  • Available in OS X v10.0 and later.
  • Not available to 64-bit applications.
Declared In
Events.h

SetEventMask

Sets the system event mask of your application to the specified mask.

void SetEventMask (
   EventMask value
);
Parameters
value

A value that specifies which events should be posted in the Operating System event queue. You specify the event mask using one or more of the values defined in “Event Mask Constants.”

Discussion

Your application should not call the SetEventMask function to disable any event types from being posted. Use SetEventMask only to enable key-up events if your application needs to respond to key-up events.

The SetEventMask function sets the system event mask of your application according to the parameter value. The Operating System Event Manager posts only low-level events (other than update or activate events) corresponding to bits in the system event mask of the current process when posting events in the Operating System event queue. The system event mask of an application is initially set to post mouse-up, mouse-down, key-down, auto-key, and disk-inserted events into the Operating System event queue.

Availability
  • Available in OS X v10.0 and later.
  • Not available to 64-bit applications.
Declared In
Events.h

Data Types

EventRecord

Contains information associated with an event.

struct EventRecord {
   EventKind what;
   UInt32 message;
   UInt32 when;
   Point where;
   EventModifiers modifiers;
};
typedef struct EventRecord EventRecord;
Fields
what

The kind of event received. The Event Manager specifies the kind of event with one of the values defined by the EventKind enumeration.

message

Additional information associated with the event. The interpretation of this information depends on the event type. The contents of the message field for each event type are summarized here:

  • For a null, mouse-up, or mouse-down event, the event message is:Undefined.

  • For a key-up, key-down, or auto-key event, the event message is:The low-order word contains the character code and virtual key code, which you can access with the constants charCodeMask and keyCodeMask, respectively. For Apple Desktop Bus (ADB) keyboards, the low byte of the high-order word contains the ADB address of the keyboard where the keyboard event occurred. The high byte of the high-order word is reserved.

  • For an update or activate event, the event message is:A pointer to the window to update, activate, or deactivate.

  • For a disk-inserted event, the event message is:The drive number in the low-order word, the File Manager result code in the high-order word.

  • For a resume event, the event message is:The suspendResumeMessage enumerator in bits 24–31 and a 1 (the resumeFlag enumerator) in bit 0 indicate the event is a resume event. Bit 1 contains a 1 (the convertClipBoardFlag enumerator) if Clipboard conversion is required, and bits 2–23 are reserved.

  • For a suspend event, the event message is:The suspendResumeMessage enumerator in bits 24–31 and a 0 in bit 0 to indicate the event is a suspend event. Bit 1 is undefined, and bits 2–23 are reserved.

  • For a mouse-moved event, the event message is:The mouseMovedMessage enumerator in bits 24–31. Bits 2–23 are reserved, and bit 0 and bit 1 are undefined.

  • For a high-level event, the event message is:

    The class of events to which the high-level event belongs. The message and where fields of a high-level event define the specific type of high-level event received.

when

The when field indicates the time when the event was posted (in ticks since system startup).

where

For low-level events and operating-system events, the where field contains the location of the cursor at the time the event was posted (in global coordinates).

For high-level events, the where field contains a second event specifier, the event ID. The event ID defines the particular type of event within the class of events defined by the message field of the high-level event. For high-level events, you should interpret the where field as having the data type OSType, not Point.

modifiers

The modifiers field contains information about the state of the modifier keys and the mouse button at the time the event was posted. For activate events, this field also indicates whether the window should be activated or deactivated. In System 7 it also indicates whether the mouse-down event caused your application to switch to the foreground.

Each of the modifier keys is represented by a specific bit in the modifiers field of the event structure. The modifier keys include the Option, Command, Caps Lock, Control, and Shift keys. If your application attaches special meaning to any of these keys in combination with other keys or when the mouse button is down, you can test the state of the modifiers field to determine the action your application should take. For example, you can use this information to determine whether the user pressed the Command key and another key to make a menu choice.

Discussion

When your application uses an Event Manager function to retrieve an event, the Event Manager returns information about the retrieved event in an event structure, which is a structure of type EventRecord.

Availability
  • Available in OS X v10.0 and later.
Declared In
Events.h

EvQEl

Defines an event queue entry.

struct EvQEl {
   QElemPtr qLink;
   SInt16 qType;
   EventKind evtQWhat;
   UInt32 evtQMessage;
   UInt32 evtQWhen;
   Point evtQWhere;
   EventModifiers evtQModifiers;
};
typedef struct EvQEl EvQEl;
   typedef EvQEl * EvQElPtr;
Fields
qLink

Next queue entry.

qType

Queue type (evType).

evtQWhat

Event code.

evtQMessage

Event message.

evtQWhen

Ticks since startup.

evtQWhere

Mouse location.

evtQModifiers

Modifier flags.

Discussion

A structure of type EvQEl defines an entry in the Operating System event queue. Each entry in the event queue begins with 4 bytes of flags followed by a pointer to the next queue entry. The flags are maintained by and internal to the Operating System Event Manager. The queue entries are linked by pointers, and the first field of the EvQEl data type, which represents the structure of a queue entry, begins with a pointer to the next queue entry. Thus, you cannot directly access the flags using the EvQEl data type.

Availability
  • Available in OS X v10.0 and later.
Declared In
Events.h

KeyMap

Contains information about the current state of the keyboard.

typedef BigEndianLong KeyMap[4];
Discussion

The type KeyMap is used in GetKeys to return the current state of the keyboard, including the keypad, if any. The KeyMap type is interpreted as an array of 128 elements, each having a Boolean value. Each key on the keyboard or keypad corresponds to an element in the KeyMap array. A KeyMap element is true if the corresponding key is down and false if it isn’t. The maximum number of keys that can be down simultaneously is two character keys plus any combination of the five modifier keys.

Availability
  • Available in OS X v10.0 and later.
Declared In
Events.h

KeyMapByteArray

Contains information about the current state of the keyboard.

typedef UInt8 KeyMapByteArray[16];
Discussion

The type KeyMapByteArray is an alternate version of the type KeyMap for use on little endian platforms.

Availability
  • Available in OS X v10.0 and later.
Declared In
Events.h

Constants

Event Modifier Constants

Define modifiers for event types.

enum {
   activeFlagBit = 0,
   btnStateBit = 7,
   cmdKeyBit = 8,
   shiftKeyBit = 9,
   alphaLockBit = 10,
   optionKeyBit = 11,
   controlKeyBit = 12,
   rightShiftKeyBit = 13,
   rightOptionKeyBit = 14,
   rightControlKeyBit = 15
};
typedef UInt16 EventModifiers;
Constants
activeFlagBit

Available in OS X v10.0 and later.

Declared in Events.h.

btnStateBit

Available in OS X v10.0 and later.

Declared in Events.h.

cmdKeyBit

Available in OS X v10.0 and later.

Declared in Events.h.

shiftKeyBit

Available in OS X v10.0 and later.

Declared in Events.h.

alphaLockBit

Available in OS X v10.0 and later.

Declared in Events.h.

optionKeyBit

Available in OS X v10.0 and later.

Declared in Events.h.

controlKeyBit

Available in OS X v10.0 and later.

Declared in Events.h.

rightShiftKeyBit

Available in OS X v10.0 and later.

Declared in Events.h.

rightOptionKeyBit

Available in OS X v10.0 and later.

Declared in Events.h.

rightControlKeyBit

Available in OS X v10.0 and later.

Declared in Events.h.

charCodeMask

enum {
   charCodeMask = 0x000000FF,
   keyCodeMask = 0x0000FF00,
   adbAddrMask = 0x00FF0000,
   osEvtMessageMask = 0xFF000000
};
Constants
charCodeMask

The enumerator indicating you want your application to receive a character-code keyboard event.

Available in OS X v10.0 and later.

Declared in Events.h.

keyCodeMask

The enumerator indicating you want your application to receive a key-code keyboard event.

Available in OS X v10.0 and later.

Declared in Events.h.

adbAddrMask

The enumerator indicating you want your application to receive an ADB address if there is an ADB keyboard.

Available in OS X v10.0 and later.

Declared in Events.h.

osEvtMessageMask

The enumerator indicating you want your application to receive a keyboard event that can be used to extract a message code.

Available in OS X v10.0 and later.

Declared in Events.h.

convertClipboardFlag

Obsolete in Carbon.

enum {
   convertClipboardFlag = 2
};
Constants
convertClipboardFlag
Discussion

Obsolete in Carbon. To determine if the clipboard has changed while your application was suspended, use the Scrap Manager function GetCurrentScrap.

Carbon Porting Notes

Unsupported. To determine if the clipboard has changed while your application was suspended, use the Scrap Manager function GetCurrentScrap.

Event Modifier Bits

Modifer bits for events.

enum {
   activeFlag = 1 << activeFlagBit,
   btnState = 1 << btnStateBit,
   cmdKey = 1 << cmdKeyBit,
   shiftKey = 1 << shiftKeyBit,
   alphaLock = 1 << alphaLockBit,
   optionKey = 1 << optionKeyBit,
   controlKey = 1 << controlKeyBit,
   rightShiftKey = 1 << rightShiftKeyBit,
   rightOptionKey = 1 << rightOptionKeyBit,
   rightControlKey = 1 << rightControlKeyBit
};
Constants
activeFlag

The enumerator that indicates a window is being activated or that a mouse-down event caused a foreground switch.

Available in OS X v10.0 and later.

Declared in Events.h.

btnState

The enumerator indicating that the mouse button has been released.

Available in OS X v10.0 and later.

Declared in Events.h.

cmdKey

The enumerator indicating that the Command key is being pressed.

Available in OS X v10.0 and later.

Declared in Events.h.

shiftKey

The enumerator indicating that the Shift key is being pressed.

Available in OS X v10.0 and later.

Declared in Events.h.

alphaLock

The enumerator indicating that the Caps Lock key is being pressed.

Available in OS X v10.0 and later.

Declared in Events.h.

optionKey

The enumerator indicating that the Option key is being pressed.

Available in OS X v10.0 and later.

Declared in Events.h.

controlKey

The enumerator indicating that the Control key is being pressed.

Available in OS X v10.0 and later.

Declared in Events.h.

rightShiftKey

Available in OS X v10.0 and later.

Declared in Events.h.

rightOptionKey

Available in OS X v10.0 and later.

Declared in Events.h.

rightControlKey

Available in OS X v10.0 and later.

Declared in Events.h.

HighLevelEventMsgClass

enum {
   HighLevelEventMsgClass = 'jaym',
   rtrnReceiptMsgID = 'rtrn'
};
Constants
HighLevelEventMsgClass

The enumerator indicating a high-level event message class for return receipt.

rtrnReceiptMsgID

The posting enumerator indicating the return receipt message ID.

Character Codes

Define character codes for events.

enum {
   kNullCharCode = 0,
   kHomeCharCode = 1,
   kEnterCharCode = 3,
   kEndCharCode = 4,
   kHelpCharCode = 5,
   kBellCharCode = 7,
   kBackspaceCharCode = 8,
   kTabCharCode = 9,
   kLineFeedCharCode = 10,
   kVerticalTabCharCode = 11,
   kPageUpCharCode = 11,
   kFormFeedCharCode = 12,
   kPageDownCharCode = 12,
   kReturnCharCode = 13,
   kFunctionKeyCharCode = 16,
   kCommandCharCode = 17,
   kCheckCharCode = 18,
   kDiamondCharCode = 19,
   kAppleLogoCharCode = 20,
   kEscapeCharCode = 27,
   kClearCharCode = 27,
   kLeftArrowCharCode = 28,
   kRightArrowCharCode = 29,
   kUpArrowCharCode = 30,
   kDownArrowCharCode = 31,
   kSpaceCharCode = 32,
   kDeleteCharCode = 127,
   kBulletCharCode = 165,
   kNonBreakingSpaceCharCode = 202
};
Constants
kNullCharCode

Available in OS X v10.0 and later.

Declared in Events.h.

kHomeCharCode

Available in OS X v10.0 and later.

Declared in Events.h.

kEnterCharCode

Available in OS X v10.0 and later.

Declared in Events.h.

kEndCharCode

Available in OS X v10.0 and later.

Declared in Events.h.

kHelpCharCode

Available in OS X v10.0 and later.

Declared in Events.h.

kBellCharCode

Available in OS X v10.0 and later.

Declared in Events.h.

kBackspaceCharCode

Available in OS X v10.0 and later.

Declared in Events.h.

kTabCharCode

Available in OS X v10.0 and later.

Declared in Events.h.

kLineFeedCharCode

Available in OS X v10.0 and later.

Declared in Events.h.

kVerticalTabCharCode

Available in OS X v10.0 and later.

Declared in Events.h.

kPageUpCharCode

Available in OS X v10.0 and later.

Declared in Events.h.

kFormFeedCharCode

Available in OS X v10.0 and later.

Declared in Events.h.

kPageDownCharCode

Available in OS X v10.0 and later.

Declared in Events.h.

kReturnCharCode

Available in OS X v10.0 and later.

Declared in Events.h.

kFunctionKeyCharCode

Available in OS X v10.0 and later.

Declared in Events.h.

kCommandCharCode

Available in OS X v10.1 and later.

Declared in Events.h.

kCheckCharCode

Available in OS X v10.1 and later.

Declared in Events.h.

kDiamondCharCode

Available in OS X v10.1 and later.

Declared in Events.h.

kAppleLogoCharCode

Available in OS X v10.1 and later.

Declared in Events.h.

kEscapeCharCode

Available in OS X v10.0 and later.

Declared in Events.h.

kClearCharCode

Available in OS X v10.0 and later.

Declared in Events.h.

kLeftArrowCharCode

Available in OS X v10.0 and later.

Declared in Events.h.

kRightArrowCharCode

Available in OS X v10.0 and later.

Declared in Events.h.

kUpArrowCharCode

Available in OS X v10.0 and later.

Declared in Events.h.

kDownArrowCharCode

Available in OS X v10.0 and later.

Declared in Events.h.

kSpaceCharCode

Available in OS X v10.1 and later.

Declared in Events.h.

kDeleteCharCode

Available in OS X v10.0 and later.

Declared in Events.h.

kBulletCharCode

Available in OS X v10.1 and later.

Declared in Events.h.

kNonBreakingSpaceCharCode

Available in OS X v10.0 and later.

Declared in Events.h.

kShiftUnicode

enum {
   kShiftUnicode = 0x21E7,
   kControlUnicode = 0x2303,
   kOptionUnicode = 0x2325,
   kCommandUnicode = 0x2318,
   kPencilUnicode = 0x270E,
   kCheckUnicode = 0x2713,
   kDiamondUnicode = 0x25C6,
   kBulletUnicode = 0x2022,
   kAppleLogoUnicode = 0xF8FF
};
Constants
kShiftUnicode

Available in OS X v10.1 and later.

Declared in Events.h.

kControlUnicode

Available in OS X v10.1 and later.

Declared in Events.h.

kOptionUnicode

Available in OS X v10.1 and later.

Declared in Events.h.

kCommandUnicode

Available in OS X v10.1 and later.

Declared in Events.h.

kPencilUnicode

Available in OS X v10.1 and later.

Declared in Events.h.

kCheckUnicode

Available in OS X v10.1 and later.

Declared in Events.h.

kDiamondUnicode

Available in OS X v10.1 and later.

Declared in Events.h.

kBulletUnicode

Available in OS X v10.1 and later.

Declared in Events.h.

kAppleLogoUnicode

Available in OS X v10.1 and later.

Declared in Events.h.

Event Mask Constants

Define constants you can use in the event mask.

enum {
   mDownMask = 1 << mouseDown,
   mUpMask = 1 << mouseUp,
   keyDownMask = 1 << keyDown,
   keyUpMask = 1 << keyUp,
   autoKeyMask = 1 << autoKey,
   updateMask = 1 << updateEvt,
   diskMask = 1 << diskEvt,
   activMask = 1 << activateEvt,
   highLevelEventMask = 0x0400,
   osMask = 1 << osEvt,
   everyEvent = 0xFFFF
};
typedef UInt16 EventMask;
Constants
mDownMask

The enumerator indicating you want your application to receive a mouse-down event.

Available in OS X v10.0 and later.

Declared in Events.h.

mUpMask

The enumerator indicating you want your application to receive a mouse-up event.

Available in OS X v10.0 and later.

Declared in Events.h.

keyDownMask

The enumerator indicating you want your application to receive a key-down event.

Available in OS X v10.0 and later.

Declared in Events.h.

keyUpMask

The enumerator indicating you want your application to receive a key-up event.

Available in OS X v10.0 and later.

Declared in Events.h.

autoKeyMask

The enumerator indicating you want your application to receive an auto-key event.

Available in OS X v10.0 and later.

Declared in Events.h.

updateMask

The enumerator indicating you want your application to receive an update event.

Available in OS X v10.0 and later.

Declared in Events.h.

diskMask

The enumerator indicating you want your application to receive a disk-inserted event.

Available in OS X v10.0 and later.

Declared in Events.h.

activMask

The enumerator indicating you want your application to receive an activate event.

Available in OS X v10.0 and later.

Declared in Events.h.

highLevelEventMask

The enumerator indicating you want your application to receive a high-level event.

Available in OS X v10.0 and later.

Declared in Events.h.

osMask

The enumerator indicating you want your application to receive an operating-system event

Available in OS X v10.0 and later.

Declared in Events.h.

everyEvent

The enumerator indicating you want your application to receive every event.

Available in OS X v10.0 and later.

Declared in Events.h.

mouseMovedMessage

enum {
   mouseMovedMessage = 0x00FA,
   suspendResumeMessage = 0x0001
};
Constants
mouseMovedMessage

The message code indicating the mouse-moved operating-system event.

Available in OS X v10.0 and later.

Declared in Events.h.

suspendResumeMessage

The message code indicating a suspend or resume operating-system event.

Available in OS X v10.0 and later.

Declared in Events.h.

msgWasPartiallyAccepted

enum {
   msgWasPartiallyAccepted = 2,
   msgWasFullyAccepted = 1,
   msgWasNotAccepted = 0
};
Constants
msgWasPartiallyAccepted

The posting enumerator value in the return receipt that indicates the message was partially accepted.

msgWasFullyAccepted

The posting enumerator value in the return receipt that indicates the message was fully accepted.

msgWasNotAccepted

The posting enumerator value in the return receipt that indicates the message was fully accepted.

networkEvt

enum {
   networkEvt = 10,
   driverEvt = 11,
   app1Evt = 12,
   app2Evt = 13,
   app3Evt = 14,
   app4Evt = 15,
   networkMask = 0x0400,
   driverMask = 0x0800,
   app1Mask = 0x1000,
   app2Mask = 0x2000,
   app3Mask = 0x4000,
   app4Mask = 0x8000
};
Constants
networkEvt

Available in OS X v10.0 and later.

Declared in Events.h.

driverEvt

Available in OS X v10.0 and later.

Declared in Events.h.

app1Evt

Available in OS X v10.0 and later.

Declared in Events.h.

app2Evt

Available in OS X v10.0 and later.

Declared in Events.h.

app3Evt

Available in OS X v10.0 and later.

Declared in Events.h.

app4Evt

Available in OS X v10.0 and later.

Declared in Events.h.

networkMask

Available in OS X v10.0 and later.

Declared in Events.h.

driverMask

Available in OS X v10.0 and later.

Declared in Events.h.

app1Mask

Available in OS X v10.0 and later.

Declared in Events.h.

app2Mask

Available in OS X v10.0 and later.

Declared in Events.h.

app3Mask

Available in OS X v10.0 and later.

Declared in Events.h.

app4Mask

Available in OS X v10.0 and later.

Declared in Events.h.

Event Kind Constants

Define event kinds.

enum {
   nullEvent = 0,
   mouseDown = 1,
   mouseUp = 2,
   keyDown = 3,
   keyUp = 4,
   autoKey = 5,
   updateEvt = 6,
   diskEvt = 7,
   activateEvt = 8,
   osEvt = 15,
   kHighLevelEvent = 23
};
typedef UInt16 EventKind;
Constants
nullEvent

The event code indicating that there are no other pending events.

Available in OS X v10.0 and later.

Declared in Events.h.

mouseDown

The event code indicating that the mouse button has been pressed.

Available in OS X v10.0 and later.

Declared in Events.h.

mouseUp

The event code indicating that the mouse button has been released.

Available in OS X v10.0 and later.

Declared in Events.h.

keyDown

The event code indicating that a key has been pressed.

Available in OS X v10.0 and later.

Declared in Events.h.

keyUp

The event code indicating that a key has been released.

Available in OS X v10.0 and later.

Declared in Events.h.

autoKey

The event code indicating that a key has been repeatedly held down.

Available in OS X v10.0 and later.

Declared in Events.h.

updateEvt

The event code indicating that a window needs updating.

Available in OS X v10.0 and later.

Declared in Events.h.

diskEvt

The event code indicating that a disk has been inserted.

Available in OS X v10.0 and later.

Declared in Events.h.

activateEvt

The event code indicating that a window has been activated or deactivated.

Available in OS X v10.0 and later.

Declared in Events.h.

osEvt

The event code indicating a suspend, resume, or mouse-moved operating-system event.

Available in OS X v10.0 and later.

Declared in Events.h.

kHighLevelEvent

A high-level event.

Available in OS X v10.0 and later.

Declared in Events.h.

resumeFlag

Indicates a resume event.

enum {
   resumeFlag = 1
};
Constants
resumeFlag

Flag for a resume event.

Available in OS X v10.0 and later.

Declared in Events.h.

Result Codes

Result codes defined for the Event Manager are listed below.

Result CodeValueDescription
evtNotEnb 1

Event not enabled for PostEvent.

Available in OS X v10.0 and later.