Sounds like a virus... the keyboard driver can get infected and stop working... seen it happen and answered some similar issues here.
You need to scan with the antivirus and follow with Malwarebytes Antimalware, and if necessary after that, reinstall the keyboard drivers or replace it with the Microsoft IntelliType keyboard driver.
If still nothing, the motherboard may be damaged. The difference between infection and motherboard damaged can be identified; if the keyboard leds light up when the BIOS posts, infection is likely.. and if leds don't light up, a motherboard issue is more likely. Also run the computer in Safe Mode to help ID the issue. Infections are disabled in Safe Mode. Press F8 right as the BIOS post ends and the screen...