Hi all,

I am attempting to write a Qt application that displays a small window for a short period of time in certain intervals. I would also like to detect any motion on the mouse both when my window is shown and when it is not.

I have inherited QApplication and overloaded x11EventFilter which from what I have read should receive ALL XEvents and allow me to detect motion on the mouse cursor:

Qt Code:
  1. bool OSDApp::x11EventFilter(XEvent *e)
  2. {
  3. qDebug("Got an event!\n");
  4. if (e->type == MotionNotify) {
  5. if ( sendMouseEvent() )
  6. qDebug("Sent Motion Event...\n");
  7. else
  8. qDebug("Error Sending Motion Event...\n");
  9. }
  10.  
  11. return QApplication::x11EventFilter(e);
  12. }
To copy to clipboard, switch view to plain text mode 

Unfortunately, after executing my application I am unable to see any activity from x11EventFilter. This leads me to believe I will only see activity in x11EventFilter if I show a window and mouse activity happens within that window. Is this the case? Or am I missing something entirely. If this is indeed the case, does anybody know a way in which I can receive all motion events in Qt?

Thanks!