summaryrefslogtreecommitdiffstats
path: root/src/gui/s60framework/qs60mainappui.cpp
diff options
context:
space:
mode:
authorHonglei Zhang <honglei.zhang@nokia.com>2011-07-03 20:22:41 +0300
committerHonglei Zhang <honglei.zhang@nokia.com>2011-07-03 20:22:41 +0300
commit3b6a61953bcd319a6df55d66116ce92f7525ec00 (patch)
tree4642541a9ab510546b1bc77bd4c0790a8eaedfec /src/gui/s60framework/qs60mainappui.cpp
parent2d930fdabccad6bfbbd0075610a302027c8d499b (diff)
Enable key capture and RemCon interfaces for Qt apps on Symbian
The volume and other multimedia keys in Symbian are not delivered through the normal key events, but through a seperate API called CRemConCoreApiTarget. The commit implements the feature that multimedia key events are delivered via normal key events to Qt Application, if the Qt::AA_CaptureMultimediaKeys is defined. Task-number: QTBUG-4415 Reviewed-by: Sami Merila Reviewed-by: Miikka Heikkinen
Diffstat (limited to 'src/gui/s60framework/qs60mainappui.cpp')
-rw-r--r--src/gui/s60framework/qs60mainappui.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/gui/s60framework/qs60mainappui.cpp b/src/gui/s60framework/qs60mainappui.cpp
index bfd18256e1..f120287012 100644
--- a/src/gui/s60framework/qs60mainappui.cpp
+++ b/src/gui/s60framework/qs60mainappui.cpp
@@ -59,6 +59,7 @@
#include <private/qmenu_p.h>
#include <private/qt_s60_p.h>
#include <qdebug.h>
+#include "qs60keycapture_p.h"
//Animated wallpapers in Qt applications are not supported.
const TInt KAknDisableAnimationBackground = 0x02000000;
@@ -66,6 +67,20 @@ const TInt KAknSingleClickCompatible = 0x01000000;
QT_BEGIN_NAMESPACE
+static QS60KeyCapture *qt_S60KeyCapture = 0;
+
+static void installS60KeyCapture(CCoeEnv *env)
+{
+ if (QApplication::testAttribute(Qt::AA_CaptureMultimediaKeys))
+ qt_S60KeyCapture = new QS60KeyCapture(env);
+}
+
+static void removeS60KeyCapture()
+{
+ delete qt_S60KeyCapture;
+ qt_S60KeyCapture = 0;
+}
+
/*!
\class QS60MainAppUi
\since 4.6
@@ -127,6 +142,7 @@ void QS60MainAppUi::ConstructL()
}
#endif
BaseConstructL(flags);
+ installS60KeyCapture(iCoeEnv);
}
/*!
@@ -142,6 +158,7 @@ QS60MainAppUi::QS60MainAppUi()
*/
QS60MainAppUi::~QS60MainAppUi()
{
+ removeS60KeyCapture();
}
/*!