Detect the mouse click 1, 2 and 3... possible?

Is there a way in which a button can detect the first click, the second click and the third click.

So basically if I wanted to perform an action on the first click, the second and the third, i.e a zoom in function, is there a way using some sort of listener to determine this.

For example a zoom in and a zoom out function.

Any help would be good