The enum function allows a button to toggle between two states. Is there a way to do that in code with a normal single button whose state is momentary? For example, I am trying to select faces of a model, then deselect with a standard button, not a toggle button.
I've only gotten a theoretical function:
for f in bm.faces:
if bm.faces[f.index].select === True:
bm.faces[f.index].select = False
else:
bm.faces[f.index].select = FalseTrue
This will test the first state, then the second which will make them both true. Is there a way to stop at the first state?