Maybe thinking your keyboard driver is kinda micked up so i would re-instal it by doing this
Right click my computer and select manage
click on device manager and select keyboard
right click and select uninstal
reboot the pc and then the driver will be re-installed at reboot and hopefully that will be sorted.
Is it the keyboard that you got with the pc? or have you upgraded it recently? is it wired or wireless
I have the Logitech MX1000 Laser mouse and Keyboard combo and when the keyboard batteries run low i get the same symptoms so if its a wireless then it might solve it, however if not try the above fix.