diff --git a/modules/juce_gui_basics/accessibility/enums/juce_AccessibilityEvent.h b/modules/juce_gui_basics/accessibility/enums/juce_AccessibilityEvent.h index cbcb36a41b..41b2475d3c 100644 --- a/modules/juce_gui_basics/accessibility/enums/juce_AccessibilityEvent.h +++ b/modules/juce_gui_basics/accessibility/enums/juce_AccessibilityEvent.h @@ -43,10 +43,16 @@ enum class AccessibilityEvent */ valueChanged, + /** Indicates that the title of the UI element has changed. + + This should be called on the handler whose title has changed. + */ + titleChanged, + /** Indicates that the structure of the UI elements has changed in a significant way. - This should be posted on the top-level handler whose structure has changed. + This should be called on the top-level handler whose structure has changed. */ structureChanged, diff --git a/modules/juce_gui_basics/native/accessibility/juce_mac_Accessibility.mm b/modules/juce_gui_basics/native/accessibility/juce_mac_Accessibility.mm index 3466e18d45..8e5ab03af3 100644 --- a/modules/juce_gui_basics/native/accessibility/juce_mac_Accessibility.mm +++ b/modules/juce_gui_basics/native/accessibility/juce_mac_Accessibility.mm @@ -1096,6 +1096,7 @@ void AccessibilityHandler::notifyAccessibilityEvent (AccessibilityEvent eventTyp case AccessibilityEvent::textChanged: case AccessibilityEvent::valueChanged: return NSAccessibilityValueChangedNotification; + case AccessibilityEvent::titleChanged: return NSAccessibilityTitleChangedNotification; case AccessibilityEvent::structureChanged: return NSAccessibilityLayoutChangedNotification; } diff --git a/modules/juce_gui_basics/native/accessibility/juce_win32_Accessibility.cpp b/modules/juce_gui_basics/native/accessibility/juce_win32_Accessibility.cpp index d0939b006b..8cb2d526c9 100644 --- a/modules/juce_gui_basics/native/accessibility/juce_win32_Accessibility.cpp +++ b/modules/juce_gui_basics/native/accessibility/juce_win32_Accessibility.cpp @@ -166,6 +166,14 @@ void notifyAccessibilityEventInternal (const AccessibilityHandler& handler, Inte void AccessibilityHandler::notifyAccessibilityEvent (AccessibilityEvent eventType) const { + if (eventType == AccessibilityEvent::titleChanged) + { + VARIANT newValue; + VariantHelpers::setString (getTitle(), &newValue); + + sendAccessibilityPropertyChangedEvent (*this, UIA_NamePropertyId, newValue); + } + auto event = [eventType] () -> EVENTID { switch (eventType) @@ -174,6 +182,7 @@ void AccessibilityHandler::notifyAccessibilityEvent (AccessibilityEvent eventTyp case AccessibilityEvent::textChanged: return UIA_Text_TextChangedEventId; case AccessibilityEvent::structureChanged: return UIA_StructureChangedEventId; case AccessibilityEvent::rowSelectionChanged: return UIA_SelectionItem_ElementSelectedEventId; + case AccessibilityEvent::titleChanged: case AccessibilityEvent::valueChanged: break; }