Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

python qt wait in background for hotkey

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?

like image 804
qwertymk Avatar asked Feb 18 '26 19:02

qwertymk


1 Answers

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.

like image 162
phyatt Avatar answered Feb 20 '26 08:02

phyatt