Today, after complaining about the battery level for a few days, my wireless Apple keyboard finally stopped working. I took out the old batteries, put in the new ones and the keyboard remained dead. One hour later, it’s working again.
The keyboard model is A1255; it takes three AA batteries (a bad idea; apparently the newer model takes just two). It seems many people have the same problem with this keyboard and it looks like the culprit is spotty contact between the + end of the first battery and the keyboard.
To fix it, I took a 2 cm x 2 cm piece of tin foil from the kitchen, folded it into a little ball and dropped it into the battery compartment. I then made sure the tin foil ball was resting on the metal contact at the bottom of the compartment and dropped in the batteries. After putting in the cap, the keyboard turned on.