[comp.windows.x] Program to send events to arbitrary application?

slewis@cbnewsm.att.com (scott.b.lewis) (06/26/91)

A (simple?) question for all of you Xperts:

Is there a program out there that will send an arbitrary event 
(e.g. a "fake" mouse button press) to an arbitrary
window?  I would like to send an arbitrary event to
a window from a shell, and have that event processed
by the program as if it had come to that window 
normally.  Preferably, the window and event would be 
parameters to such a program.

This is fairly close to the notion of journalling, so 
perhaps there is a good journalling program out there that
will work?  I've seen the NeWS journalling program, and
it comes close, but does not have quite enough flexibility.

BTW, I'm using OpenWindows 2.0 on a Sun Sparc 1+.

Please respond via email to:  slewis@hound.att.com.

Scott

Please forgive if this is well-known...I looked in the faq...

mouse@lightning.mcrcim.mcgill.EDU (der Mouse) (06/26/91)

> Is there a program out there that will send an arbitrary event (e.g.
> a "fake" mouse button press) to an arbitrary window?

Look at XSendEvent; it's about the closest thing the core protocol
provides.

> I would like to send an arbitrary event to a window from a shell, and
> have that event processed by the program as if it had come to that
> window normally.

I don't know of any wrapper program, though it shouldn't be hard to
write one.

If you use XSendEvent, note that the receiving client can tell that the
event is a fake event.  Some programs (eg xterm) can be set to ignore
such events; some of them may do this by default (offhand, I don't know
whether xterm is such a one).  Other programs ignore this bit and
process the event normally....

I think there is an extension (I forget the name, though rummaging in
my memory turns up "xtrap" as being possibly significant) which is
designed specifically to do journalling.  If this is right, and you can
find a copy, that should be capable of doing what you want.

> BTW, I'm using OpenWindows 2.0 on a Sun Sparc 1+.

You may find you have to switch to the MIT server (which will not
render most OW clients useless, though a few that use NeWS will of
course break).  The reason for this is that if you have to install an
extension, you'll need source to your server.

					der Mouse

			old: mcgill-vision!mouse
			new: mouse@larry.mcrcim.mcgill.edu

rkz@scrc.symbolics.COM (Randolph K. Zeitvogel) (06/26/91)

   Date: 25 Jun 91 19:22:18 GMT
   From: slewis@cbnewsm.att.com (scott.b.lewis)
   Organization: AT&T Bell Laboratories
   Newsgroups: comp.windows.x
   Sender: xpert-request@expo.lcs.mit.edu

   A (simple?) question for all of you Xperts:

   Is there a program out there that will send an arbitrary event 
   (e.g. a "fake" mouse button press) to an arbitrary
   window?  I would like to send an arbitrary event to
   a window from a shell, and have that event processed
   by the program as if it had come to that window 
   normally.  Preferably, the window and event would be 
   parameters to such a program.

I am interested in this too. Could you forward the responses
that you receive to me.

Thanks

Randy Zeitvogel			8 New England Executive Park
Symbolics MACSYMA division	Burlington, MA 01803
Internet:  rkz@symbolics.com	Phone: (617) 221-1250