views:

21

answers:

1

What's a good way of getting keyboard/mouse events in Python in X? I don't the actual character, just the event that any key or mouse button has been pressed. I'm developing this using Python 2.6 and PyQt4.

On windows pyHook was dead easy to get going, seems harder to get something working on Linux.

I read an old answer about XGrabKeyboard but I haven't found any tutorial for it so I thought i'd ask here if anybody know of a good way to do this. One problem I face is knowing which window to send as an argument to XGrabKeyboard.

EDIT: I found this during my research, can only one grab be active at a time?

A: 

Found the way, if anybody is interested comment with an e-mail or something and i'll send the code.

dutt