| Framework | Carbon/Carbon.h |
| Declared in | AEDataModel.h CarbonEvents.h CarbonEventsCore.h HIToolbar.h cssmspi.h |
The Carbon Event Manager is the preferred API for handling events in Carbon applications. You can use this interface to handle events generated in response to user input as well as to create your own custom events. Because event handling is so fundamental to all applications, this document is relevant for everyone writing Carbon applications. To use this document, you should be familiar with Macintosh terminology and understand the basics of creating and manipulating the Mac OS user interface (windows, controls, menus, and so on).
For more information about HIObjects and the HIView subclass, see HIView Programming Guide.
InstallEventHandler
InstallStandardEventHandler
RemoveEventHandler
AddEventTypesToHandler
RemoveEventTypesFromHandler
CallNextEventHandler
RegisterEventHotKey
UnregisterEventHotKey
RegisterToolboxObjectClass Deprecated in Mac OS X v10.4
UnregisterToolboxObjectClass Deprecated in Mac OS X v10.4
GetEventClass
GetEventKind
GetEventParameter
SetEventParameter
CreateEvent
CopyEvent
CopyEventAs
RetainEvent
ReleaseEvent
GetEventRetainCount
ConvertEventRefToEventRecord
IsEventInMask
GetEventMonitorTarget
SendEventToEventTarget
SendEventToEventTargetWithOptions
GetControlEventTarget
GetWindowEventTarget
GetMenuEventTarget
GetApplicationEventTarget
GetEventDispatcherTarget
GetUserFocusEventTarget
ProcessHICommand
GetCurrentEventQueue
GetMainEventQueue
PostEventToQueue
RemoveEventFromQueue
IsEventInQueue
AcquireFirstMatchingEventInQueue
FlushEventsMatchingListFromQueue
FindSpecificEventInQueue
FlushSpecificEventsFromQueue
FlushEventQueue
GetNumEventsInQueue
RunApplicationEventLoop
QuitApplicationEventLoop
GetMainEventLoop
GetCurrentEventLoop
GetCFRunLoopFromEventLoop
RunCurrentEventLoop
QuitEventLoop
ReceiveNextEvent
RunAppModalLoopForWindow
QuitAppModalLoopForWindow
BeginAppModalStateForWindow
EndAppModalStateForWindow
TrackMouseLocation
TrackMouseLocationWithOptions
TrackMouseRegion
HIMouseTrackingGetParameters
ChangeMouseTrackingRegion Deprecated in Mac OS X v10.4
ClipMouseTrackingRegion Deprecated in Mac OS X v10.4
ClipWindowMouseTrackingRegions Deprecated in Mac OS X v10.4
CreateMouseTrackingRegion Deprecated in Mac OS X v10.4
GetMouseTrackingRegionID Deprecated in Mac OS X v10.4
GetMouseTrackingRegionRefCon Deprecated in Mac OS X v10.4
MoveMouseTrackingRegion Deprecated in Mac OS X v10.4
MoveWindowMouseTrackingRegions Deprecated in Mac OS X v10.4
ReleaseMouseTrackingRegion Deprecated in Mac OS X v10.4
ReleaseWindowMouseTrackingRegions Deprecated in Mac OS X v10.4
RetainMouseTrackingRegion Deprecated in Mac OS X v10.4
SetMouseTrackingRegionEnabled Deprecated in Mac OS X v10.4
SetWindowMouseTrackingRegionsEnabled Deprecated in Mac OS X v10.4
NewEventComparatorUPP
InvokeEventComparatorUPP
DisposeEventComparatorUPP
NewEventHandlerUPP
DisposeEventHandlerUPP
InvokeEventHandlerUPP
NewEventLoopTimerUPP
InvokeEventLoopTimerUPP
DisposeEventLoopTimerUPP
NewEventLoopIdleTimerUPP
InvokeEventLoopIdleTimerUPP
DisposeEventLoopIdleTimerUPP
CopyServicesMenuCommandKeys
CreateTypeStringWithOSType
GetCurrentEventKeyModifiers
IsMouseCoalescingEnabled
SetMouseCoalescingEnabled
IsUserCancelEventRef
Obtains the first event that matches the specified list of event classes and kinds.
EventRef AcquireFirstMatchingEventInQueue ( EventQueueRef inQueue, ItemCount inNumTypes, const EventTypeSpec *inList, OptionBits inOptions );
The queue to check.
The number of event kinds for which to search. You may pass 0 if you also pass NULL for inList.
The list of event classes and kinds to search for in the queue. You may pass NULL if inNumTypes is 0. Doing so effectively matches any event in the queue and causes this function to return the first event in the queue.
Must be kEventQueueOptionsNone.
An event reference, or NULL if no events match. The reference count for the event has been incremented (that is, it has been retained), so you must release the event reference.
This function does not remove the event from the queue. To remove the event, call RemoveEventFromQueue.
This function does not call the run loop, so no timers fire as a result of calling this function. This function does not cause any window flushing to occur, but it does get new events from the window server.
This function should have better performance characteristics than the older EventAvail API.
CarbonEventsCore.h
Adds events to an installed handler.
OSStatus AddEventTypesToHandler ( EventHandlerRef inHandlerRef, ItemCount inNumTypes, const EventTypeSpec *inList );
The event handler to add events to.
The number of events to add.
A pointer to an array of EventTypeSpec structures.
A result code. See “Carbon Event Manager Result Codes.”
You can use this function to dynamically change which events you want your handler to respond to.
CarbonEventsCore.h
Puts the window in an application-modal state, but does not process events.
OSStatus BeginAppModalStateForWindow ( WindowRef inWindow );
The window you wish to behave modally. See the Window Manager documentation for a description of the WindowRef data type.
A result code. See “Carbon Event Manager Result Codes.”
This function is a lower level function than RunAppModalLoopForWindow. You use it if you want to enter an application modal state for a window but need to control the event loop yourself. Once you begin your application modal state, the menu bar will disable and prepare for the modal situation. You can then call low-level functions (such as ReceiveNextEvent) to run the event loop and process events.
CarbonEvents.h
Calls the next handler in the handler chain.
OSStatus CallNextEventHandler ( EventHandlerCallRef inCallRef, EventRef inEvent );
The event handler call reference passed into your event handler.
The event you want to pass to the next handler.
A result code. See “Carbon Event Manager Result Codes.”
Calls through to the event handlers below you in the event handler stack of the target to which your handler is bound. You might use this to call through to the default toolbox handling in order to post-process the event. You can only call this routine from within an event handler.
CarbonEventsCore.h
Converts an event reference into an event record.
Boolean ConvertEventRefToEventRecord ( EventRef inEvent, EventRecord *outEvent );
The event reference to convert.
The event record to fill out. See the Event Manager documentation for a description of the EventRecord data type.
A Boolean value indicating whether the conversion was successful (true) or not (false).
This function helps you when you need an EventRecord structure and all you have is a Carbon event reference. If the event can be converted, outEvent is filled in and the function returns true. If not, the function returns false and outEvent contains nullEvent.
This function can convert the following events:
kEventMouseDown, kEventMouseUp, kEventMouseMoved, and kEventMouseDragged (kEventClassMouse)
kEventRawKeyDown, kEventRawKeyUp, and kEventRawKeyRepeat (kEventClassKeyboard)
kEventWindowUpdate, kEventWindowActivate, kEventWindowDeactivate, and kEventWindowCursorChange (kEventClassWindow)
kEventAppActivated and kEventAppDeactivate (kEventClassApplication)
kEventAppleEvent (kEventClassAppleEvents)
kEventControlTrack (kEventClassControl) is converted to a mouse down event in Mac OS X v10.4 and later
CarbonEvents.h
Copies an event.
EventRef CopyEvent ( EventRef inOther );
The event to copy.
A new event reference for the specified event.
The CopyEvent function makes an exact duplicate of an existing event reference. The reference count for the duplicate event reference is set to 1.
CarbonEventsCore.hCopies an existing event, allowing you to change the class and kind of the event.
EventRef CopyEventAs ( CFAllocatorRef inAllocator, EventRef inOther, OSType inEventClass, UInt32 inEventKind );
The allocator to use to allocate the event data. Pass NULL or kCFAllocatorDefault to use the standard allocator.
The event to copy.
The new event class for the copy of the event.
The new event kind for the copy of the event.
A new event reference or NULL if the inOther was NULL or memory for the new event could not be allocated.
The CopyEventAs is useful during event flow and transformation. For example, this function is used when upgrading a raw mouse down to a window click event, to ensure that the window click event has exactly the same parameters as the original mouse down event.
CarbonEventsCore.h
Obtains information about command key shortcuts in an application’s Services menu.
OSStatus CopyServicesMenuCommandKeys ( CFArrayRef *outCommandKeyArray );
On return, an array of items in the Services menu that have command key shortcuts associated with them.
A result code. See “Carbon Event Manager Result Codes.”
Each array entry is a reference to a CFDictionary, and each dictionary contains information about a single command key shortcut for items in the application’s Services menu. Each dictionary contains the following keys: kHIServicesMenuProviderName, kHIServicesMenuItemName, kHIServicesMenuCharCode, and kHIServicesMenuKeyModifiers. The array must be released by the caller. The dictionaries do not need to be released because they are released automatically when the array is released.
CarbonEvents.h
Obtains information about symbolic hot keys in the Keyboard preferences pane.
OSStatus CopySymbolicHotKeys ( CFArrayRef *outHotKeyArray );
An array of dictionaries containing information about the systemwide symbolic hot keys defined in the Keyboard preferences pane, such as the Screen Capture, Universal Access, and Keyboard Navigation keys. The array does not include information about custom, application-specific command keys. You must release the array when you no longer need it. The dictionaries are automatically released when you release the array.
A result code. See “Carbon Event Manager Result Codes.”
Each array entry is a reference for a CFDictionary, and each dictionary contains information about a single hot key. There is currently no way to determine which hot key in the Keyboards preference pane corresponds to a specific dictionary. Each dictionary contains the following keys: kHISymbolicHotKeyCode, kHISymbolicHotKeyModifiers, and kHISymbolicHotKeyEnabled. For details, see “Symbolic Hot Key Definitions.”
The number of hot keys will increase in the future, so do not call this function unnecessarily or in highly performance-sensitive code.
CarbonEvents.h
Creates an event.
OSStatus CreateEvent ( CFAllocatorRef inAllocator, UInt32 inClassID, UInt32 kind, EventTime when, EventAttributes flags, EventRef * outEvent );
A reference to the desired memory allocator to use to allocate memory for the event. Pass NULL to use the default allocator. See the Base Services documentation for a description of the CFAllocatorRef data type.
The event class of the event to create.
The event kind of the event to create.
The time the event occurred. Pass 0 to specify the current event time (as returned by the GetCurrentEventTime function).
The event attributes to set. Currently you can pass kEventAttributeNone or kEventAttributeUserEvent.
On return, a reference to the newly created event.
A result code. See “Carbon Event Manager Result Codes.”
You can use this function to create your own custom events or to simulate existing events. If you are creating custom events, you must make sure that the event signature (the combination of event class and event kind) does not conflict with any existing events.
CarbonEventsCore.h
Converts an OSType string to a Core Foundation string.
CFStringRef CreateTypeStringWithOSType ( OSType inType );
The Core Foundation string version of the OSType string. A return value of NULL indicates that an error occurred. See the Base Services documentation for a description of the CFStringRef data type.
You can use this function to create CFString versions of OSType data types to pass to the Services Manager. As this is a creation function, you must call CFRelease on your Core Foundation string when you no longer need it.
CarbonEvents.h
Disables secure event input mode.
OSStatus DisableSecureEventInput ( void );
A result code. See “Carbon Event Manager Result Codes.”
When secure event input mode is enabled, keyboard input goes only to the application with keyboard focus and is not echoed to other applications that might be using the event monitor target to watch keyboard input. The EditText and EditUnicodeText controls automatically enter secure input mode when a password control has focus. If your application implements its own password entry, you should enable secure event input while the user enters text.
This function maintains a count of the number of times that it has been called. Secure event input is not disabled until DisableSecureEventInput has been called the same number of times. Be sure to disable secure event input if your application becomes inactive. If your application crashes, secure event input is automatically disabled if no other application has enabled it.
CarbonEventsCore.h
Disposes of an event comparator UPP.
void DisposeEventComparatorUPP ( EventComparatorUPP userUPP );
The UPP you want to destroy.
CarbonEventsCore.h
Disposes of an event handler UPP.
void DisposeEventHandlerUPP ( EventHandlerUPP userUPP );
The event handler UPP you want to destroy.
CarbonEventsCore.hDisposes of an event loop idle timer.
void DisposeEventLoopIdleTimerUPP ( EventLoopIdleTimerUPP userUPP );
CarbonEventsCore.h
Disposes of an event loop timer.
void DisposeEventLoopTimerUPP ( EventLoopTimerUPP userUPP );
CarbonEventsCore.h
Enables secure event input mode.
OSStatus EnableSecureEventInput ( void );
A result code. See “Carbon Event Manager Result Codes.”
When secure event input mode is enabled, keyboard input goes only to the application with keyboard focus and is not echoed to other applications that might be using the event monitor target to watch keyboard input. The EditText and EditUnicodeText controls automatically enter secure input mode when a password control has focus. If your application implements its own password entry, you should enable secure event input while the user enters text.
This function maintains a count of the number of times that it has been called. Secure event input is not disabled until DisableSecureEventInput has been called the same number of times. Be sure to disable secure event input if your application becomes inactive. If your application crashes, secure event input is automatically disabled if no other application has enabled it.
CarbonEventsCore.h
Ends the application-modal state entered using the function BeginAppModalStateForWindow.
OSStatus EndAppModalStateForWindow ( WindowRef inWindow );
The window you wish to stop acting as application- modal. See the Window Manager documentation for a description of the WindowRef data type.
A result code. See “Carbon Event Manager Result Codes.”
This routine ends an app modal state started with BeginAppModalStateForWindow.
CarbonEvents.h
Finds a specific event in the event queue.
EventRef FindSpecificEventInQueue ( EventQueueRef inQueue, EventComparatorUPP inComparator, void *inCompareData );
The event queue to search.
The comparison function to invoke for each event in the queue. See EventComparatorProcPtr for the required format of your comparison function A return value of true from the comparator indicates a match.
The data you wish to pass to your comparison function.
An event reference.
Returns the first event that matches a comparator function, or NULL if no events match.
CarbonEventsCore.h
Removes all events from the event queue.
OSStatus FlushEventQueue ( EventQueueRef inQueue );
The event queue to flush.
A result code. See “Carbon Event Manager Result Codes.”
Flushes all events from an event queue.
CarbonEventsCore.h
Removes events from the event queue by kind and class.
OSStatus FlushEventsMatchingListFromQueue ( EventQueueRef inQueue, ItemCount inNumTypes, const EventTypeSpec *inList );
The event queue to flush events from.
The number of event kinds to flush.
The list of event classes and kinds to flush from the queue.
A result code. See “Carbon Event Manager Result Codes.”
CarbonEventsCore.h
Removes specified events from the event queue.
OSStatus FlushSpecificEventsFromQueue ( EventQueueRef inQueue, EventComparatorUPP inComparator, void *inCompareData );
The event queue to flush events from.
The comparison function to invoke for each event in the queue. See EventComparatorProcPtr for the required format of your comparison function. A return value of true from the comparator indicates that the event should be flushed.
The data you wish to pass to your comparison function.
A result code. See “Carbon Event Manager Result Codes.”
CarbonEventsCore.h
Obtains the event target reference for the application.
EventTargetRef GetApplicationEventTarget ( void );
An event target reference.
Once you obtain this reference, you can send events to the target and install event handlers on it.
CarbonEvents.h
Obtains a Core Foundation CFRunLoop from an Carbon event loop reference.
CFTypeRef GetCFRunLoopFromEventLoop ( EventLoopRef inEventLoop );
The event loop reference to translate.
A reference to the CFRunLoop.
There isn’t necessarily a one-to-one correspondence between Carbon event loops and Core Foundation event loops, so you should use this function instead of simply calling the Core Foundation function CFRunLoopGetCurrent.
CarbonEventsCore.h
Obtains the event target reference for the specified control.
EventTargetRef GetControlEventTarget ( ControlRef inControl );
The control to return the target for. See the Control Manager documentation for a description of the ControlRef data type.
An event target reference.
Once you obtain this reference, you can send events to the target and install event handlers on it.
CarbonEvents.hObtains the queue-synchronized keyboard modifier state.
UInt32 GetCurrentEventKeyModifiers ( void );
A bit field indicating the queue-synchronized keyboard modifier state. This field is the same as the modifiers field returned in an Event Manager EventRecord structure, but it includes only the keyboard modifier flags.
The queue-synchronized keyboard modifier state indicates the modifier state according to the event most recently dispatched through an event target. This state may be different from the hardware state obtained using GetCurrentKeyModifiers. For example, say the user invokes a Control-click with the mouse. If the user releases or changes a modifier key before the mouse down event is dispatched, the hardware state reflects the new modifier state, not the one that generated the original mouse event.
The most recently dispatched event may not necessarily be the event that your event handler is handling. For example, if a mouse-down event occurs, and you have a handler for the kEventWindowHandleContentClick event that is generated from the mouse-down, then the keyboard modifiers will be those that were attached to the mouse-down. The content-click event itself has a kEventParamKeyModifiers parameter, which is copied from the mouse-down event, but GetCurrentEventKeyModifiers returns the modifiers from the mouse-down, not from the content-click event, because it was the mouse-down event that was most recently dispatched through the event dispatcher.
Events that are not sent through the event dispatcher target will not update the current event key modifiers. Also, events arriving from outside the application, such as an AppleEvent or an Accessibility event, also will not update the modifiers. If your application modifies its behavior based on modifier state, you should parameterize your core code with the event modifiers, and determine the modifiers based on the origin of the behavior request. For a request that originates directly from user input, you can use GetCurrentEventKeyModifiers, but for a request that originates from an AppleEvent or Accessibility event, you would probably use no modifiers. GetCurrentEventKeyModifiers gives a more consistent user experience when the user input queue is being remote controlled or manipulated via non-hardware event sources such as speech or AppleEvents; using GetCurrentEventKeyModifiers is also much faster than using EventAvail(0, &eventRecord) or GetCurrentKeyModifiers.
GetCurrentEventKeyModifiers returns a valid modifier state only if your application is the active application. If your application is not active, then user input events are not flowing through the event dispatcher and the queue-synchronized state is not updated.
CarbonEventsCore.h
Obtains a reference to the current event loop.
EventLoopRef GetCurrentEventLoop ( void );
An event loop reference.
This function returns the event loop for the current thread. If the current thread is a cooperative thread, the main event loop is returned.
CarbonEventsCore.h
Obtains the current event queue.
EventQueueRef GetCurrentEventQueue ( void );
An event queue reference.
This function obtains the event queue for the current thread. If the current thread is a cooperative thread, the main event queue is returned.
CarbonEventsCore.h
Returns the current time since last system startup, in seconds.
EventTime GetCurrentEventTime ( void );
EventTime.
Returns the current time since last system startup in seconds.
CarbonEventsCore.h
Returns the class of an event (for example, window, mouse, or keyboard).
OSType GetEventClass ( EventRef inEvent );
The event in question.
The class ID of the event. See “Event Class Constants” for more details.
CarbonEventsCore.h
Obtains the event target reference for the standard toolbox dispatcher.
EventTargetRef GetEventDispatcherTarget ( void );
An event target reference.
The standard toolbox dispatcher is the default mechanism for dispatching events to the appropriate event targets. You typically don’t need to call this, but some applications may need to pick events off the event queue and call the dispatcher themselves. This allows you to do just that instead of calling RunApplicationEventLoop to handle it all.
If desired, you can attach event handlers to the event dispatcher target. Doing so allows you to intercept any events before they can be sent to the appropriate event targets.
CarbonEvents.h
Returns the event kind for the specified event.
UInt32 GetEventKind ( EventRef inEvent );
The event in question.
The kind of the event.
Event kind values overlap in different event classes. For example, kEventMouseDown and kEventAppActivated both have the same value (1). The combination of class and kind determines a unique event signature.
CarbonEventsCore.h
Obtains an event monitor target.
EventTargetRef GetEventMonitorTarget ( void );
An event monitor target.
The event monitor target is a special event target used to monitor user input events across all processes. When an event handler is installed on the event monitor target, the Carbon Event Manager examines the EventTypeSpec for user input event types, such as mouse-down, mouse-up, and key-down. It then requests that the WindowServer make copies of any of these events that are sent to any process, and delivers them to the current process. These events are queued into the main thread’s event queue and are sent directly to the event handlers installed on the event monitor target during normal event dispatching. Monitored events are not sent through the normal event dispatching path for the current process. Instead, they pass through the event dispatcher target and are sent directly to the event monitor target.Handlers installed on the event monitor target receive events only when the current application is inactive. When the current application is active, all events flow through the event dispatcher target, and no events are sent to the event monitor target. Currently, the event monitor supports the following event kinds: kEventRawKeyDown, kEventRawKeyUp, kEventRawKeyRepeat, kEventRawKeyModifiersChange, kEventMouseDown, kEventMouseUp, kEventMouseMoved, kEventMouseDragged, kEventMouseWheelMoved, kEventTabletPoint, and kEventTabletProximity.To prevent keyboard events from being passed to other applications, Carbon and Cocoa password-edit-text controls enable a secure input mode while the focus is on the control. Their password-edit-text controls prevent the monitoring event target from being used to capture password keystrokes. For added security, GetEventMonitorTarget requires that “Enable access for assistive devices” be checked in the Universal Access preference pane in order to monitor kEventRawKeyDown, kEventRawKeyUp, and kEventRawKeyRepeat events. If this control is not checked, you can still install handlers for these events on the event monitor target, but no events of these types will be sent to your handler. Administrator privileges are required to enable this feature. You can determine whether this control is checked using the AXAPIEnabled function in AXUIElement.h.
CarbonEvents.h
Obtains a parameter from the specified event.
OSStatus GetEventParameter ( EventRef inEvent, EventParamName inName, EventParamType inDesiredType, EventParamType *outActualType, ByteCount inBufferSize, ByteCount *outActualSize, void *outData );
The event to get the parameter from.
The symbolic name of the parameter (for example, kEventParamDirectObject). The Carbon Event Manager defines a number of constants defining possible parameters.
The desired type of the parameter (for example, typeWindowRef). The Carbon Event Manager automatically uses AppleEvent coercion handlers to convert the data in the event into the desired type, if possible. The Carbon Event Manager defines a number of constants to indicate possible parameter types. Pass typeWildCard to request that the data be returned in its original format.
The actual type of the parameter (can be NULL if you are not interested in receiving this information).
The size of the output buffer.
The actual size of the data, or NULL if you don’t want this information.
The pointer to the buffer receiving the parameter data.
A result code. See “Carbon Event Manager Result Codes.”
Events often contain additional useful pieces of data, such as the location of a mouse-down event or the window in which an event occurred.
CarbonEventsCore.h
Returns the reference count of an event.
ItemCount GetEventRetainCount ( EventRef inEvent );
The current reference count for the specified event.
When an event is created, its reference count is 1. Calls to RetainEvent increment this count; calls to ReleaseEvent decrement the count.
CarbonEventsCore.h
Returns the time a specific event occurred.
EventTime GetEventTime ( EventRef inEvent );
The event in question.
The time the event occurred.
Returns the time the event specified occurred, specified as an EventTime value, which is a floating point number representing seconds since the last system startup.
CarbonEventsCore.h
Returns the last time a user input event arrived in the main event queue of the application.
EventTime GetLastUserEventTime ( void );
The time of the last user event.
A user input event is something generated by the user, typically a hardware event such as a mouse-click or key-down event.
CarbonEvents.h
Obtains a reference to the main event loop.
EventLoopRef GetMainEventLoop ( void );
An event loop reference.
The main loop is the event loop for the main application thread.
CarbonEventsCore.h
Obtains the main event queue.
EventQueueRef GetMainEventQueue ( void );
An event queue reference.
The main queue is the event queue for the main application thread.
CarbonEventsCore.h
Obtains an event target reference for the specified menu.
EventTargetRef GetMenuEventTarget ( MenuRef inMenu );
The menu to return the target for. See the Menu Manager documentation for a description of the MenuRef data type.
An event target reference.
Once you obtain this reference, you can send events to the target and install event handlers on it.
CarbonEvents.h
Returns the number of events in the event queue.
ItemCount GetNumEventsInQueue ( EventQueueRef inQueue );
The event queue to query.
The number of items in the queue.
Returns the number of events in an event queue.
CarbonEventsCore.h
Obtains the current hot key mode.
OptionBits GetSymbolicHotKeyMode ( void );
The mode request at the top of the hot key mode stack. If there are no mode requests on the stack, this function returns 0 to indicate that hot keys are currently enabled.
Unless the “Enable access for assistive devices” checkbox is checked in the Universal Access preference pane, all hot keys are enabled, even if this function returns a nonzero value. This means that hot keys enabled by the caller may be disabled for the current user session if they were disabled by another process.