this is what detects the button commands.