Retired Document
Important: The Event Manager is a legacy System 7 technology. You should use the Mac OS X Carbon Event Manager instead. See Carbon Event Manager Programming Guide.
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
-
LMGetKeyRepThresh -
LMGetKeyThresh -
LMSetKeyRepThresh -
LMSetKeyThresh -
LMGetKbdType -
LMGetKbdLast -
LMSetKbdLast -
LMSetKbdType
Getting Timing Information
Making Keyboard Settings
-
KeyScriptDeprecated in OS X v10.5
Reading the Keyboard
-
GetKeys -
GetCurrentKeyModifiers -
IsCmdCharDeprecated in OS X v10.6 -
KeyTranslateDeprecated in OS X v10.6
Receiving Events
-
SetEventMask -
EventAvailDeprecated in OS X v10.6 -
FlushEventsDeprecated in OS X v10.6 -
GetNextEventDeprecated in OS X v10.6 -
WaitNextEventDeprecated in OS X v10.6
Sending Events
-
PostEventDeprecated in OS X v10.6
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.hGetCaretTime
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.hGetCurrentKeyModifiers
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.
Declared In
CarbonEventsCore.hGetDblTime
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.hGetGlobalMouse
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.hGetKeys
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.hLMGetKbdLast
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.hLMGetKbdType
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.
Declared In
Events.hLMGetKeyRepThresh
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.hLMGetKeyThresh
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.hLMSetKbdLast
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.hLMSetKbdType
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.hLMSetKeyRepThresh
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.hLMSetKeyThresh
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.hSetEventMask
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.hData 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
whatThe kind of event received. The Event Manager specifies the kind of event with one of the values defined by the
EventKindenumeration.messageAdditional information associated with the event. The interpretation of this information depends on the event type. The contents of the
messagefield 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
charCodeMaskandkeyCodeMask, 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
suspendResumeMessageenumerator in bits 24–31 and a 1 (theresumeFlagenumerator) in bit 0 indicate the event is a resume event. Bit 1 contains a 1 (theconvertClipBoardFlagenumerator) if Clipboard conversion is required, and bits 2–23 are reserved.For a suspend event, the event message is:The
suspendResumeMessageenumerator 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
mouseMovedMessageenumerator 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
messageandwherefields of a high-level event define the specific type of high-level event received.
whenThe
whenfield indicates the time when the event was posted (in ticks since system startup).whereFor low-level events and operating-system events, the
wherefield contains the location of the cursor at the time the event was posted (in global coordinates).For high-level events, the
wherefield contains a second event specifier, the event ID. The event ID defines the particular type of event within the class of events defined by themessagefield of the high-level event. For high-level events, you should interpret thewherefield as having the data typeOSType, notPoint.modifiersThe
modifiersfield 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
modifiersfield 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 themodifiersfield 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.hEvQEl
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
qLinkNext queue entry.
qTypeQueue type (
evType).evtQWhatEvent code.
evtQMessageEvent message.
evtQWhenTicks since startup.
evtQWhereMouse location.
evtQModifiersModifier 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.hKeyMap
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.hKeyMapByteArray
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.hConstants
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
activeFlagBitAvailable in OS X v10.0 and later.
Declared in
Events.h.btnStateBitAvailable in OS X v10.0 and later.
Declared in
Events.h.cmdKeyBitAvailable in OS X v10.0 and later.
Declared in
Events.h.shiftKeyBitAvailable in OS X v10.0 and later.
Declared in
Events.h.alphaLockBitAvailable in OS X v10.0 and later.
Declared in
Events.h.optionKeyBitAvailable in OS X v10.0 and later.
Declared in
Events.h.controlKeyBitAvailable in OS X v10.0 and later.
Declared in
Events.h.rightShiftKeyBitAvailable in OS X v10.0 and later.
Declared in
Events.h.rightOptionKeyBitAvailable in OS X v10.0 and later.
Declared in
Events.h.rightControlKeyBitAvailable in OS X v10.0 and later.
Declared in
Events.h.
charCodeMask
enum {
charCodeMask = 0x000000FF,
keyCodeMask = 0x0000FF00,
adbAddrMask = 0x00FF0000,
osEvtMessageMask = 0xFF000000
};
Constants
charCodeMaskThe 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.keyCodeMaskThe 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.adbAddrMaskThe 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.osEvtMessageMaskThe 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
activeFlagThe 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.btnStateThe enumerator indicating that the mouse button has been released.
Available in OS X v10.0 and later.
Declared in
Events.h.cmdKeyThe enumerator indicating that the Command key is being pressed.
Available in OS X v10.0 and later.
Declared in
Events.h.shiftKeyThe enumerator indicating that the Shift key is being pressed.
Available in OS X v10.0 and later.
Declared in
Events.h.alphaLockThe enumerator indicating that the Caps Lock key is being pressed.
Available in OS X v10.0 and later.
Declared in
Events.h.optionKeyThe enumerator indicating that the Option key is being pressed.
Available in OS X v10.0 and later.
Declared in
Events.h.controlKeyThe enumerator indicating that the Control key is being pressed.
Available in OS X v10.0 and later.
Declared in
Events.h.rightShiftKeyAvailable in OS X v10.0 and later.
Declared in
Events.h.rightOptionKeyAvailable in OS X v10.0 and later.
Declared in
Events.h.rightControlKeyAvailable in OS X v10.0 and later.
Declared in
Events.h.
HighLevelEventMsgClass
enum {
HighLevelEventMsgClass = 'jaym',
rtrnReceiptMsgID = 'rtrn'
};
Constants
HighLevelEventMsgClassThe enumerator indicating a high-level event message class for return receipt.
rtrnReceiptMsgIDThe 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
kNullCharCodeAvailable in OS X v10.0 and later.
Declared in
Events.h.kHomeCharCodeAvailable in OS X v10.0 and later.
Declared in
Events.h.kEnterCharCodeAvailable in OS X v10.0 and later.
Declared in
Events.h.kEndCharCodeAvailable in OS X v10.0 and later.
Declared in
Events.h.kHelpCharCodeAvailable in OS X v10.0 and later.
Declared in
Events.h.kBellCharCodeAvailable in OS X v10.0 and later.
Declared in
Events.h.kBackspaceCharCodeAvailable in OS X v10.0 and later.
Declared in
Events.h.kTabCharCodeAvailable in OS X v10.0 and later.
Declared in
Events.h.kLineFeedCharCodeAvailable in OS X v10.0 and later.
Declared in
Events.h.kVerticalTabCharCodeAvailable in OS X v10.0 and later.
Declared in
Events.h.kPageUpCharCodeAvailable in OS X v10.0 and later.
Declared in
Events.h.kFormFeedCharCodeAvailable in OS X v10.0 and later.
Declared in
Events.h.kPageDownCharCodeAvailable in OS X v10.0 and later.
Declared in
Events.h.kReturnCharCodeAvailable in OS X v10.0 and later.
Declared in
Events.h.kFunctionKeyCharCodeAvailable in OS X v10.0 and later.
Declared in
Events.h.kCommandCharCodeAvailable in OS X v10.1 and later.
Declared in
Events.h.kCheckCharCodeAvailable in OS X v10.1 and later.
Declared in
Events.h.kDiamondCharCodeAvailable in OS X v10.1 and later.
Declared in
Events.h.kAppleLogoCharCodeAvailable in OS X v10.1 and later.
Declared in
Events.h.kEscapeCharCodeAvailable in OS X v10.0 and later.
Declared in
Events.h.kClearCharCodeAvailable in OS X v10.0 and later.
Declared in
Events.h.kLeftArrowCharCodeAvailable in OS X v10.0 and later.
Declared in
Events.h.kRightArrowCharCodeAvailable in OS X v10.0 and later.
Declared in
Events.h.kUpArrowCharCodeAvailable in OS X v10.0 and later.
Declared in
Events.h.kDownArrowCharCodeAvailable in OS X v10.0 and later.
Declared in
Events.h.kSpaceCharCodeAvailable in OS X v10.1 and later.
Declared in
Events.h.kDeleteCharCodeAvailable in OS X v10.0 and later.
Declared in
Events.h.kBulletCharCodeAvailable in OS X v10.1 and later.
Declared in
Events.h.kNonBreakingSpaceCharCodeAvailable 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
kShiftUnicodeAvailable in OS X v10.1 and later.
Declared in
Events.h.kControlUnicodeAvailable in OS X v10.1 and later.
Declared in
Events.h.kOptionUnicodeAvailable in OS X v10.1 and later.
Declared in
Events.h.kCommandUnicodeAvailable in OS X v10.1 and later.
Declared in
Events.h.kPencilUnicodeAvailable in OS X v10.1 and later.
Declared in
Events.h.kCheckUnicodeAvailable in OS X v10.1 and later.
Declared in
Events.h.kDiamondUnicodeAvailable in OS X v10.1 and later.
Declared in
Events.h.kBulletUnicodeAvailable in OS X v10.1 and later.
Declared in
Events.h.kAppleLogoUnicodeAvailable 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
mDownMaskThe enumerator indicating you want your application to receive a mouse-down event.
Available in OS X v10.0 and later.
Declared in
Events.h.mUpMaskThe enumerator indicating you want your application to receive a mouse-up event.
Available in OS X v10.0 and later.
Declared in
Events.h.keyDownMaskThe enumerator indicating you want your application to receive a key-down event.
Available in OS X v10.0 and later.
Declared in
Events.h.keyUpMaskThe enumerator indicating you want your application to receive a key-up event.
Available in OS X v10.0 and later.
Declared in
Events.h.autoKeyMaskThe enumerator indicating you want your application to receive an auto-key event.
Available in OS X v10.0 and later.
Declared in
Events.h.updateMaskThe enumerator indicating you want your application to receive an update event.
Available in OS X v10.0 and later.
Declared in
Events.h.diskMaskThe enumerator indicating you want your application to receive a disk-inserted event.
Available in OS X v10.0 and later.
Declared in
Events.h.activMaskThe enumerator indicating you want your application to receive an activate event.
Available in OS X v10.0 and later.
Declared in
Events.h.highLevelEventMaskThe enumerator indicating you want your application to receive a high-level event.
Available in OS X v10.0 and later.
Declared in
Events.h.osMaskThe enumerator indicating you want your application to receive an operating-system event
Available in OS X v10.0 and later.
Declared in
Events.h.everyEventThe 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
mouseMovedMessageThe message code indicating the mouse-moved operating-system event.
Available in OS X v10.0 and later.
Declared in
Events.h.suspendResumeMessageThe 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
msgWasPartiallyAcceptedThe posting enumerator value in the return receipt that indicates the message was partially accepted.
msgWasFullyAcceptedThe posting enumerator value in the return receipt that indicates the message was fully accepted.
msgWasNotAcceptedThe 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
networkEvtAvailable in OS X v10.0 and later.
Declared in
Events.h.driverEvtAvailable in OS X v10.0 and later.
Declared in
Events.h.app1EvtAvailable in OS X v10.0 and later.
Declared in
Events.h.app2EvtAvailable in OS X v10.0 and later.
Declared in
Events.h.app3EvtAvailable in OS X v10.0 and later.
Declared in
Events.h.app4EvtAvailable in OS X v10.0 and later.
Declared in
Events.h.networkMaskAvailable in OS X v10.0 and later.
Declared in
Events.h.driverMaskAvailable in OS X v10.0 and later.
Declared in
Events.h.app1MaskAvailable in OS X v10.0 and later.
Declared in
Events.h.app2MaskAvailable in OS X v10.0 and later.
Declared in
Events.h.app3MaskAvailable in OS X v10.0 and later.
Declared in
Events.h.app4MaskAvailable 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
nullEventThe event code indicating that there are no other pending events.
Available in OS X v10.0 and later.
Declared in
Events.h.mouseDownThe event code indicating that the mouse button has been pressed.
Available in OS X v10.0 and later.
Declared in
Events.h.mouseUpThe event code indicating that the mouse button has been released.
Available in OS X v10.0 and later.
Declared in
Events.h.keyDownThe event code indicating that a key has been pressed.
Available in OS X v10.0 and later.
Declared in
Events.h.keyUpThe event code indicating that a key has been released.
Available in OS X v10.0 and later.
Declared in
Events.h.autoKeyThe event code indicating that a key has been repeatedly held down.
Available in OS X v10.0 and later.
Declared in
Events.h.updateEvtThe event code indicating that a window needs updating.
Available in OS X v10.0 and later.
Declared in
Events.h.diskEvtThe event code indicating that a disk has been inserted.
Available in OS X v10.0 and later.
Declared in
Events.h.activateEvtThe event code indicating that a window has been activated or deactivated.
Available in OS X v10.0 and later.
Declared in
Events.h.osEvtThe event code indicating a suspend, resume, or mouse-moved operating-system event.
Available in OS X v10.0 and later.
Declared in
Events.h.kHighLevelEventA high-level event.
Available in OS X v10.0 and later.
Declared in
Events.h.
resumeFlag
Indicates a resume event.
enum {
resumeFlag = 1
};
Constants
resumeFlagFlag 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.
© 2003, 2007 Apple Inc. All Rights Reserved. (Last updated: 2007-10-31)