Results 1 to 3 of 3

Thread: Question about mouse,keyboard event handler?

  1. #1
    Join Date
    Sep 2008
    Location
    New York
    Posts
    90
    Thanks
    13
    Thanked 4 Times in 4 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Question about mouse,keyboard event handler?

    I want to handle global mouse,keyboard event, is there an easy way to do that other than implement event handler for each window (QMainwindow or QDialog)?
    I just want to turn on screen saver after some idle time.
    Thanks in advance!

  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: Question about mouse,keyboard event handler?

    If you just want to handle your application then it is possible by applying an event filter on the application object. If you want to handle the desktop in general, then you need to employ the platform API for that. Please search this forum, there have been some threads about handling such situation.
    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. The following user says thank you to wysota for this useful post:

    Sheng (23rd February 2009)

  4. #3
    Join Date
    Sep 2008
    Location
    Munich
    Posts
    32
    Thanked 8 Times in 6 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Question about mouse,keyboard event handler?

    Actually this is also documented. When you use the assistant and search for event filters you will find some good examples there too.

Similar Threads

  1. Replies: 4
    Last Post: 19th February 2009, 11:10
  2. Is it bad to delete an object during its event handler?
    By codeslicer in forum Qt Programming
    Replies: 3
    Last Post: 30th December 2008, 16:14
  3. Changing default event handler name
    By mabeeh in forum Newbie
    Replies: 1
    Last Post: 21st April 2008, 15:18
  4. event handler
    By mattia in forum Newbie
    Replies: 10
    Last Post: 8th November 2007, 12:54
  5. Message handler question
    By bruccutler in forum Newbie
    Replies: 10
    Last Post: 19th May 2007, 21:26

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.