PDA

View Full Version : Question about mouse,keyboard event handler?



Sheng
23rd February 2009, 20:25
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!

wysota
23rd February 2009, 21:45
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.

jryannel
24th February 2009, 07:50
Actually this is also documented. When you use the assistant and search for event filters you will find some good examples there too.