문제

I'm building a qt app in python. One of the things that I need to do is wait in the background for a key combo like ctrl+b of something like that and then doing something with the currently active window.

Is there a simple library that can do this?

도움이 되었습니까?

해결책

Set global hotkey with Python 2.6

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

Python Global Hotkey

Looks like pyhook or wxPython for windows, and XLib for linux, or maybe keybinder for Gnome.

And if you were only listening for it while your program was active, Qt has something for it:

Respond to application-wide "hotkey" in Qt

Hope that helps.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top