win32tty hung NetHack fix

If a Key-down event didn't meet the expected criteria,
the event was ignored in the "peek" loop, but it was
never removed from the input queue either, so it
remained at the top of the queue.

It isn't clear if this fixes the dedicated arrow keys
hanging, but if those were resulting in strange
event values too, it just might.
This commit is contained in:
nethack.allison
2003-11-01 23:56:24 +00:00
parent 67dea0ebe1
commit 5c9c0732cb
3 changed files with 12 additions and 0 deletions

View File

@@ -196,7 +196,11 @@ INPUT_RECORD *ir;
if (ch || iskeypad(scan) || altseq) {
done = 1; /* Stop looking */
retval = 1; /* Found what we sought */
} else {
/* Strange Key event; let's purge it to avoid trouble */
ReadConsoleInput(hConIn,ir,1,&count);
}
}
else if ((ir->EventType == MOUSE_EVENT &&
(ir->Event.MouseEvent.dwButtonState & MOUSEMASK))) {

View File

@@ -230,7 +230,11 @@ INPUT_RECORD *ir;
if (ch || iskeypad(scan) || altseq) {
done = 1; /* Stop looking */
retval = 1; /* Found what we sought */
} else {
/* Strange Key event; let's purge it to avoid trouble */
ReadConsoleInput(hConIn,ir,1,&count);
}
}
else if ((ir->EventType == MOUSE_EVENT &&
(ir->Event.MouseEvent.dwButtonState & MOUSEMASK))) {

View File

@@ -551,7 +551,11 @@ INPUT_RECORD *ir;
if (ch || iskeypad(scan) || altseq) {
done = 1; /* Stop looking */
retval = 1; /* Found what we sought */
} else {
/* Strange Key event; let's purge it to avoid trouble */
ReadConsoleInput(hConIn,ir,1,&count);
}
}
else if ((ir->EventType == MOUSE_EVENT &&
(ir->Event.MouseEvent.dwButtonState & MOUSEMASK))) {