First, make sure that the keyboard is correctly connected to the computer, and that no more than three ADB devices are connected at one time. If the behavior remains, reset the parameter RAM (PRAM) by restarting and holding down the command, option, P, and R keys. Parameter RAM stores settings that can affect the performance of the keyboard. You should also open the Keyboard control panel and set the Key Repeaat Rate settings to their slowest levels and then back to the desired settings.
If none of these work, the logic board of this computer may be damaged. An Authorized Apple Service Provider can run diagnostics to determine if replacement is necessary.