Button Pressing

Can you adapt this example to achieve the desired result: