BIOS continuously pressing a key internally filling keyboard buffer
The internal keyboard controller may be faulty, or the keyboard connector may be damaged or shorted.
This behavior is unlikely to be caused by software, and since you stated that the laptop keyboard is entirely nonfunctional but an external keyboard works to an extent, I would suspect that the laptop's internal keyboard electronics are at fault. The parts in question are probably on the motherboard itself.