different action based on the number of times a button is pressed

UKHeliBob:
Thanks for the clarification, but I bet that the OP didn't mean to use that construction as that is not what the comments say.

Oh, I have no doubt the OP didn't know what he was doing with that part of the code.