http://www.handhelds.org/~bugzilla/show_bug.cgi?id=1722

           Summary: xmonobut is too complicated
           Product: xmonobut
           Version: 0.8
          Platform: All
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: xmonobut
        AssignedTo: oe@handhelds.org
        ReportedBy: [EMAIL PROTECTED]


xmonobut is too complicated for end users. It can be easily replaced by the very
simple attached application which takes as arguments the button state and button
number. 

This application can be mapped to a key sequence in keylaunchrc, allowing middle
clicks to be generated when for ex fn+p is pressed (paste). 

/* gcc -g -Wall -o mouseclick mouseclick.c -L /usr/X11R6/lib/ -lX11 -lXtst */
#include <stdio.h>              /* printf() */
#include <stdlib.h>             /* atoi() */
#include <string.h>             /* strcmp() */
#include <X11/Xlib.h>
#include <X11/extensions/XTest.h>

int main(int argc, char *argv[])
{
    int button = 1;

    Display *dpy = XOpenDisplay(NULL);

    if (argc == 3)
        button = atoi(argv[2]);

    if (argc == 1 || button > 3) {
        printf
            ("Usage :\n%s (up|down|updown) (1|2|3)\nExample: \"%s updown 2\"
will generate a middle click\n",
             argv[0], argv[0]);
    } else if (argc == 2) {
        if (strcmp(argv[1], "up"))
            XTestFakeButtonEvent(dpy, 1, True, CurrentTime);
        if (strcmp(argv[1], "down"))
            XTestFakeButtonEvent(dpy, 1, False, CurrentTime);
        if (strcmp(argv[1], "updown"))
            XTestFakeButtonEvent(dpy, 1, True, CurrentTime);
        XTestFakeButtonEvent(dpy, 1, False, CurrentTime);
    } else if (argc == 3) {
        if (strcmp(argv[1], "up"))
            XTestFakeButtonEvent(dpy, button, True, CurrentTime);
        if (strcmp(argv[1], "down"))
            XTestFakeButtonEvent(dpy, button, False, CurrentTime);
        if (strcmp(argv[1], "updown"))
            XTestFakeButtonEvent(dpy, button, True, CurrentTime);
        XTestFakeButtonEvent(dpy, button, False, CurrentTime);
    }
    XCloseDisplay(dpy);
    return 0;
}



------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
_______________________________________________
Oe mailing list
Oe@handhelds.org
https://www.handhelds.org/mailman/listinfo/oe

Reply via email to