Toggle Button - anyone made one before?

Before I go off and roll my own, I thought I’d ask if anyone had already created a toggle button. Basically, what I am looking for is a button that has 2 states.

The first is the normal, press and the button goes down and then release and the button pops back up again. I get both down and up state clicks events.

The second state is you press the button and it goes down, release and it stays down. Click again and it returns to the up state.

This effectively generates a momentary and latching buttons.

The button should have a setting to select either mode so is all done with the same button. Each button is programmed by the user to be latching or momentary.

The reason for this is I need to use these with a solenoid valve pack and relay switching were some of the valves or relays need to remain on (latching) when I release the finger and some need to only be on when I hold my finger on the button (momentary).

I, therefore, need a CLICK for each state for down and release. Buttons at present do this but don’t latch.

If no one has done this before, I can create my own buttons to do this but it would save some time if this has already been done. :smile:

Make a list of what is missing here

Done. I’ll add more as I think of them.

Are we talking about a physical button or a software one (on a GUI)?

I think this is for the UI graphics library

As per Darko’s reply. GUI. Not possible to do this with hardware.

On the PC side with C# I use a library file that allows me to use bitmaps for the button states and if has this toggle capability. Sadly the library is closed source and paid for so I am unable to use any of it.

I think my 2 weeks in Australian quarantine in early January might just be the time to spend making some custom GUI components. :grinning:

1 Like