PDA

View Full Version : Catching X Events



nupul
16th April 2006, 11:58
Can I make my app catch an Xevent? How can I achieve this? I wish the app retain its default event catching/processing capability, but I would like to provide custom functionality for 2-3 Xevents.
Do I need to create a separate Event loop for this or can I incorporate it into the existing event loop provided by QApplication?

Thanks

Nupul

dimitri
16th April 2006, 12:06
Try overriding QApplication::x11EventFilter() (http://doc.trolltech.com/4.1/qapplication.html#x11EventFilter).

nupul
16th April 2006, 12:34
Well i know that dimitri, I just am not sure as to how to do it? maybe someone could provide a 3-4 line code snippet/example it'll help me understand better!
;)

Thanks

Nupul

jacek
16th April 2006, 12:43
bool MyApplication::x11EventFilter( XEvent *event )
{
if( isIteresting( event ) ) {
return doSomething( event );
}
return false;
}