Declaration: button as long
Specifies which mouse button is pressed:
No button is pressed.
Left button is pressed.
Right button is pressed.
Left and right buttons are both pressed.
Middle button is pressed.
Left and middle buttons both are pressed.
Right and middle buttons are both pressed.
All three buttons are pressed.
The onbuttondown and onbuttonup events set the button value in different ways. The onbuttonup event just sets the value for the button which has been released and raised the up event regardless which buttons are also pressed at the moment.