Disable double-click to reset knob but keep alt+click enabled?

We have Sliders (rotary knobs) that have a Label in the middle of them, and we’re calling setDoubleClickReturnValue( false, 0, juce::ModifierKeys::altModifier ) on them to prevent the double-clicks from changing the knob value and instead allowing them to go to the Label that’s inside them. But we found that disabling double-clicking also appears to disable alt+clicking to reset the knob values. We want alt+click to reset the knobs to their default values, but double-click to launch the editor for the Label.

Is there a way to prevent double-click from resetting a knob’s value, but still allow alt+clicking to reset the value?

yeah you could inherit from Slider and just override mouseDoubleClick and leave it empty

1 Like

D’oh, of course! We have a derived class for this already, so just added our own flag we can check to see if double-click is disabled instead of using setDoubleClickReturnValue() and checking isDoubleClickReturnEnabled(). Thanks!