gpt4 book ai didi

qt - 检测qt中的箭头键输入

转载 作者:行者123 更新时间:2023-12-04 23:31:49 25 4
gpt4 key购买 nike

我如何检测 qt 中箭头键之一的按下?此外,如果它被最小化,应用程序仍然会检测到它们吗?

最佳答案

How would I detect the pressing of one of the arrow keys in qt?



通过处理 key press event在层次结构中最顶部的小部件中。见 the list of key codes , Qt::Left - Qt::Down 范围是您感兴趣的。

Also, would the application still detect them if it is minimized?



不。只有当它具有键盘焦点时才会检测到它们,而最小化时则不是这种情况。您不能在 Qt 中以跨平台方式设置全局热键。

关于qt - 检测qt中的箭头键输入,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4059348/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com