Results 1 to 2 of 2

Thread: Mouse events without focus

  1. #1
    Join Date
    Feb 2007
    Posts
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Mouse events without focus

    Hi,

    I need to know if any mouse buttons were pressed while none of the qt application windows had focus. That is, monitoring the mouse events when using another application, with the qt application minimized. So far, I've been only able to track the mouse inside a qt window. How to do the same globally on the desktop?

    I use Qt4 on Linux with X.Org 7.1 and Gnome 2.16.1.


    Thanks,

    latte

  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: Mouse events without focus

    You can grab the mouse (QWidget::grabMouse()), but then no other application will receive mouse events until you release the mouse.

Similar Threads

  1. Re-implement mouse events of QTextEdit
    By Ankitha Varsha in forum Qt Programming
    Replies: 2
    Last Post: 14th October 2006, 16:55
  2. mouse moving don't produce mouse events
    By coralbird in forum Qt Programming
    Replies: 1
    Last Post: 13th September 2006, 06:13
  3. Replies: 2
    Last Post: 24th July 2006, 18:36
  4. QStackerWidget and mouse events
    By high_flyer in forum Qt Programming
    Replies: 3
    Last Post: 25th April 2006, 19:25
  5. Forwarding mouse events to another widget.
    By yogeshm02 in forum Qt Programming
    Replies: 8
    Last Post: 28th February 2006, 13:25

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.