Well,, I might start with replacing the keyboard and mouse
Then maybe scan for malware and viruses (and no, AVG is not good enough)
Malwarebytes, Spybot S&D, and install Microsoft Security Essentials.
If that doesn't work,, then either you are still infected with something strange
You have other hardware problems
May be a driver problem. (doubtful, would be a strange problem, but not saying impossible)
Due to this type of issue,,, I might backup all my data and start over from scratch (Nuke and Reload)
This would be the easiest solution,,, if the problem still happens, then it's got to be a hardware issue of somekind,, however very strange one.
You could try a sfc /scannow
but I kinda doubt it will work,, however,, it won't hurt to try.