mirror of
https://github.com/moparisthebest/curl
synced 2024-11-13 13:05:03 -05:00
sockfilt.c: ignore non-key-events and continue waiting for input
This commit is contained in:
parent
eb01947e1d
commit
fe1c0176c1
@ -515,15 +515,24 @@ static void lograw(unsigned char *buffer, ssize_t len)
|
|||||||
*/
|
*/
|
||||||
static DWORD WINAPI select_ws_stdin_wait_thread(LPVOID lpParameter)
|
static DWORD WINAPI select_ws_stdin_wait_thread(LPVOID lpParameter)
|
||||||
{
|
{
|
||||||
|
INPUT_RECORD inputrecord;
|
||||||
HANDLE handle;
|
HANDLE handle;
|
||||||
DWORD mode;
|
DWORD length;
|
||||||
|
|
||||||
handle = (HANDLE) lpParameter;
|
handle = (HANDLE) lpParameter;
|
||||||
|
|
||||||
if(GetConsoleMode(handle, &mode))
|
if(GetConsoleMode(handle, &length)) {
|
||||||
WaitForSingleObjectEx(handle, INFINITE, FALSE);
|
while(WaitForSingleObjectEx(handle, INFINITE, FALSE) == WAIT_OBJECT_0) {
|
||||||
|
if(PeekConsoleInput(handle, &inputrecord, 1, &length)) {
|
||||||
|
if(length == 1 && inputrecord.EventType != KEY_EVENT)
|
||||||
|
ReadConsoleInput(handle, &inputrecord, 1, &length);
|
||||||
else
|
else
|
||||||
ReadFile(handle, NULL, 0, &mode, NULL);
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
ReadFile(handle, NULL, 0, &length, NULL);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user