Capturing global input?

MonkeeSage MonkeeSage at gmail.com
Thu Dec 6 22:16:10 EST 2007


On Dec 6, 3:51 pm, nomihn0 <nomi... at gmail.com> wrote:
> I'd like to accept mouse gestures and keyboard shortcuts as input to a
> program. The nature of this program requires that these commands be
> issued regardless of the currently active window. Here's the rub: I
> need a platform-independent solution.
>
> Java supports with its MouseInfo class, but I'd like a Python
> equivalent without turning to Jython.  Is this possible?
>
> Thanks in advance.

There is no cross-platform way to do that. You have to use whatever
interface the OS provides for that (e.g., Xlib events for X11). You
could probably write a platform independent way by testing the OS and
using the appropriate apis for that OS (assuming that there are python
modules like python-xlib for other OS). I wonder why you'd want to
though, if Java already provides a solution? If you don't want to muck
with Java syntax, what about Jython?

Regards,
Jordan



More information about the Python-list mailing list