On Wed, Sep 04, 2002 at 06:02:14PM -0600, S. Anderson wrote:
> On Tue, Sep 03, 2002 at 11:58:51AM +0200, Dominik Vogt wrote:
> > On Thu, Aug 29, 2002 at 06:43:19PM -0600, S. Anderson wrote:
> > > Hi,
> > > I just found a program that might help askers of
> > > FAQ 3.5: You can bind mouse movements to keystrokes, how about mouse
> > > presses?
> > >
> > > http://hoopajoo.net/projects/xautomation.html
> > > Control X from the command line for scripts, and do "visual scraping"
> > > to find things on the screen. The conrol interface allows mouse
> > > movement, clicking, button up/down, key up/down, etc, and uses the XTest
> > > extension so you don't have the annoying problems that xse has when apps
> > > ignore sent events. The visgrep program find images inside of images and
> > > reports the coordinates, allowing progams to find buttons, etc, on the
> > > screen to click on.
> >
> > Could you make a patch for the FAQ?
> >
>
> yes, but I am having a little problem that I have to figure out first.
>
> I define the following, which should work, but when I push F6 for mouse
> up I dont get a mouse up :-(.
> Key F5 A A exec xte 'mousedown 1'
> Key F6 A A exec xte 'mouseup 1'
>
> however If I define this:
> Key F7 A A exec xte 'mousedown 1' && sleep 10 && xte 'mouseup 1'
>
> mouse up and mouse down work fine.
>
...
> Anyways as soon as I figure out what is going on here, I will report
> back.
>
ok, the reason it doesnt work is because fvwm doesn't execute Key
bindings when the mouse is clicked down. Is there a way to bind a
seperate action to a key press and key release? any Ideas?
thanks,
sa
PS, here is stripped down mouse click program, if anyone is interested.
/* gcc -g -Wall -o click click.c -L /usr/X11R6/lib/ -lX11 -lXtst */
#include <string.h> /* strcmp() */
#include <X11/Xlib.h>
#include <X11/extensions/XTest.h>
int main( int argc, char *argv[] ) {
Display *dpy = XOpenDisplay( NULL );
if (argc == 1) {
XTestFakeButtonEvent( dpy, 1, True, CurrentTime );
XTestFakeButtonEvent( dpy, 1, False, CurrentTime );
} else if (argc == 2) {
if ( strcmp(argv[1], "up") )
XTestFakeButtonEvent( dpy, 1, True, CurrentTime );
if ( strcmp(argv[1], "down") )
XTestFakeButtonEvent( dpy, 1, False, CurrentTime );
}
XCloseDisplay( dpy );
return 0;
}
--
Visit the official FVWM web page at <URL: http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to majordomo_at_fvwm.org.
To report problems, send mail to fvwm-owner_at_fvwm.org.
Received on Wed Sep 04 2002 - 22:45:35 BST