长时间阅读,第一次海报:D
Long time reader, first time poster :D
我在尝试读取输入同时输出时遇到问题。我需要一个服务器控制台为我的游戏,可以接收输入,而不是搞乱缓冲区。
I'm having issues trying to read input whilst outputting at the same time. I need a server console for my game which can receive input whilst outputting and not mess up the buffer.
例如,我在输入Hello world过程,玩家死亡,杀死等输出到控制台,这将导致类似:
For example, I'm typing "Hello world" and in the process, player deaths, kills, etc. are being outputted into the console, which would result in something like:
* world
Hello *Player killed Player2*world
提前感谢
推荐答案而不是直接写输出到控制台,为什么不产生一个GUI窗口?
Instead of writing output directly to the console, why not spawn a GUI window?
然后,只有一个区域输出指向,在底部,您可以在其中键入命令。 Kinda喜欢irc客户端的外观。
Then, just have one area where output is directed, and a separate input area at the bottom where you can type commands. Kinda like how an irc client would look.
如果它只是控制台,我建议使用像ncurses(或PDCurses)来创建一个基于文本的界面。
If it has to be console only, I would suggest using something like ncurses (or PDCurses) to create a text based interface.
更多推荐
异步Windows控制台输入,同时输出
发布评论