damage to a computer is an all depends on plugging in PS2 keyboard or mouse. i’ve seen it happen though i’ve seen it not happen more. a USB could be used with a damaged PS2 port if needed.
and USB keyboards and mice don’t activate early. in a dual boot machine i have the GRUB doesn’t respond to USB and need a PS2 which i just leave connected..
If you plug in a PS/2 or AT keyboard connector right, nothing bad should happen. But it’s easy to have it aimed a little wrong and short out a tiny surfce mount fuse on the MB. (ATs especially, but I’ve seen it on PS/2 boards.)
I fixed these MBs back in the day by desoldering the fuse and replacing it with one from a deader MB.
You have to be a bit more aggressive to do damage to USB port this way. But they go bad with surprising frequency due to faults in cables and whatnot. Hence the advice to try another USB port.
Well, to be pedantic, on a number of computers in a simple BASIC program, it couldn’t just be any old key. For example, on a C64, pressing the Commodore key, the shift, the caps lock, or control (and perhaps restore and, well, run-stop for obvious reasons) would still equal a null string unless it was pressed in combination with another key.
To be even more pedantic, on the C64 you would use the GET command, as in
50 GET B$ : IF B$ = "" THEN 50
and that didn’t actually wait for a keypress, it pulled the next available character from the keyboard buffer, which could already have keystrokes waiting to be read. It was common practice to clear the keyboard buffer first, with
40 GET B$ : IF B$<>"" THEN 40
just in case the user had “typed ahead”, to make sure the program would really pause.
ETA: Which reminds me. You can also do POKE 198,0 : WAIT 198,1 to clear the buffer and wait for a keypress. Basically, they correspond to line 40 and 50 quoted.
A project I worked on several years ago had user documentation that was commonly referred to as “The Duck Book”, because the developer who wrote the documentation had that picture on the cover with the caption “Before you do this, READ THIS!”