Single click button solved?

R6. Has anyone solved the problem with lack of a single-click button?

I’ve been searching on the forum but didn’t find anything that actually works.

I have two bool inputs which must react on true while the component must not run on mouse-up.

I’ve tried with both Button and ToggleButton but no go…

// Rolf

Not quite sure exactly what you’re after but I made this component a while back - any use to you?

Problem is that Buttons first sends a true and then on mouse-up it sends a false. It’s a bug, and it’s usually not visible, unless you drive some code which then runs twice.

// Rolf

Doesn’t the Value List trick work?

-wim

Boy that brings back memories, was literally going to reply that one can’t publish Value List to RCP :older_man:

That’s correct, but Rolf didn’t mention RCP :see_no_evil:
-wim

1 Like

True true, also there are actually two issues sorta intermingled here:

  1. That the Button expires twice on a single click, causing the canvas to freeze (as Rolf points out).
  2. That the Boolean Toggle requires double clicking to switch state (which was my issue back in 2014 as per the thread on the old forum above).

These issues are still a primary UX issue on a weekly basis for me BTW :slightly_frowning_face:

1 Like

If the Button would send a “1” on press and “-1” on release, and of course “0” in resting position, the problem could be solved more easily on the receiving end. Now I have to toggle states inside components which makes the logic look weird.

I often use RCP and often not. In most cases also RCP must work for a boolean control… :wink:

And yes, the Value List can solve the dblclick Toggle Button problem as long as it is used only on the GH canvas.

// Rolf

Would a slider with only 0 and 1 not work too? You have to drag instead of a single click, but :man_shrugging:

Button > DataDam (with more seconds than the pressing time) does not work too?

EDIT: this works when you do the click and release in less time than the data dam delay, since it cancels one of the expirations of the button.

Yes, that would work also on RCP. Good idea!

// Rolf

Boolean Toggle is also an okay workaround (and actually is single-click in the RCP, acting like a radio-button!). I tend to use these in cases where a Button might freeze the canvas, or, simply hold Button down while clicking until the process it activates is done computing (which appears not to freeze the canvas).

Hello !

This is indeed it !!! I would never have thought of this.
For the moment, I just need to do a “long clic” on the button.

Thank you everyone !!!

1 Like

Hi. I was struggling to find a solution. But here it is. Workaround, but … sends “true” only once when clicked. You just have to set “record limit” for the “data recorder” component to “1”.

EDIT: Altgough the panel truly shows just one value per click, the rest (when something connected to the panel) somehow behaves as before :frowning: I am sad.

These two different solutions

The first one included in Fennec addon:

And the second one available here:

2 Likes

Hi @Matt_Harwood,
I need exactly this component! I’ve tried a lot, but I don’t know Python or C# yet.