Subject: Re: FVWM: Regarding FAQ 3.5

From: Dominik Vogt <[email-masked]>
Date: Tue, 3 Sep 2002 11:58:51 +0200

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?

Bye

Dominik ^_^  ^_^

 --
Dominik Vogt, mail: [email-masked], phone: 0721/91374-382
Schlund + Partner AG, Erbprinzenstr. 4-12, D-76133 Karlsruhe
--
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 [email-masked].
To report problems, send mail to [email-masked].

---

From: "S. Anderson" <[email-masked]>
Date: Wed, 4 Sep 2002 18:02:14 -0600

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

does anyone here have experience with the xtest extension? this program
(xte) basicly uses these two functions:
  XTestFakeButtonEvent( display, button, True, delay );
  XTestFakeButtonEvent( display, button, False, delay );
for mouse up and mouse down events.

Anyways as soon as I figure out what is going on here, I will report
back.

Thanks,
sa

---

From: "S. Anderson" <[email-masked]>
Date: Wed, 4 Sep 2002 21:13:11 -0600

> mouse up and mouse down work fine.
...
> Anyways as soon as I figure out what is going on here, I will report

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 [email-masked].
To report problems, send mail to [email-masked].