Re: Simulating a mouse click



On Wed, 2003-05-21 at 13:02, ecos wrote:
> On Wednesday 21 May 2003 08:56, Bosko Andjelkovic wrote:
> > Well, I am trying to make a GNOME version of this win32 program:
> > http://home.planet.nl/~andje000/ac.html
> >
> > I need to send a mouse click signal to the window beneath the cursor. In
> > the win32 API there is a function called mouse_event which does exactly
> > this, but I can't seem to find such a function in X so I need to do this
> > 'manually' (i.e. detect the window under the cursor and then send a
> > mouse click signal to it). I hope that this answers your question about
> > what I am doing.
> 
> I'm sorry - but my next question, is why?  What good is it?
> 
> What it really appears you want to do is intercept as well as send events for 
> the X11 server.  This may, or may not be, within the scope of GTK - I cannot 
> say because I would never have cause for doing this since use GTK purely to 
> produce front ends to my programs.
> 
> I know X11 can do what you want, but programming in X is seriously not fun 
> which is why we have GTK, QT, KDE, Motiff, and a few dozen more API's - so 
> you don't have to deal with the nightmare of X11.
> > Bosko

Oh come on.  He already told you what he's trying to do.  What more do
you want from him?  If you don't know how to do it, then leave the man
alone.  There are plenty of very good reasons to simulate mouse clicks
and other events.  A macro recording/playback system is one such use. 
An accessibility framework that allows you to manipulate the mouse
cursor from the keyboard is another.

In fact, we have such an accessibility framework.  However, I don't know
if it actually creates the X events or just the GTK signals that result
from the X events.  There seems to be some ability to do this with the
GdkEvent API:

http://developer.gnome.org/doc/API/2.0/gdk/gdk-Events.html

However, I don't know if this works with X windows that aren't managed
by GDK.

--
Shaun




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]