#include "inputoverwatcher.h" #include #include "soundplayer.h" #include "backlight.h" #include "config.h" InputOverwatcher::InputOverwatcher(QObject *parent) : QObject(parent) { timer.setSingleShot(true); timer.setInterval(5 * 60000); //Default Value is 5min connect(&timer, SIGNAL(timeout()), SLOT(lowerBacklight())); } bool InputOverwatcher::eventFilter(QObject */*watched*/, QEvent *event) { switch (event->type()) { case QEvent::KeyPress: case QEvent::KeyRelease: case QEvent::MouseButtonPress: case QEvent::MouseButtonRelease: case QEvent::MouseMove: Backlight::restore(); timer.start(); break; default: break; } return false; } void InputOverwatcher::setDelay(int mins) { timer.setInterval(mins * 60000); timer.start(); } void InputOverwatcher::lowerBacklight() { Backlight::lower(); }