Reset a knob with doubleclick

Our customers have asked for the feature to reset a knob with a doubleclick to the default value. VSTGUI currently uses strg+leftclick to do this.

Since I do not want to inherit a new class I made a modification to ccontrol.cpp in my own fork of VSTGUI:

bool CControl::checkDefaultValue (CButtonState button)
if (button.isDoubleClick ())
//if (button.isLeftButton () && button.getModifierState () == kDefaultValueModifier)
if ((button.isLeftButton () && button.getModifierState () == kDefaultValueModifier)||button.isDoubleClick ())

Is this code change ok or can it have unexpected side effects?

1 Like

I did the similar way (isDoubleClick) and don’t believe it has any unexpected side effects.