enum { kEventMouseButtonPrimary = 1, kEventMouseButtonSecondary = 2, kEventMouseButtonTertiary = 3 };
Name Description kEventMouseButtonPrimary Only button for a one-button mouse (usually left button for multi-button mouse) kEventMouseButtonSecondary Usually right button for a multi-button mouse kEventMouseButtonTertiary Usually middle button for a three-button mouse
enum { kEventMouseWheelAxisX = 0, kEventMouseWheelAxisY = 1 };
Name Description kEventMouseWheelAxisX The X axis (up or down) kEventMouseWheelAxisY The Y axis (left or right)
typedef SInt16 EventPriority; enum { kEventPriorityLow = 0, kEventPriorityStandard = 1, kEventPriorityHigh = 2 };
[English name: Event Flags and Options] These values define the relative priority of an event, and are used
when posting events with PostEventToQueue. In general events are
pulled from the queue in order of first posted to last posted. These
priorities are a way to alter that when posting events. You can post
a standard priority event and then a high priority event and the high
priority event will be pulled from the queue first.
Name Description kEventPriorityLow Lowest priority. Currently only window update events are posted at this priority. kEventPriorityStandard Normal priority of events. Most events are standard priority. kEventPriorityHigh Highest priority.
typedef UInt16 MouseTrackingResult; enum { kMouseTrackingMousePressed = 1, kMouseTrackingMouseReleased = 2, kMouseTrackingMouseExited = 3, kMouseTrackingMouseEntered = 4, kMouseTrackingMouseMoved = 5 };
[English name: Mouse Tracking Results]
These are returned from calls to TrackMouseLocation and TrackMouseRegion.
Those routines are designed as replacements to calls such as StillDown and
WaitMouseUp. The advantage over those routines is that TrackMouseLocation
and TrackMouseRegion will block if the user is not moving the mouse, whereas
mouse tracking loops based on StillDown and WaitMouseUp will spin, chewing
up valuable CPU time that could be better spent elsewhere. It is highly
recommended that any tracking loops in your application stop using StillDown
and WaitMouseUp and start using TrackMouseLocation/Region. See the notes on
those routines for more information.
Name Description kMouseTrackingMousePressed This is returned from TrackMouseLocation/Region when the user presses any mouse button. kMouseTrackingMouseReleased This is returned from TrackMouseLocation/Region when the user releases a mouse button. Typically this is what you would look for in a mouse tracking loop. kMouseTrackingMouseExited This is returned from TrackMouseRegion when the user moves the mouse out of the region you passed into that function. kMouseTrackingMouseEntered This is returned from TrackMouseRegion when the user moves the mouse into the region you passed into that function. kMouseTrackingMouseMoved This is returned from TrackMouseLocation when the user moves the mouse.
enum { eventAlreadyPostedErr = -9860, eventClassInvalidErr = -9862, eventClassIncorrectErr = -9864, eventHandlerAlreadyInstalledErr = -9866, eventInternalErr = -9868, eventKindIncorrectErr = -9869, eventParameterNotFoundErr = -9870, eventNotHandledErr = -9874, eventLoopTimedOutErr = -9875, eventLoopQuitErr = -9876, eventNotInQueueErr = -9877 };
[English name: Result Codes] The following are all errors which can be returned from the routines
contained in this file.
Name Description eventAlreadyPostedErr This is returned from PostEventToQueue if the event in question is already in the queue you are posting it to (or any other queue). eventClassInvalidErr This is obsolete and will be removed. eventClassIncorrectErr This is obsolete and will be removed. eventHandlerAlreadyInstalledErr Returned from InstallEventHandler if the handler proc you pass is already installed for a given event type you are trying to register. eventInternalErr A generic error. eventKindIncorrectErr This is obsolete and will be removed. eventParameterNotFoundErr The piece of data you are requesting from an event is not present. eventNotHandledErr This is what you should return from an event handler when your handler has received an event it doesn't currently want to (or isn't able to) handle. If you handle an event, you should return noErr from your event handler. eventLoopTimedOutErr The event loop has timed out. This can be returned from calls to ReceiveNextEvent or RunCurrentEventLoop. eventLoopQuitErr The event loop was quit, probably by a call to QuitEventLoop. This can be returned from ReceiveNextEvent or RunCurrentEventLoop. eventNotInQueueErr Returned from RemoveEventFromQueue when trying to remove an event that's not in any queue.
enum { kEventAppActivated = 1, /* resume, in old parlance*/ kEventAppDeactivated = 2, /* suspend, in old parlance*/ kEventAppQuit = 3, /* this app is quitting.*/ kEventAppLaunchNotification = 4 /* response to async application launch.*/ };
[English name: Application Events] This enumeration refers to application events.
Name Description kEventAppActivated The current app has been activated (resume event). kEventAppDeactivated The current app has just been deactivated (suspend event). kEventAppQuit Request to quit. kEventAppLaunchNotification An async launch request response.
enum { kEventClassMouse = FOUR_CHAR_CODE('mous'), kEventClassKeyboard = FOUR_CHAR_CODE('keyb'), kEventClassTextInput = FOUR_CHAR_CODE('text'), kEventClassApplication = FOUR_CHAR_CODE('appl'), kEventClassEPPC = FOUR_CHAR_CODE('eppc'), kEventClassMenu = FOUR_CHAR_CODE('menu'), kEventClassWindow = FOUR_CHAR_CODE('wind'), kEventClassControl = FOUR_CHAR_CODE('cntl'), kEventClassCommand = FOUR_CHAR_CODE('cmds'), kEventClassTablet = FOUR_CHAR_CODE('tblt') };
[English name: Event Classes]
Name Description kEventClassMouse Events related to the mouse (mouse down/up/moved). kEventClassKeyboard Events related to the keyboard. kEventClassTextInput Events related to text input (by keyboard, or by input method). kEventClassApplication Application-level events (launch, quit, etc.). kEventClassEPPC Apple Events (this may go away or be renamed). kEventClassMenu Menu-related events. kEventClassWindow Window-related events. kEventClassControl Control-related events. kEventClassCommand Command events (HICommands). kEventClassTablet Events related to tablets.
enum { kEventMenuBeginTracking = 1, kEventMenuEndTracking = 2, kEventMenuChangeTrackingMode = 3, kEventMenuOpening = 4, kEventMenuClosed = 5, kEventMenuTargetItem = 6, kEventMenuMatchKey = 7, kEventMenuEnableItems = 8 };
[English name: Menu Events]
Name Description kEventMenuBeginTracking The user has begun tracking the menubar or a pop-up menu. The direct object parameter is a valid MenuRef if tracking a pop-up menu, or NULL if tracking the menubar. The kEventParamCurrentMenuTrackingMode parameter indicates whether the user is tracking the menus using the mouse or the keyboard.
The handler may return userCanceledErr to stop menu tracking.kEventMenuEndTracking The user has finished tracking the menubar or a pop-up menu. kEventMenuChangeTrackingMode NOT YET IMPLEMENTED. kEventMenuOpening A menu is opening. This event is sent each time that the menu is opened (i.e., more than once during a given tracking session if the user opens the menu multiple times). It is sent before the menu is actually drawn, so you can update the menu contents (including making changes that will alter the menu size) and the new contents will be drawn correctly.
The kEventParamMenuFirstOpen parameter indicates whether this is the first time this menu has been opened during this menu tracking session.
The handler may return userCanceledErr to prevent this menu from opening (Carbon for Mac OS X only).kEventMenuClosed A menu has been closed. Sent after the menu is hidden. kEventMenuTargetItem The mouse is moving over a particular menu item. This event is sent for both enabled and disabled items. kEventMenuMatchKey A menu is about to be examined for items that match a command key event. A handler for this event may perform its own command key matching and override the Menu Manager's default matching algorithms. Returning noErr from your handler indicates that you have found a match. The handler for this event should not examine submenus of this menu for a match; a separate event will be sent for each submenu.
When called from IsMenuKeyEvent, the kEventParamEventRef parameter contains the EventRef that was passed to IsMenuKeyEvent, for your handler to examine; when called from MenuKey or MenuEvent, the EventRef parameter contains an event created from the information passed to MenuKey or MenuEvent. Note that in the MenuKey case, no virtual keycode (kEventParamKeyCode) or key modifiers (kEventParamKeyModifiers) will be available.
The kEventParamMenuEventOptions parameter contains a copy of the options that were passed to IsMenuKeyEvent, or 0 if called from MenuKey or MenuEvent. The only option that your handler will need to obey is kMenuEventIncludeDisabledItems.
If your handler finds a match, it should set the kEventParamMenuItemIndex parameter to contain the item index of the matching item, and return noErr. If it does not find a match, it should return menuItemNotFoundErr. Any other return value will cause the Menu Manager to use its default command key matching algorithm for this menu.
This event is sent after kEventMenuEnableItems.kEventMenuEnableItems A request that the items in the menu be properly enabled or disabled according to the current state of the application. This event is sent from inside MenuKey, MenuEvent, and IsMenuKeyEvent before those APIs examine the menu for an item that matches a keyboard event. It is also sent during menu tracking before a menu is first made visible; it is sent right after kEventMenuOpening, once per menu per menu tracking session.
If you install an event handler for kEventProcessCommand, you should also install a handler for kEventMenuEnableItems. This is necessary because the Carbon event system will attempt to match command keys against the available menus before returning the keyboard event to your application via WaitNextEvent. If you have menu command event handlers installed for your menu items, your handlers will be called without you ever receiving the keyboard event or calling MenuKey/MenuEvent/ IsMenuKeyEvent yourself. Therefore, you have no opportunity to enable your menu items properly other than from a kEventMenuEnableItems handler.
It is not necessary to handle this event if you do not install kEventProcessCommand handlers for your menu items; in that case, the command key event will be returned from WaitNextEvent or ReceiveNextEvent as normal, and you can set up your menus before calling MenuKey/MenuEvent/ IsMenuKeyEvent.
The kEventParamEnableMenuForKeyEvent parameter indicates whether this menu should be enabled for key event matching (true) or because the menu itself is about to become visible (false). If true, only the item enable state, command key, command key modifiers, and (optionally) the command key glyph need to be correct. If false, the entire menu item contents must be correct. This may be useful if you have custom menu content that is expensive to prepare.
enum { kEventMouseDown = 1, kEventMouseUp = 2, kEventMouseMoved = 5, kEventMouseDragged = 6, kEventMouseWheelMoved = 10 };
[English name: Mouse Events]
Name Description kEventMouseDown A mouse button was pressed. kEventMouseUp A mouse button was released. kEventMouseMoved The mouse was moved. kEventMouseDragged The mouse was moved, and a button was down. kEventMouseWheelMoved The mouse wheel was moved.
enum { kEventProcessCommand = 1, kEventCommandProcess = 1, kEventCommandUpdateStatus = 2 };
[English name: Command Events]
Name Description kEventCommandProcess A command has been invoked and the application should handle it. This event is sent when the user chooses a menu item or a control with a command is pressed. kEventCommandUpdateStatus The status of a command is in question. When you receive this event, you should update the necessary UI elements in your application to reflect the current status of the command. For example, if the command has the kHICommandFromMenu bit set), you should update the menu item state, text, etc. to reflect the current reality in your application.
enum { kEventRawKeyDown = 1, /* hardware-level events*/ kEventRawKeyRepeat = 2, kEventRawKeyUp = 3, kEventRawKeyModifiersChanged = 4 };
[English name: Raw Keyboard Events] These events are the lowest-level keyboard events.
Name Description kEventRawKeyDown A key was pressed. kEventRawKeyRepeat Sent periodically as a key is held down by the user. kEventRawKeyUp A key was released. kEventRawKeyModifiersChanged The keyboard modifiers (bucky bits) have changed.
enum { kEventUpdateActiveInputArea = 1, kEventUnicodeForKeyEvent = 2, kEventOffsetToPos = 3, kEventPosToOffset = 4, kEventShowHideBottomWindow = 5, kEventGetSelectedText = 6 };
[English name: Text Input Events]
The following TextInput events reimplement the AppleEvents defined
in Inside Mac Text - Text Services Manager, and provide the benefits
of Carbon Event targeting, dispatching and propagation to applications
that have formerly handled the TSM suite of AppleEvents.
TextInput handlers may be installed on controls, windows, or the
application event target (equivalent to AppleEvent-based handling).
In all cases, if a given TextInput handler is not installed, TSM will
convert that TextInput to an AppleEvent and redispatch via AESend to
the current process, making adoption as gradual as is desired.
Name Description kEventUpdateActiveInputArea Tells the application/text engine to initiate/terminate or manage the content of inline input session. kEventUnicodeForKeyEvent Unicode text resulting from a key event originated by TSM (not by an input method). A client need not be fully TSM-aware to process or receive this event, which has become the standard way of getting Unicode text from key events. You can also get Mac encoding characters from the raw keyboard event contained in this event. If no UnicodeForKeyEvent handler is installed, and no kUnicodeNotFromInputMethod AppleEvent handler is installed (or the application has not created a Unicode TSMDocument), the Mac encoding charCodes (if these can be converted from the Unicodes) are provided to WaitNextEvent. kEventOffsetToPos Convert from inline session text offset to global QD Point. This event is typically be produced by an Input Method so that it can best position a palette "near" the text being operated on by the user. kEventPosToOffset Convert from global QD point to inline session text offset. This event is typically produced by an input method to perform proper cursor management as the cursor moves over various subranges, or clauses of text (or the boundaries between these) in the inline input session. kEventShowHideBottomWindow Show/Hide the bottom line input window. This event is produced by Input Methods to control the Text Services Manager bottom-line input window, and is not normally handled by an application. kEventGetSelectedText Get the text selected (or character before/after insertion point based on leadingEdge parameter) from the application's text engine.
© 2000 Apple Computer, Inc. (Last Updated 7/7/2000)