Rotary sliders right click changes ignored in SliderParameterAttachment::sliderValueChanged ... why?

When right click dragging a slider in my plugin it moves the slider but does not send this message to the host.
The point it’s being stopped seems to be in SliderParameterAttachment::sliderValueChanged
I get that ignoreCallbacks is there to stop loops around change notification, but why is this also throwing away all notifications if the right mouse button is down?

Perhaps I’m missing something obvious, but wouldn’t it be better to ignore right click drag in the slider itself as otherwise the slider moves, but the host params do not update.

1 Like

That IS odd! I would also have assumed that right-click dragging would not change a slider’s value. Seems like an oversight in the slider’s drag code.

It’s an old issue, never solved. No one seems to get the logic behind that test in that place.

1 Like

I still can’t wrap my head around why by default JUCE buttons/sliders etc. will treat a right click no differently to a left click, I resorted to creating a wrapper template that only does its “action” when the left button is used that I need to use almost everywhere.

A Component::ignoreRightClicks(bool) would be a nice addition that would maintain backwards compatibility.

2 Likes

There has been a similar discussion also for Buttons here: [FR] Buttons: add option to ignore clicks with right mouse button

The problem with ignoring right-clicks at the Component level is that, if implemented in the same fashion as setInterceptMouseClicks() does, it prevents the usage of right-clicks entirely, but they come handy sometimes, e.g. to open a pop-up menu.

The ideal would be to have a method in Slider, and one in Button, to say: don’t perform your main action when the right (secondary) mouse button is pressed, but only when it’s triggered with the left (main) button.

One such “property” could be even set in the Component base class, but what is done with it should be implemented specifically for every widget where that makes sense, while still allowing right-clicks to trigger listeners and callbacks for those widgets

1 Like