If the USB keyboard gives the same problem you have malware.
It's not malware just because it isn't the first thing you think to change. Instead of admitting you don't know the solution you're actually making things worse with misinformation.
There are system problems that can cause this - bad BIOS, some keyboard combinations will make the top row of letters type as numbers, etc.
For those like me who occasionally hit this problem (different keyboards, USB ports, even safe booting doesn't fix it), try hitting the key combination F-Lock and um Lock at the same time. Another suggestion was to hold down both Shift keys (not Caps Lock) for a few seconds.
Since my keyboard just started working again mysteriously, I can't say if they work yet.