How Can I Detect Button Pressing?

This state change detection tutorial will show how to wire the switch and how to detect the switch being pressed and released.