Check if function is not being used

Hey all,

I am wondering if there is a way to write an if statement that asks if a function is not currently being used. For instance, I have a couple of buttons. If one is clicked, I have a mouse event function that does something. I also have a boolean called Selected, which traces if it is currently the button clicked. When I click another one, that last button still comes up as true.