Mac Developer Library


AXNotificationConstants.h Reference

Deployment Target:

On This Page

AXNotificationConstants.h Reference

Assistive applications can register to be notified about certain events in a target application. For example, creation of a window or the destruction of a UIElement. To receive notifications you must first create an observer and specify a callback function; second, add the observer's run loop source to the run loop on which you want the callback executed; and third, register the observer for one or more notifications.

When you create the observer, you specify the application being observed. An observer can receive notifications only from UIElements in that application. To handle multiple applications, you have to create at least one observer per application.

When you register an observer for a notification, you specify the UIElement you are interested in observing. When you want to receive a notification from any element in an application, use the application UIElement; you then receive the notification regardless of which element in the application sends the notification. This is useful if the UIElement does not exist yet, such as when a new window is created, or if you care about state changes, such as the keyboard focus moving, without having to observe every element separately. When the callback function is executed it is passed the UIElement that was affected by the notification.

Observers are represented by the AXObserverRef type, which is a CFType. Like all CFTypes they are reference counted (CFRetain/CFRelease).


  • Priority values used for kAXPriorityKey


    typedef CF_ENUM( CFIndex , AXPriority) { kAXPriorityLow = 10, kAXPriorityMedium = 50, kAXPriorityHigh = 90 } CF_ENUM_AVAILABLE_MAC ( 10_9);


See the Overview section above for header-level documentation.

  • Declaration

    #define kAXAnnouncementKey CFSTR("AXAnnouncementKey") #define kAXAnnouncementRequestedNotification CFSTR("AXAnnouncementRequested") #define kAXApplicationActivatedNotification CFSTR("AXApplicationActivated") #define kAXApplicationDeactivatedNotification CFSTR("AXApplicationDeactivated") #define kAXApplicationHiddenNotification CFSTR("AXApplicationHidden") #define kAXApplicationShownNotification CFSTR("AXApplicationShown") #define kAXCreatedNotification CFSTR("AXCreated") #define kAXDrawerCreatedNotification CFSTR("AXDrawerCreated") #define kAXFocusedUIElementChangedNotification CFSTR("AXFocusedUIElementChanged") #define kAXFocusedWindowChangedNotification CFSTR("AXFocusedWindowChanged") #define kAXHelpTagCreatedNotification CFSTR("AXHelpTagCreated") #define kAXLayoutChangedNotification CFSTR("AXLayoutChanged") #define kAXMainWindowChangedNotification CFSTR("AXMainWindowChanged") #define kAXMenuClosedNotification CFSTR("AXMenuClosed") #define kAXMenuItemSelectedNotification CFSTR("AXMenuItemSelected") #define kAXMenuOpenedNotification CFSTR("AXMenuOpened") #define kAXMovedNotification CFSTR("AXMoved") #define kAXPriorityKey CFSTR("AXPriorityKey") #define kAXResizedNotification CFSTR("AXResized") #define kAXRowCollapsedNotification CFSTR("AXRowCollapsed") #define kAXRowCountChangedNotification CFSTR("AXRowCountChanged") #define kAXRowExpandedNotification CFSTR("AXRowExpanded") #define kAXSelectedCellsChangedNotification CFSTR("AXSelectedCellsChanged") #define kAXSelectedChildrenChangedNotification CFSTR("AXSelectedChildrenChanged") #define kAXSelectedChildrenMovedNotification CFSTR("AXSelectedChildrenMoved") #define kAXSelectedColumnsChangedNotification CFSTR("AXSelectedColumnsChanged") #define kAXSelectedRowsChangedNotification CFSTR("AXSelectedRowsChanged") #define kAXSelectedTextChangedNotification CFSTR("AXSelectedTextChanged") #define kAXSheetCreatedNotification CFSTR("AXSheetCreated") #define kAXTitleChangedNotification CFSTR("AXTitleChanged") #define kAXUIElementDestroyedNotification CFSTR("AXUIElementDestroyed") #define kAXUIElementsKey CFSTR("AXUIElementsKey") #define kAXUnitsChangedNotification CFSTR("AXUnitsChanged") #define kAXValueChangedNotification CFSTR("AXValueChanged") #define kAXWindowCreatedNotification CFSTR("AXWindowCreated") #define kAXWindowDeminiaturizedNotification CFSTR("AXWindowDeminiaturized") #define kAXWindowMiniaturizedNotification CFSTR("AXWindowMiniaturized") #define kAXWindowMovedNotification CFSTR("AXWindowMoved") #define kAXWindowResizedNotification CFSTR("AXWindowResized")


    • kAXAnnouncementKey

    • kAXAnnouncementRequestedNotification

    • kAXApplicationActivatedNotification

      Value is an application UIElement.

    • kAXApplicationDeactivatedNotification

      Value is an application UIElement

    • kAXApplicationHiddenNotification

      Value is an application UIElement

    • kAXApplicationShownNotification

      Value is an application UIElement

    • kAXCreatedNotification

    • kAXDrawerCreatedNotification

    • kAXFocusedUIElementChangedNotification

      Value is the new focused UIElement or the Application UIElement if there's no focus

    • kAXFocusedWindowChangedNotification

    • kAXHelpTagCreatedNotification

    • kAXLayoutChangedNotification

    • kAXMainWindowChangedNotification

      Value is the new main window UIElement or the Application UIElement if there's no main window.

    • kAXMenuClosedNotification

      Value is the closed menu UIElement.

    • kAXMenuItemSelectedNotification

      Value is the selected menu item UIElement.

    • kAXMenuOpenedNotification

      Value is the opened menu UIElement.

    • kAXMovedNotification

    • kAXPriorityKey

    • kAXResizedNotification

    • kAXRowCollapsedNotification

      The value is the collapsed row UIElement.

    • kAXRowCountChangedNotification

    • kAXRowExpandedNotification

      The value is the collapsed row UIElement.

    • kAXSelectedCellsChangedNotification

    • kAXSelectedChildrenChangedNotification

    • kAXSelectedChildrenMovedNotification

    • kAXSelectedColumnsChangedNotification

    • kAXSelectedRowsChangedNotification

    • kAXSelectedTextChangedNotification

    • kAXSheetCreatedNotification

    • kAXTitleChangedNotification

    • kAXUIElementDestroyedNotification

      The returned UIElement is no longer valid in the target application. You can still use the local reference with calls like CFEqual (for example, to remove it from a list), but you should not pass it to the accessibility APIs.

      Value is the destroyed UIElement

    • kAXUIElementsKey

    • kAXUnitsChangedNotification

    • kAXValueChangedNotification

      This notification is sent when the value of the UIElement's value attribute has changed, not when the value of any other attribute has changed.

      Value is the modified UIElement

    • kAXWindowCreatedNotification

      Value is a new window UIElement

    • kAXWindowDeminiaturizedNotification

      Value is the unminimized window UIElement

    • kAXWindowMiniaturizedNotification

      Value is the minimized window UIElement

    • kAXWindowMovedNotification

      This notification is sent at the end of the window move, not continuously as the window is being moved.

      Value is the moved window UIElement

    • kAXWindowResizedNotification

      This notification is sent at the end of the window resize, not continuously as the window is being resized.

      Value is the resized window UIElement