Added method for testing the pressed state of buttons.