Results 1 to 4 of 4

Thread: Control the mouse with Qt and Webcam?

  1. #1
    Join Date
    Nov 2009
    Posts
    29
    Thanks
    9
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Control the mouse with Qt and Webcam?

    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!

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Control the mouse with Qt and Webcam?

    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.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  3. #3
    Join Date
    Nov 2009
    Posts
    29
    Thanks
    9
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Control the mouse with Qt and Webcam?

    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?

  4. #4
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Control the mouse with Qt and Webcam?

    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.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

Similar Threads

  1. Replies: 0
    Last Post: 16th December 2009, 09:45
  2. Mouse move inside control/Widget
    By squidge in forum Newbie
    Replies: 0
    Last Post: 27th September 2009, 16:56
  3. Control WebCam with Qt
    By lixo1 in forum Qt Programming
    Replies: 4
    Last Post: 22nd May 2009, 09:21
  4. Replies: 2
    Last Post: 4th August 2008, 07:44
  5. use Webcam
    By sabeesh in forum Qt Programming
    Replies: 1
    Last Post: 21st August 2007, 07:52

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.