I think a rather radical solution is to try and connect a different keyboard and see if the issue still stands..if it turns out to be a software and not a hardware problem..then try reinstalling your operating system.
Hope this helps