More issues. Decided to post everything here, but happy to break out into separate threads if necessary. All of the following occurs on Windows. Haven’t tested on Mac yet. I’m mostly using the free NVDA screen reader since JAWS only has a 40 minute free trial.
AccessibilityHandler::notifyAccessibilityEvent (AccessibilityEvent::valueChanged) is currently a no-op in
juce_win32_Accessibility.cpp. It’s not possible to notify accessibility clients that a UI elements value has changed. Adding the following code gets it working:
if (eventType == AccessibilityEvent::valueChanged)
//jassert (interfaces.value != nullptr); // Don't assert. See issue #4 below.
if (interfaces.value != nullptr)
VariantHelpers::setString (interfaces.value->getCurrentValueAsString(), &newValue);
sendAccessibilityPropertyChangedEvent (*this, UIA_ValueValuePropertyId, newValue);
juce::ComboBox doesn’t notify accessibility clients when the selected item changes via keyboard (up/down/left/right). As a result, screen readers don’t inform the user what the new value is. Adding the following code to the bottom of
juce::ComboBox::setSelectedId() gets it working (assuming issue 2 is fixed as above):
if (auto handler = getAccessibilityHandler())
Edit: I forgot I also had to make
notifyAccessibilityEvent (AccessibilityEvent::valueChanged), but
ButtonAccessibilityHandler doesn’t implement
AccessibilityTextValueInterface, so it’s effectively a no-op. Seems like an oversight.
Wish I’d had time to run through this during the JUCE 6.1 beta phase (unfortunately, other projects took precedence), but it’s otherwise a pretty solid first version. I’ll keep testing and report back here.