Accessibility (screen reader) follows tabKey KeyboardFocus - but not for Sliders

Thanks, that is better, although it’s not entirely what I expected.

As I debug into this stuff, I’m seeing how complex the Accessibility code is, so forgive me if my observations are somewhat unenlightened; I have a lot to learn.

Let me ask this: would a visually-impaired user expect the tab key to give them descriptions like the VO keys?

With this fix, you are told you are in a text area. You don’t get the name of the slider, or the tooltip/helpText read (if it has one), or anything descriptive. Perhaps I have not investigated the Accessibility deeply enough, but I have tooltips assigned to all of my UI components, and names, and the VO reads them, but not in this case when you (now) tab into a slider.

I understand that the Slider is a particularly complex case, since you have a TextEditor inside a SliderLabelComp inside a Slider. But really, this Accessibility info needs to be passed down to the TextEditor.

You can hack this to happen by doing something like this in Label::showEditor():

void Label::showEditor()
{
    if (editor == nullptr)
    {
        editor.reset (createEditorComponent());
        editor->setSize (10, 10);
        addAndMakeVisible (editor.get());
        editor->setText (getText(), false);
        editor->setKeyboardType (keyboardType);
        editor->addListener (this);
        editor->grabKeyboardFocus();
        
        // HACK TO PASS ACCESSIBILITY INFO
        if (auto pc = dynamic_cast<Slider*>(getParentComponent()))
        {
            editor->setTitle(pc->getTitle());
            editor->setTooltip(pc->getTooltip());
        }
		// END HACK

        if (editor == nullptr) // may be deleted by a callback
            return;

        editor->setHighlightedRegion (Range<int> (0, textValue.toString().length()));

        resized();
        repaint();

        editorShown (editor.get());

        enterModalState (false);
        editor->grabKeyboardFocus();
    }
}

But, this is currently impossible in a Slider (without modifying JUCE) since there is no access provided to the Label component (private) or the Text Area. I’ll just add this old request here for reference:

But even if you hack something together using the SliderLabelComp ptr you can get in LookAndFeel_V2::createSliderTextBox, you can’t get a ptr to the TextEditor that is created by Label::showEditor().

Alternately, it would be nice to have a lookAndFeel method for createEditorComponent().

Is there some other way to accomplish this?

EDIT: One other observation:

Why, when you keep tabbing around in a loop (even with VO off), does it first select Slider 1 as a whole, then requiring a second tab to get into the text box? When you go from one slider to the next, it does not focus the outer slider first. But when you tab around to the first slider from the ComboBox (looping around), it first focuses the outer slider, then requiring a second tab to focus the TextEditor.