@Jens.Peter.Nielsen pointed out yesterday that “my” drop down menu widgets can’t be mapped like normal knobs. At first I didn’t believe it, but sure enough it is a 100% bug.
When I wrote these things years ago I probably didn’t even know what midi mapping is
Anyway, it turns out that to be mappable your widget must be a ParamWidget, and it must correctly call setTouchedParam on a button click.
It turns out that while all my old widgets are ParamWidgets, this particular one overrides ParamWidget::onButton() and does not correctly set the touched param.
Here’s a quick fix:
inline void PopupMenuParamWidget::onButton(const ::rack::event::Button &e) {
if ((e.button == GLFW_MOUSE_BUTTON_LEFT) && (e.action == GLFW_PRESS)) {
if (module) {
APP->scene->rack->setTouchedParam (this);
}
::rack::event::Action ea;
onAction(ea);
sq::consumeEvent(&e, this);
}
}
Once this bug is fixed, it works like you would expect:
Now, I just need to see if @robert.kock is interested fixing this in the Squinky Labs modules in the library manager.