Results 1 to 3 of 3

Thread: Generating Mouse Clicks

  1. #1
    Join Date
    Jul 2009
    Posts
    4
    Qt products
    Qt4
    Platforms
    Unix/X11

    Question Generating Mouse Clicks

    Hello, I am developing a small application that lets your mobile phone act as a touchpad. I am able to move the desktop cursor with QCursor::setPos(), but I can't find a way to simulate mouse button presses so that any application can receive them.

    All of the Qt functions I have found only generate presses for the Qt application itself, and it seems they can't be used to create a general-purpose cursor. Say, something that could click on a desktop icon or a button in Open Office.

    Does anyone know how to solve this problem?

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Generating Mouse Clicks

    You would have to dig into the native API, with registering global hooks for mouse and keyboard and you would have to send such events using X11 calls. Remember that when your application looses focus and/or activation (i.e. upon clicking with a mouse somewhere outside the application), input events are stopped being delivered to the application. You would have to grab the mouse and that's probably not what you want because then you won't be able to change the active application.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Jul 2009
    Posts
    4
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Generating Mouse Clicks

    That's what I was afraid of. :P

    I'll take a look at the X11 programming and see what I can do with it.

Similar Threads

  1. Changing mouse grabbing behavior?
    By FlyingSaucrDude in forum Qt Programming
    Replies: 0
    Last Post: 11th November 2008, 02:04
  2. How to handle double clicks with mouse?
    By Morea in forum Qt Programming
    Replies: 1
    Last Post: 14th January 2007, 13:01
  3. traversing tree using mouse clicks
    By krishna.bv in forum Qt Programming
    Replies: 3
    Last Post: 22nd December 2006, 10:15
  4. Replies: 3
    Last Post: 29th August 2006, 16:07
  5. Replies: 2
    Last Post: 24th July 2006, 19:36

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.