How to create a global hotkey?

k04jg02 at gmail.com k04jg02 at gmail.com
Thu Dec 7 06:53:41 EST 2006


I want to make a Python app that runs in the background, and when a
user hits a key combination, for a function to run. This sounds simple
enough, but all of the keypress detecting libraries I can find count on
you creating a window and then detecting keypresses while that window
has focus. I want my function to execute when the user presses the
hotkey anywhere. I searched the PyGTK documentation and found an old
newsgroup post where someone mentioned the C GTK+ library has it but
PyGTK does not, PyQT showed no results, not sure where else I should
look. I'd be willing to use a library that isn't a windowing toolkit --
I just want to be able to be able to globally detect a keypress. Any
ideas?




More information about the Python-list mailing list