On Monday, 9 January 2017 at 18:09:21 UTC, Ivan Kazmenko wrote:
That's because special keys actually put two characters in the buffer, right? Otherwise, using that buffer alone, you won't be able to distinguish, for example, arrow keys from capital Latin letters with the same codes.

No, that duplicate problem occurs even on normal keys, if I press "a" it shows "aa", and through the WinDBG, I saw the kbhit() was always true 2x after a key is pressed.

And I think the kbhit() (Like in many other libraries) would only return true, when a key is pressed.

I even tried to delay using sleep() after a keystroke, but it still duplicates after I press any key.

L.

Reply via email to