Are there people who write or wrote on Win9x?
I have a question about the function ReadConsoleInput in console.
For some reason, on Win9x systems, random stutters occur when this function returns. The difference can be up to 10 times (from 30ms to 600ms). This occurs when a key is pressed and held.
Here is the simplest code that behaves like this on Win9x:
SetConsoleMode(hStdInput , ENABLE_WINDOW_INPUT);
iCount = GetTickCount();
iCount = GetTickCount()-iCount;
printf("Slow = %d\r\n", iCount);
if (ir.EventType ==KEY_EVENT && ir.Event.KeyEvent.wVirtualKeyCode==VK_ESCAPE)
P.S. On windows 2000 and above, there are no such problems.
What I have tried:
1) Change ReadConsoleInput to PeekConsoleInput+FlushConsoleInputBuffer
2) Simply add additionally to the beginning and / or to the end of FlushConsoleInputBuffer for additional buffer clearing
3) Set the number of received records not 128, but more or less up to one
4) Added WaitForSingleObject to trigger an event on it
5) Added GetNumberOfConsoleInputEvents to know how many events are in the buffer and exactly how many calls ReadConsoleInput made
6) Changed the creation of the GetStdHandle handle to CreateFile
7) Removed GetTickCount and just watched the result of output lines
Nothing helped. The problem of random input freeze remained
tests were carried out on virtual systems and on a real computer