[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freedesktop-xorg
Subject:    Re: X.Org crash when trying to use XWarpPointer
From:       Eeri Kask <Eeri.Kask () inf ! tu-dresden ! de>
Date:       2009-06-25 9:31:32
Message-ID: 4A4343F4.9060901 () inf ! tu-dresden ! de
[Download RAW message or body]

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

_______________________________________________
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic