buttons_mask/2
     buttons_mask(?Buttons, ?Mask)
     

Translates between button specifications and the corresponding integer bitmask.

Buttons is a term of the form buttons(B1, B2, B3, B4, B5), where button number i has argument position i in the term and the value of each argument is either up or down.

Mask is the integer bitmask representing the given set of buttons.