AudioProcessorValueTreeState::SliderAttachment and RightButtonDown


AudioProcessorValueTreeState::SliderAttachment does not take into account the slider changes if the right button is down :

void sliderValueChanged (Slider* s) override
    const ScopedLock selfCallbackLock (selfCallbackMutex);

    if ((! ignoreCallbacks) && (! ModifierKeys::getCurrentModifiers().isRightButtonDown()))
        setNewUnnormalisedValue ((float) s->getValue());

any reason to have that isRightButtonDown() test here?

It’s possible to change the value of a slider by right clicking on it (you can test that on one of the rotary slider of the juce demo plugin) so the param value should be set accordingly, but it’s not the case because of that test.

AudioProcessorValueTreeState && thread-safety

let me know if you can’t reproduce.


I thought the sliders generally used right-click for a menu. Does it matter whether it responds to a right-click? Users are very unlikely to try that, don’t you think?


The menu is only there if you explicitly called Slider::setPopupMenuEnabled (true); but otherwise the slider will respond to the right button, so at the moment you can change the slider value this way without the SliderAttachment taking it into account.
Removing the possibility to use the right button to change the sliders could be a solution yes.

Note also that it’s pretty easy to accidentally start a drag with a right click on the trackpad (if there are 2 fingers on the trackpad during the mouse down, then ModifierKeys::getCurrentModifiers().isRightButtonDown() will return true during the following drag, even if you only have one finger left afterwards)


anything planned regarding that?