Q:

Hardware to do i/o to and from external devices

I've got a potential client who wants a database driven app, either in Java or Python driving MySQL or PostgreSQL, but we need to get input from an external machine, such that every time this external machine closes a microswitch, a value in the database gets decremented and it shows up on the app.  
Also, when that value in the database reaches zero, we want to turn on a light on the external machine until the operator does something in the GUI, and then we want to turn off the light.  
My client's proposed solution is to wire the microswitch into one of the keys on the keyboard and just avoid using that key for anything else (he suggested the F12 button), and to control the light by playing a sound file through the left channel to start it, and the right channel to stop it.  
That seems a little cheesy to me, especially the wires going into the keyboard - and not just cheesy, but also a potential source of hardware problems if the operator accidentally pulls out a wire.  I'd much rather something that either went into the USB port or possibly an internal card, just to keep the wiring around the back and away from the operator.  But since the client hopes to sell a lot of these, he wants to keep the price down.
I realize this isn't strictly "programming", but it's to solve a problem in a program I'm writing.  So I'm asking you: is there a cheap hardware device that would do what I want?

A:

Cheap hardware device: Arduino
It's small, cheap, programmable, and very easy to learn how to program for (pretty much C++).  It can interface with either USB or Serial depending on the board you get.  It's the hardware hacker's wet dream when it comes to tinkering around with wierd projects that need to interface with a computer somehow.  You could even wire up an LED for notifying the technician directly to the arduino. 
Pros: Very little hardware knowledge needed to complete your project. All the wiring for reading a switch and lighting an LED are on the arduino project's site.
Cons: Learning how to interface your software with the Arduino Library might take a little bit of time.

A:

To expand on Marcelo's answer, in case you want to prototype this quickly, FTDI does make a standalone board, the UB232R, which is about US$20 in single quantities. You could use the CTS pin as an input (with an appropriate pullup, e.g. 10K) from your device to the PC.
All you need besides one of these is a USB cable and a way to connect the board to your microswitch. (not sure whether a solderless breadboard would be appropriate / robust enough, but it's a quick & dirty solution since the UB232R has a DIP8 footprint) No external power supplies, no need to make a custom PC board, no need to program anything other than your PC, no need to learn any hardware drivers beyond the basic communication port services, assuming your PC's communication libraries include features to read the CTS pin status.
edit: for an output, you can use the RTS pin. If you have more inputs and outputs than this, you'll want to think a little more carefully....

