The button is a bit field with bits corresponding to the left button (bit 0), the right button (bit 1), and the middle button (bit 2). This refers to the binary representation of 1, 2, and 4. For example, 001 represents the left button, 010 represents the right button, and 100 represents the middle button.

Code:
 001        010        100
 bit 0      bit 1      bit 2
 1          2          4
 left       right      middle
I hope that clears it up.