This software will allow you to connect a switch to your serial port and run a command on your computer.
Solder a switch to pins 1 and 4 on a serial port adapter and connect the adapter to your serial port.
I would like to thank http://www.swen.uwaterloo.ca/~drayside/altinput/
for inspiration and hardware instructions.
the software requires the PySerial module available from pyserial.wiki.sourceforge.net/pySerial
Solder 3 more switches to the serial port connector and update the code to handle input from 3 switchs.