Check if key is pressed using python (a daemon in the background)

Posted by Nazarius Kappertaal on Stack Overflow See other posts from Stack Overflow or by Nazarius Kappertaal
Published on 2009-12-07T10:09:09Z Indexed on 2010/04/04 3:53 UTC
Read the original article Hit count: 306

Filed under:
|
|
|
|

I've created a python script in which an event needs to be executed each time I press the Super (or WinKey) on my keyboard.

How can one achieve this without the python process being "focused" - as it is running in the background waiting for the key to be pressed to execute the event?

I've seen a lot of posts around the web showing me how to read input - but they have all required one to have the process "focused" and none have showed me how to capture the Super (or WinKey) using a python script.

I'm running Ubuntu 9.10.

© Stack Overflow or respective owner

Related posts about python

Related posts about bindings