Replace the keyboard. Or use an external one as above. You can try to take off the keys (carefully so you don't break or pull apart the mechanism) and clean it out a bit. If you have an IBM, not a Lenovo, laptop, it's old, the keyboard could have issues with the contacts now. Keyboards off ebay should be pretty cheap and easy to find.