开发者

Input from console window in game

开发者 https://www.devze.com 2022-12-22 00:10 出处:网络
when you want to input in console window and you hold a key down for a moment, the output is displayed but after a bit of some lag. for example, in any type of common text editors you would see the sa

when you want to input in console window and you hold a key down for a moment, the output is displayed but after a bit of some lag. for example, in any type of common text editors you would see the same result. is there anyway to get a d开发者_StackOverflowirect input for console games? I'm currently using _getch() to read the keyboard input and _kbhit to check if a key was pressed in game loop.


Not very sure about the situation which you are describing, but if I remember correctly, console applications has buffering for keyboard inputs. You may want to flush the keyboard inputs for immediate response.

0

精彩评论

暂无评论...
验证码 换一张
取 消