Connect a micro switch to a PC serial port
I used 3 second and 4 words in google to find you a circuit, that does excatly what you want.

http://www.cedarlakeinstruments.com/blog/wp-content/uploads/2013/04/DB9-SW.png

Connector pins:
5: Ground (GND)
7: Request to send (RTS)
8: Clear to send (CTS)