Given how Windows gets dinged up over time, you can try using HP's own set of drivers, BIOS defaults and then a total wipe and restore to factory as a last resort. If the problem remains then it's a hardware issue.
Bob
I have an HP desktop with Windows 7. Sometimes when my PC is sleeping I press the escape button and the computer wakes up but any key I press after that like typing my password in, or if take the password requirement away, no key for letters or numbers will work either on the browser, excel, or word. The mouse does continue to work. I have to restart the computer by engaging the power button to get the keyboard to work again. Anyone have any ideas on what the problem could be?

Chowhound
Comic Vine
GameFAQs
GameSpot
Giant Bomb
TechRepublic