【问题标题】:python qt wait in background for hotkeypython qt在后台等待热键
【发布时间】:2013-05-28 01:28:02
【问题描述】:

我正在用 python 构建一个 qt 应用程序。我需要做的一件事是在后台等待类似 ctrl+b 这样的组合键,然后对当前活动的窗口进行操作。

有没有一个简单的库可以做到这一点?

【问题讨论】:

    标签: python linux windows qt global-hotkey


    【解决方案1】:

    Set global hotkey with Python 2.6

    http://bytes.com/topic/python/answers/574341-how-create-global-hotkey

    Python Global Hotkey

    看起来像 Windows 的 pyhook 或 wxPython,Linux 的 XLib,或者 Gnome 的 keybinder。

    如果您只是在程序处于活动状态时收听它,Qt 可以为它提供一些东西:

    Respond to application-wide "hotkey" in Qt

    希望对您有所帮助。

    【讨论】:

      猜你喜欢
      • 2018-08-01
      • 1970-01-01
      • 2020-09-04
      • 2018-01-30
      • 2016-10-15
      • 1970-01-01
      • 2018-10-30
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多