Well the min reason for this are:
* Water or Liquid Damage
* Keyboard Ribbon Cable is Loose or Damaged
* Driver or Firmware Issue
* Internal Keyboard Circuit Damage
So Check you keyboard for all of the issue mention above, And also try to use a another keyboard and check does the issue exist, If yes the outdated or corrupted can be the main reason for this so updated your keyboard driver to it's latest version.