Is there are UI object that can detect push and release?

Ben Casey's icon

I'd like to have buttons in my patch that when pressed and held, change the state of the patch until the buttons are released.
I know that Max can detect keyboard key press on and off, and midi note on and off, however is there a way to do it with buttons in a gui?

Griotspeak's icon

i think the matrixctrl could do it.

if all else fails, there should be a jsui object.

avantronica's icon

ubutton is one way fwd

Chris Muir's icon
Max Patch
Copy patch and select New From Clipboard in Max.

Here's a hastily extracted and adapted to use ubutton "Key Repeat" thing I use in some patches:

Ben Casey's icon

oh ubutton would be perfect accept i'm hoping to also use this patch in M4L and I'd prefer to be able to map a controller to this button easily. any idea on creating the same behavior using the standard bang or toggle?

Chris Muir's icon

The patch I posted could easily be modified to use a toggle as its input. Slap a [sel 0 1] after the toggle to get the on and off states

pid's icon

er, in mfl just bind the ubutton to a pattr and make a passive loopback with a live.toggle set to 'hidden'? oh, and use chris' idea with that.

Luke Hall's icon

I know I'm a bit late to the party but [pictctrl] does this all by itself.

lh