Clickable param knobs.


I need an element that functions like a ‘push-button encoder’ - it’s similar to a standard PARAM with infinite rotation and the ability to click on it.

I’ve figured out how to achieve infinite rotation ( configParam(MY_PARAM, -INFINITY, INFINITY, 0); ), but I haven’t yet figured out how to detect clicks on the knob (if it’s even possible to do so).

Has anyone encountered this before or can offer advice?

Do you mean something like the “Pico Drums” from erica synths? They have clickable encoders:

Very cool!

Yes, it is possible to react to mouse clicks. Every widget receives mouse notifications. Here is an example of capturing mouse clicks in my Sapphire Tricorder module.

1 Like

Exactly! That’s exactly what we need. But it seems like Erica Synths Pico Drums doesn’t have open-source code. Do you happen to know how it’s implemented?

As far as I understand, you’re creating a separate component to handle the clicks. So, is it not possible to simply use a standard PARAM and obtain information about the clicks within the module’s code?

However it works I hope you improve on it as the pico drums do recall the settings but after reloading a patch and turning the knob it always jumps to the initial state.

There might be, if someone has already written a widget class for that. There are “latch” buttons that toggle state on every press. And there are knobs that rotate. My guess is, you will have to create your own hybrid widget that has both behaviors. Studying existing code could help you achieve that.

But it’s not that unusual for VCV Rack plugin developers to create their own mouse handling and graphics rendering code for custom controls.

Yes, it seems like I’ll have to create my own widget.

Well, thank you all for the quick responses and for the code examples.

1 Like

My pachde1 Imagine has “push” knobs that support chift/ctrl variations on what happens when you click.

See this to see how it’s done:

pachde1/src/components.hpp at main · Paul-Dempsey/pachde1 · GitHub

1 Like