Do a little housecleaning--run the disk defrag and disk cleanup (START -> All Programs -> Accessories -> System Tools -> you'll find both right there)
Run your various spyware and malware scans, update your antivirus. Just to be sure there's no extra baggage in there.
Go get a new keyboard. They're cheap. You can find a basic one for as little as a dollar at a good sale, but I'd spend in the $10 to $20 range for a nice dependable one. Bring it home, and when the computer is turned off, swap out the keyboards.
Turn the computer on and use as usual. If the problem returns, pack up the new keyboard and take it back to the store (unless you enjoy the new keyboard). Try system restore (I don't know your operating system, but if you're using XP there are several places to reach it. First of which is when you turn on your computer and you'll see on the screen what button to push (right then when you see the message) to start system restore. Or go into Control Panel -> System and you'll find it as a tab in there. Pick a date before when the problem started and restore back to that point.