Long press then long press2

I think you may be right, the different steps are a little easier to follow at the moment.
however i might need a little help with that Lol.

A Finite State Machine is setting up the framework, and then fill in each step. If the framework is good, then each step can be written without thinking about the other steps.

I smashed this together, assume that there are still a bug or two.

Can you change the sketch, so that it bails out as soon as the button is pressed too long ? That is now calculated after the button is released, but it can be calculated every time.

no i don't think the 2nd short press matters.
second short press?

then i think (untested)

                if (! repress)
                    return Short1;

yes that gets rid of the short second press, but what is the best way to go short press to long press and not short press to long press2.

you'd need to delay reporting the first press. then does it matter how long the 2nd press is?

This is what i was thinking short press (function a or b). long press (go function), long press 2 (stop function). long press 1 - if a short press is detected after long 1 cancel return back to a or b function.
The duration between long press 1 and long press2 shouldn't matter within reason maybe 3 mins.
after 3 mins if it doesnt detect a 2nd long press it returns back to a or b function.

if you are already "going", what does a 1st long press mean?

why not simply a long press toggle between go/stop?

So a long press would let you enter a mode and second long press would exit it
Just used stop and go as an example.
could that be toggled?

yes.
you don't need separate buttons for mutually exclusive modes such as stop/go or even modes 1,2,3 .... each button press advances to the next mode

so do you need long2?

What about if the frist long press has a true or false statement in it like edit = true.
then when the next long press is detected it has to have the condition to be long press and true to execute.
Would that work?

why do you need long1 and long2?

just to get more functionality out of one switch
short press toggle a and b
long press to open an editor
long press 2 to close the editor and save.

is there another way of doing it?

why not avoid the complication of a 2nd long press and simply use a long press to open editing and when it's open, to close/save?

what would happen for a long1 press when the editor is open?

so how would you exit editing without going back to toggle mode a and b.

my thinking was when the editor is open a second long press 1 would close and save return back to toggle mode.

what are mode a & B?

what is toggle mode

isn't a 2nd long press 1 close/save the editor what i suggested, so why do you need long press 2?

can you remind me how you code works, what all the button presses do?

sorry I'm confusing things, i was calling toggle mode was a&b on-off say.

1st long presss 1 open editor 2nd long press 1 is close/save editor.

1 short press = on( Led or relay), short press release would be = off. This is would be what im referring to as toggle mode.

so there's no need for the long2 press. the long1 press opens and then close/saves editing

ok.

when the editor is open would you not have to long press it to close the editor?