X.Org crash when trying to use XWarpPointer

Eeri Kask Eeri.Kask at inf.tu-dresden.de
Thu Jun 25 02:31:32 PDT 2009


BlackLight wrote:
> int setPointerPos (int x, int y)  {
>        Display *disp;
>        Window root;
>        Window father, child;
>        int screen;
>        int width = 1024; int height = 768;
> 
>        if (!(disp = XOpenDisplay(NULL)))
>                return -1;
> 
>        screen = DefaultScreen(disp);
>        root = RootWindow(disp,screen);
> 
>        if (!XWarpPointer(disp, father, child, 0, 0, width, height, x, y))
>                return -1;
> 
>        XCloseDisplay(disp);
>        return 0;
> }
> 
> and this is the problem I get when a face is detected and I try to
> move the cursor:


Aside of setting farther and child to root (and width, height to
zero), why not use XTestFakeMotionEvent()?

Extending your application by eye blink detector you could cleanly
implement mouse buttons by XTestFakeButtonEvent(), or even create a
complete "air keyboard".

Greetings,

    Eeri Kask




More information about the xorg mailing list