The key to our BMW 323 received a severe shock, after which it continued to perform all functions including remote unlocking, but excluding ignition. Luckily, the valet key started the car, so between them we had full functionality.
Starting at the hole end (where the two halves are not sealed together) I pried the key open to find a coil had been torn loose. I was able to solder the coil back in place, making sure the ends of the fine wire were soldered to the solder mounts at either end.
I read the proper way to seal (and unseal) the key was to heat the parts with a hair-dryer until they were too hot to touch, then press them together. I was concerned the heat might damage the battery, and could not get the parts hot enough to soften the gasket that is supposed to fuse the parts together. The gasket was still firmly attached to one side, so I super-glued it to the other, holding it with clothes pins and making sure the seal would be water-tight. (I thought a solvent might damage the plastic, while a water-based glue might corrode. Silicone might be messy). I imagine that heat could still separate them again to replace the battery.
Stephan Bianchi, October 2010