Listening for keypress in the background

Mathias Dahl brakjoller at gmail.com
Sat Oct 22 10:21:51 EDT 2005


Peter Hansen <peter at engcorp.com> writes:

>> How can I make it listen for a certain keypress (say, Windows-key +
>> space) in a controlled fashion even when it is not the program having
>> focus?
>> 
>> I need to do this running under GNOME in Mandrake GN/Linux 10.
>
> Search Google for "python keylogger".

Thanks, good idea! The relevant pages I found only link to
Windows-specific keyloggers though.

I just got another idea on a solution for my main problem (invoking my
sleeping app) and that would be to let my window manager execute a
small "invoker" program that would communicate with the sleeping
app. The question is, which is the easiest way to communicate with a
running Python program? Signals? TCP/IP (not really, right?) Pipes?




More information about the Python-list mailing list