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
+13
View File
@@ -25,6 +25,8 @@ static char author[] = "The NetHack Development Team";
extern HANDLE hConIn;
extern INPUT_RECORD ir;
extern struct sinfo program_state;
char dllname[512];
char *shortdllname;
@@ -256,9 +258,20 @@ int mode;
int *mod;
coord *cc;
{
#if defined(SAFERHANGUP)
DWORD dwWait;
#endif
int ch;
boolean valid = 0, done = 0;
while (!done) {
#if defined(SAFERHANGUP)
dwWait = WaitForSingleObjectEx(
hConIn, // event object to wait for
INFINITE, // waits indefinitely
TRUE); // alertable wait enabled
if (dwWait == WAIT_FAILED) return '\033';
#endif
ReadConsoleInput(hConIn,ir,1,count);
if (mode == 0) {
if ((ir->EventType == KEY_EVENT) && ir->Event.KeyEvent.bKeyDown) {