Is there a way to tell if buttonClicked() was called due to the auto-repeat feature of the button?
I have a couple of buttons that move selected items up or down in a graph, and if they hold those buttons down, I continue moving the items up or down.
But these button presses add an entry to an Undo stack, and each time buttonClicked() is called from this auto-repeat feature, the new state of the graph is pushed onto an Undo stack. That’s not what a user would want. They’d want to only see this action add only 1 item to the Undo stack.
To accomplish that, what I want to do is to swap the results with the top stack item - as opposed to pushing it onto the stack - whenever the buttonClicked() comes from an auto-repeat. This would accomplish what the user wants.
So… is it possible to know whether buttonClicked() came from an auto-repeat, as opposed to the initial click on the button? Or do I need to make my own derived Button class that records this information and then makes it retrievable in buttonClicked()?