#include "seventfilter.h"

#include "mainwindow.h"

SEventFilter::SEventFilter(QObject *parent) : QObject(parent)
{

}


bool SEventFilter::eventFilter(QObject *watched, QEvent *event)
{
    QEvent::Type nType = event->type();
    if( nType == QEvent::MouseButtonPress || nType == QEvent::MouseMove
            || nType == QEvent::MouseButtonDblClick || nType==QEvent::KeyPress ){
        //qDebug() << "Event hijacked in filter";
        //return true;
        MainWindow* pMainWindow = MainWindow::GetMainWindow();
        pMainWindow->ResetScreenSaverTimer();
    }
    return QObject::eventFilter(watched, event);
}
