Come si fà a creare una spece di

do {
....
} while (getch() != 27);

27 = ESC

senza far fermare il Loop?