You mention you tried the keyboard on your friend's Windows7 laptop and it worked; what version of Windows are you running on your laptop? Also, make/model of your laptop would be helpful.
Based on your description of the problem, it sounds like it could be either software (such as Windows file corruption) or a Virus. But, if you run a System Restore, which I would try after your complete a thorough Virus scan, make sure you back up all your personal data to an external hard drive, flash drive, or cd/dvd discs. It's certainly possible that you have corrupted your Registry. There are only 2 tools that we Techs generally endorse for Registry cleanup, and CCleaner is one of them. Though in my opinion those auto-Registry cleanup...