PDA

View Full Version : Mouse events without focus



latte
6th February 2007, 11:21
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

wysota
6th February 2007, 13:36
You can grab the mouse (QWidget::grabMouse()), but then no other application will receive mouse events until you release the mouse.