1 #include "pirapplication.h"
10 PIRApplication::PIRApplication(
13 : QApplication(argc, argv),
19 void PIRApplication::setupRockerSwitch(QWidget *window)
21 // free the rocker switch from the volume controls:
22 unsigned long val = 1;
24 Atom atom = XInternAtom(QX11Info::display(), "_HILDON_ZOOM_KEY_ATOM", 0);
33 (unsigned char *) &val,
38 bool PIRApplication::x11EventFilter(
41 // Return true means we will consume the event here; return false means
42 // letting the event continue to be passed up the chain.
44 if (event->type == KeyPress)
46 // Function key 7 (keycode 73) or "Zoom Out" button will go up.
47 // Function key 8 (keycode 74) or "Zoom In" button will go down.
49 event->xkey.keycode == 73 ||
50 event->xkey.keycode == QKeySequence::ZoomOut)
54 changingKeyset = true;
55 QTimer::singleShot(500, this, SLOT(finishChangingKeyset()));
56 emit decreaseRockerPressed();
61 event->xkey.keycode == 74 ||
62 event->xkey.keycode == QKeySequence::ZoomIn)
66 changingKeyset = true;
67 QTimer::singleShot(500, this, SLOT(finishChangingKeyset()));
68 emit increaseRockerPressed();
78 void PIRApplication::finishChangingKeyset()
80 changingKeyset = false;