Verify that the keyboard is connected properly to the computer by turning off your computer and then disconnecting and reconnecting the keyboard to the computer.
Ensure that there are no stuck keys on the keyboard. If all keys appear to be ok and you have a standard desktop computer with keyboard, turn the keyboard over and gently hit the back of the keyboard to loosen any dirt or hair that may be stuck in the keyboard.
Try another keyboard on the computer to verify that the keyboard has not gone bad.
Bad PS/2 or AT port
If all of the above solutions are not able to resolve your issue it is likely that the port on the back of the computer may be bad and the motherboard or I/O board may need to be replaced.