News for hackers. Stuff that matters.
Re:Buttons as Finite Automata by feoren on Thursday March 24, 2022 @12:17PM (#30791974)
Click/hold the mouse while outside of the button. Middle-bottom state is hovering over the button while your mouse is down, without having clicked the button. I can see that being useful. However, I can't see why the bottom-left state is ever useful, except perhaps as the only way to get to the "hover, pressed" state.
Re:Buttons as Finite Automata by FabHK on Thursday March 24, 2022 @12:46PM (#30792375)
It is useful because you don't want to fire when you click and hold outside the button, then enter the button area, then release. So, when you release inside the button, you must know whether you clicked inside or outside the button. Thus you need those states. I think.
Re:Buttons as Finite Automata by tonyarkles on Thursday March 24, 2022 @04:58PM (#30795247)
If you imagine DOM elements as each having a separate FSM and if you consider the possibility of entry/exit actions on each state, "idle, down" in the bottom left could have an entry action that primes the system for drag & drop. Click down outside, release inside is exactly what D&D would have.