SAFERHANGUP support for win32tty

win32gui support still needs to be developed.
This commit is contained in:
nethack.allison
2003-09-19 11:22:00 +00:00
parent 22fe9838f3
commit 018123c007
5 changed files with 44 additions and 6 deletions

View File

@@ -258,9 +258,9 @@ DWORD ctrltype;
#ifndef NOSAVEONHANGUP
hangup(0);
#endif
#if 0
clearlocks();
terminate(EXIT_FAILURE);
#if defined(SAFERHANGUP)
CloseHandle(hConIn); /* trigger WAIT_FAILED */
return TRUE;
#endif
default:
return FALSE;
@@ -376,7 +376,9 @@ tgetch()
int mod;
coord cc;
DWORD count;
return pCheckInput(hConIn, &ir, &count, iflags.num_pad, 0, &mod, &cc);
return (program_state.done_hup) ?
'\033' :
pCheckInput(hConIn, &ir, &count, iflags.num_pad, 0, &mod, &cc);
}
int
@@ -386,7 +388,9 @@ int *x, *y, *mod;
int ch;
coord cc;
DWORD count;
ch = pCheckInput(hConIn, &ir, &count, iflags.num_pad, 1, mod, &cc);
ch = (program_state.done_hup) ?
'\033' :
pCheckInput(hConIn, &ir, &count, iflags.num_pad, 1, mod, &cc);
if (!ch) {
*x = cc.x;
*y = cc.y;