# AudioProcessorValueTreeState::SliderAttachment and RightButtonDown

**URL:** <https://forum.juce.com/t/audioprocessorvaluetreestate-sliderattachment-and-rightbuttondown/23438>\
**Category:** General JUCE discussion\
**Created:** [July 25, 2017, 8:14am UTC](https://forum.juce.com/t/audioprocessorvaluetreestate-sliderattachment-and-rightbuttondown/23438 "2017-07-25T08:14:15Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![lalala](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/lalala/32/8577_2.png) [@lalala](https://forum.juce.com/u/lalala)\
**Post date:** [July 25, 2017, 8:14am UTC](https://forum.juce.com/t/audioprocessorvaluetreestate-sliderattachment-and-rightbuttondown/23438/1 "2017-07-25T08:14:15Z")

</div>

`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.

---

<div class="post-metadata">

**Author:** ![lalala](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/lalala/32/8577_2.png) [@lalala](https://forum.juce.com/u/lalala)\
**Post date:** [August 8, 2017, 5:50am UTC](https://forum.juce.com/t/audioprocessorvaluetreestate-sliderattachment-and-rightbuttondown/23438/2 "2017-08-08T05:50:37Z")

</div>

let me know if you can’t reproduce.

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [August 8, 2017, 7:57am UTC](https://forum.juce.com/t/audioprocessorvaluetreestate-sliderattachment-and-rightbuttondown/23438/3 "2017-08-08T07:57:51Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![lalala](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/lalala/32/8577_2.png) [@lalala](https://forum.juce.com/u/lalala)\
**Post date:** [August 8, 2017, 9:26am UTC](https://forum.juce.com/t/audioprocessorvaluetreestate-sliderattachment-and-rightbuttondown/23438/4 "2017-08-08T09:26:39Z")

</div>

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)

---

<div class="post-metadata">

**Author:** ![lalala](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/lalala/32/8577_2.png) [@lalala](https://forum.juce.com/u/lalala)\
**Post date:** [February 23, 2018, 1:07pm UTC](https://forum.juce.com/t/audioprocessorvaluetreestate-sliderattachment-and-rightbuttondown/23438/5 "2018-02-23T13:07:20Z")

</div>

anything planned regarding that?
