Forums > MaxMSP

textbutton bangs on press and release

March 18, 2014 | 12:43 pm

Hi,

I’m trying to make an interface to control some networked devices. I uses a lot of text buttons for styling purposes and I would like to have some of them to send a value when pressed then reset to the default value (1) when released.

I know of ubutton and lcd but I would like to use textbutton to keep the interface consistent. I tried a mouse state object but it obviously send a bang each time I release the mouse even if I don’t click the button and I don’t want it.

Any idea / help?

Here is my patch…

 

– Pasted Max Patch, click to expand. –

 


March 18, 2014 | 4:52 pm

Textbutton only sends a bang on mouse down OR mouse up, so it won’t directly do what you are asking. If you watch the visible action of the textbutton, you’ll see that even if you hold your mouse button down over the textbutton, it immediately reverts itself. If you just need it to send a value, and then a short time later send another value, you can do something like this:
<code>

– Pasted Max Patch, click to expand. –

</code>

If you really need the function of holding the button down, AND want it to look like the other textbuttons, you may need to design something with pictctrl. You could create a graphic button that looks like your other textbuttons and it will behave the way you want. Be sure to look at the help file, and especially the "pictureformats" tab on the help file to properly design your button.


March 19, 2014 | 6:36 am

Thanks a lot. I will deal with pictctrl…


March 19, 2014 | 8:06 am

I recommend making a feature request for mouse up&down behavior of textbutton. In the meantime, here’s a kludgy-but-working solution.
<code>

– Pasted Max Patch, click to expand. –

</code>


March 19, 2014 | 10:41 am

Very clever!


March 19, 2014 | 10:52 am

Wow! Really clever!!
Thanks for your solution… I think it works well for what I need at the moment…
How to make a feature request?
I searched the site but I found nothing but posts on the forum for feature requests. Is there a more direct way for doing this?


March 19, 2014 | 12:52 pm

I think you could just use the bug-report form, and state that you’re making a feature request rather than a bug report.



Lee
March 19, 2014 | 1:14 pm

this would be a good feature to have – I’ve wanted it a few times in the past


March 20, 2014 | 1:52 am

I made a feature request using the bug report form as Christopher suggested.
Thanks again for your help.


March 21, 2014 | 3:19 am

Wow. Cycling 74 support was really fast to reply but they told me they will unlikely add a such new function to the textbutton because there are many options to achieve the result with minimal patching.
I think I will use the patch that Christopher suggested within a bpatcher to keep everything clean…


Viewing 10 posts - 1 through 10 (of 10 total)