static int getkey_cancel() { switch (getkeypress(500, SINGLE_PL)) { case ESC: case ESC | PLAYER_2: case '\b': return 1; case 'q': exit(0); } return sock_flags & CONN_BROKEN; }
int getkeypress_block(int flags) { int keypress; while (1) { #if TTY_SOCKET && !NO_MENU if (!(flags & 1) && (invit || checkinvit())) return ESC; #endif keypress = getkeypress(1000, flags); if (keypress) break; sleep_msec(55); } return keypress; }