I have an ImageButton that the user can change the behavior of, from toggle-style to push-button style. When they set it to toggled style, then I get the expected parameterChanged() callbacks both on the mouse down and mouse up events. But when they change it to be push-button style, those callbacks no longer occur.
When the user changes the button style, I execute this code:
int mode = triggerModeComboBox->getSelectedItemIndex(); playPatternButton->setClickingTogglesState( (mode == kTriggerMode_Latch) ); playPatternButton->setTriggeredOnMouseDown( (mode == kTriggerMode_Manual) );
I added that last line in an attempt to fix the problem, but my processor still doesn’t get notified when the button is pressed.
When set to push-button style (mode == kTriggerMode_Manual), I need the parameter to change to 1 and then 0, and the processor to receive both the mouse down and mouse up notifications (which come via the ButtonAttachment in the component that contains that button).
How can I do that? I can see the mouse down and mouse up events in the component’s buttonClicked() callback, but responding to these button up and down changes requires my setting a value in my DSP code as soon as possible, so that function doesn’t seem like where the proper response code should be.
Is there any way to get my button to send me parameter change notifications for both mouse down (1) and mouse up (0), while acting as a push-button (in other words, returning back to 0 when I let go of the button)?