How to handle keypress events in a Qt console application?(如何在 Qt 控制台应用程序中处理按键事件?)
问题描述
例如,当您按Esc"时,应用程序结束.
For example, that when you press "Esc", the application ends.
推荐答案
Qt 不处理控制台事件,它只能从控制台读取
终止的行.
Qt doesn't handle console events, it can just read
-terminated lines from the console.
您需要使用本机 API 或其他库(诅咒).
You need to use native APIs or other libraries (curses).
这篇关于如何在 Qt 控制台应用程序中处理按键事件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!