while (key_a) wait(1);

This wait till you release the key a