Question

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?

Était-ce utile?

La solution

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.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top