Careful study of the program showed that the functions will cycle properly with a combination of:

while(key_any){wait(1);}
while (!key_any) {wait(1);}

with a

wait_for(...);

in the main function.
Thanks to all


Researcher & clinician. A6, A7, & A8
First computer a Commodore Pet