Control mouse position and clicking

G

Glich

hi, how can I, control mouse position and clicking from python?

I want to interact with a flash application inside firefox. thanks.

ps: I am not using windows.
 
P

Paul McGuire

hi, how can I, control mouse position and clicking from python?

I want to interact with a flash application inside firefox. thanks.

ps: I am not using windows.

Ooof, I was about to suggest using pywinauto, because I was able to
interact with a flash app with that module, until I saw your p.s.

So even though you are not using windows and can't use this technique
directly, I am just posting to give you some encouragement that, at
least theoretically, such a thing can be done.

-- Paul
 
L

Laszlo Nagy

Paul said:
Ooof, I was about to suggest using pywinauto, because I was able to
interact with a flash app with that module, until I saw your p.s.

So even though you are not using windows and can't use this technique
directly, I am just posting to give you some encouragement that, at
least theoretically, such a thing can be done.
It is for sure - VNC server does that.

It might be a (very bad) solution to install a VNC server on one
computer, and controll it from Windows using a VNC client. (It works but
it was a joke, of course...)

Laszlo
 
B

Bjoern Schliessmann

Glich said:
hi, how can I, control mouse position and clicking from python?

I want to interact with a flash application inside firefox.
thanks.

ps: I am not using windows.

On Mac, IIRC, you can't.

Regards,


Björn
 
T

Tony

On Nov 28, 9:33 pm, Bjoern Schliessmann <usenet-
(e-mail address removed)> wrote:
snip
On Mac, IIRC, you can't.

Regards,

well, you can do it from Java, (the Robot class, as I recall), so you
should be able to do it in Jython, which is a Python implementation,
so....

Tony
 
T

Tony

On Nov 28, 9:33 pm, Bjoern Schliessmann <usenet-
(e-mail address removed)> wrote:
snip
On Mac, IIRC, you can't.

Regards,

well, you can do it from Java, (the Robot class, as I recall), so you
should be able to do it in Jython, which is a Python implementation,
so....

Tony
 
B

Bjoern Schliessmann

Tony wrote:

[place mouse programmatically]
well, you can do it from Java,

Are you absolutely positive? IIRC the Mac UI guidelines forbid such
things, and there's no API function for it; so Java wouldn't have
any chance.

Regards,


Björn
 
R

Robert Kern

Bjoern said:
Tony wrote:

[place mouse programmatically]
well, you can do it from Java,

Are you absolutely positive? IIRC the Mac UI guidelines forbid such
things, and there's no API function for it; so Java wouldn't have
any chance.

There is an API for it. Not all programs have GUIs so the HIG doesn't restrict
the scope of the OS's APIs. Otherwise, one couldn't write assistive software or
userland drivers for new hardware. How do you think ControllerMate does what it
does?

http://www.orderedbytes.com/controllermate/

In 10.4 and up, the recommended API is to use CGEventCreateMouseEvent and
CGEventPost. Before that, there was CGPostMouseEvent back to 10.0, but there are
situations where that can lock things up, so it is deprecated and not
recommended for use.


http://developer.apple.com/document...artzEventServicesRef/Reference/reference.html

--
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
that is made terrible by our own mad attempt to interpret it as though it had
an underlying truth."
-- Umberto Eco
 
R

Robert Kern

Glich said:
hi, how can I, control mouse position and clicking from python?

I want to interact with a flash application inside firefox. thanks.

ps: I am not using windows.

I've use the external program xte with some success if you don't send it too
many events too quickly. I start it using subprocess and feed it commands. On Ubuntu

sudo apt-get install xautomation

It uses the XTest extension for X11 to send mouse events to the system. One
could probably easily wrap the xlib API for it using ctypes so you wouldn't have
to bother with an external program.

--
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
that is made terrible by our own mad attempt to interpret it as though it had
an underlying truth."
-- Umberto Eco
 
B

Bjoern Schliessmann

Robert said:
There is an API for it. Not all programs have GUIs so the HIG
doesn't restrict the scope of the OS's APIs.

Ah, okay. In (IIRC) wxPython docs, I read differently.

Regards,


Björn
 

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,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top