PDA

View Full Version : Control the mouse with Qt and Webcam?



rdelgado
11th April 2011, 17:23
Hi,

I am wondering if it is possible to control mouse events (clicks, drags) outside a Qt Widget or App. I mean, can I use it to make clicks in my Linux desktop, open other applications, use paint, etc; without actually using the mouse (I want to control mouse cursor using a webcam and some markers).
Do you think this is possible with Qt?

Thank you very much!

high_flyer
11th April 2011, 19:55
If you need to control your mouse with the cam in your application then the answer is yes.
If you want it for the window manager level, then no.
For the later you will basically need to write a driver that will replace the normal mouse device driver.

rdelgado
11th April 2011, 20:23
Thanks for your answer.
I've manage to control the mouse with cam already, now I want to do clicks with it.
Do you think maybe I could do it using the Xlib.h?

high_flyer
12th April 2011, 10:08
There is no difference between moving and clicking apart to the type of the event, you can implement clicks the same way you implemented move.