Capturing global input?

N

nomihn0

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.
 
S

sturlamolden

I'd like to accept mouse gestures and keyboard shortcuts as input to a
program.

It depends on which GUI toolkit you use. Look in the wxPython, PyGTK,
tkinter or pygame documentation.

The nature of this program requires that these commands be
issued regardless of the currently active window.

As in keylogger?
 
M

MonkeeSage

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
 
M

MonkeeSage

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

Ps. I saw you said you didn't want Jython, but I can't see why.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top