if there are no imshow() windows, then waitKey() returns immediately.
Ah, that explains a lot.
if you want a delay in a non-GUI program, use time.sleep(...).
Was monkeying around with time lib (it worked) and the keyboard lib, but could not get that to work mainly because of permissions issues (Debian O/S).
So on this project I have decided to go to an RPi since RPi has the GPIO built in (which should simplify the hand shaking, ie: just use a button) and an RPi was the planned end goal anyways (I just thought that it would be easier to do some of the programming experimentation in my armchair on a laptop).
it’s a weird library. it might interface with the terminal that your program runs in, but it might also interface with some GUI/HID facility that lets it set global hotkeys/hooks.
things like kbhit() and getch() have almost died out, and people over 30 even know of them.