Keypress event in C++
问题 I'm currently using GetAsyncKeyState() to detect Keydown events, but then the events will be repeated while you are holding down the key. What would be an easy way to stop the event from repeating? Example If I hold down the key i on my keyboard for a while, I will get an output like this: iiiiiiiiiiiiiiiiiiiiiiiii Instead of this: i I want to force the user to press the key again to trigger the event. 回答1: Avoid using a keyboard related message like WM_KEYDOWN or WM_CHAR to detect a key,