single board computers sharing a microswitch
Common ground and both pins set into input mode, as long as you keep both powered on at the same time. Shutting power off one while the pin is held high could lead to problems.

Other alternatives is using a Double Pole switch, or using two transistor or optocoupler circuits to make each board independent on power. Really just need a few resistors and wire as well as the transistor or optos.