@@ -0,0 +1,55 @@
1+/*
2+ * Copyright (C) 2014 Canonical, Ltd.
3+ *
4+ * Authors:
5+ * Josh Arenson <joshua.arenson@canonical.com>
6+ *
7+ * This program is free software; you can redistribute it and/or modify
8+ * it under the terms of the GNU General Public License as published by
9+ * the Free Software Foundation; version 3.
10+ *
11+ * This program is distributed in the hope that it will be useful,
12+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
13+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+ * GNU General Public License for more details.
15+ *
16+ * You should have received a copy of the GNU General Public License
17+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
18+ */
19+
20+import QtQuick 2.0
21+/*!
22+ \brief A filter for the physical keys on the device
23+
24+ A filter to handle events triggered by pressing physical keys on a device.
25+ Keys included are
26+ * Volume Increase
27+ * Volume Decrease
28+ * Power
29+
30+ This allows for handling the following events
31+ * Volume Decreases/Increases
32+ * Screenshots
33+
34+*/
35+
36+QtObject {
37+ id: root
38+
39+ signal volumeUpPressed()
40+ signal volumeDownPressed()
41+ signal screenshotPressed()
42+
43+ property bool aVolumeKeyWasReleased: true
44+ property bool volumeDownKeyPressed: false
45+ property bool volumeUpKeyPressed: false
46+
47+ function onKeyPressed(key) {
48+ switch(key) {
49+ case Qt.Key_VolumeDown:
50+ volumeDownKeyPressed = true;
51+ case Qt.Key_VolumeUp:
52+ volumeUpKeyPressed = true;
53+ }
54+ }
55+}