I have a keyboard that became very dirty with the years. Its (originally) white color and clear case made the dirt very apparent.
So I wanted to give the dishwasher a try, and without taking each key apart -- patience has its limits!
It worked great for me, and just requires some caution.
If possible, take the case apart. This will help the dirt, then the water, go away.
Allow to dry completely. It will take days. Failing to do it may cause shorts and harm your keyboard and your computer!
Wash at mild temperature.
These instructions have details for an old Mac keyboard, but the principle is not limited to this model.
In any case, please use your common sense; do it at your own risk; in case of doubt, don't do it. (Well, you're on instructables.com)
Step 1: Needed Stuff
Depending on your model, use the appropriate screwdrivers.
I needed a TX5 (small hex) and a PH0 (small Phillips), from my warranty voiding kit.
And important: You need a second keyboard, to be used while the first one is drying (it takes days!). Otherwise, the temptation to use the still wet one may be too high.
Optionally an USB hub is useful to lower the risk of harming your computer when testing the keyboard at the end of the process.
Step 2: Disassemble Keyboard
You may want to take pictures of the different steps, in order to ease the future reassembly.
(For the Mac keyboard, see step 7, and look at its pictures in reverse order)
Step 3: Prewash
To go green and avoid using the dishwasher for the one keyboard alone, I loaded it with dirty dishes along with the keyboard, and pre-washed using the rinse program.
Rinse program (7 minutes)
As a result, the keyboard is less dirty, but not yet totally clean.
Step 4: Wash
Then I washed using a little detergent.
Low temperature (40°C / 100°F)
Economy option (38 minutes)
Use a small quantity of detergent
Step 5: Dry
With a clean towel, remove most of the water.
At this point, see how the keyboard is now clean. It's truly shining white!
But remember, there's still water between/under the keys and in the nooks and grooves, so read on...
Step 6: Wait (and Use the Other Keyboard)
Leave the wet keyboard in a slanted position, so that gravity will help get rid of the biggest drops. Shake gently.
To accelerate the process, you can use an air compressor if you have one, to blow the droplets away.
Wait several days. I waited one week.
Step 7: Reassemble
Reassemble. That means, remember what you did in step 2 and redo it in reverse order.
For owners of the same model, see the images sequence in this step.
Step 8: Enjoy!
Connect(*), type some text, ... and?
... it should work!
Well, in my case it did work.
(*) In case of doubt, use an USB hub between your computer and the keyboard, to reduce the risk of harming the computer while checking. Then, and if you didn't fry the USB hub, connect the keyboard directly to the computer.