Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'm looking to create a global hotkey in Python 3.2 for Ubuntu 12.10. That is, my script will run in the background and whenever I press Shift+F4 (for example), no matter what the active window is, the script will do something.

Some resources I have looked at:

Maybe I am too much of a newb (I am a beginner) or I have been looking in the wrong places or for the wrong things, but, I haven't been able to utilize the resources above.

How can I create a global hotkey with Python 3.2 in Ubuntu 12.10. Thanks!

share|improve this question
    
This seems like it'd fit better in a place like stackoverflow. –  Kupiakos Dec 14 '12 at 23:49
    
Suggestion acted on: stackoverflow.com/questions/13887921/python-global-hotkey I wont be offended if moderators delete this thread. Thank you Kupiakos for the heads up. –  onBootQuestioner Dec 14 '12 at 23:58

1 Answer 1

up vote 3 down vote accepted

You can do this at X11/Xlib level. See this question for how to handle global hotkeys correctly in C: Global Hotkey with X11/Xlib

Now you only need some Python Xlib library; python-xlib looks like a reasonable choice.

share|improve this answer
1  
Through these links I eventually arrived at github.com/engla/keybinder It took some compiling to get it going, but I just ran one of the examples, and it worked! Thank You! very neat! –  onBootQuestioner Dec 15 '12 at 0:30

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.