One of our HiFiBerry DAC users has written a nice blog article how to build a network audio player with button control. It shows how to connect buttons to the Raspberry Pi. Also the source code for the button control is available.
Check out his article.