qtmobileextensions/examples/keycaptureex/keycapturetestapp.cpp
changeset 19 46686fb6258c
parent 15 1f895d8a5b2b
child 27 6bfad47013df
--- a/qtmobileextensions/examples/keycaptureex/keycapturetestapp.cpp	Tue Jul 06 15:12:50 2010 +0300
+++ b/qtmobileextensions/examples/keycaptureex/keycapturetestapp.cpp	Wed Aug 18 10:38:12 2010 +0300
@@ -39,7 +39,7 @@
 #include <QMenuBar>
 #include <QAction>
 #include <QEvent>
-#include <XQRemConKeyEvent>
+
 
 #include <QFont>
 
@@ -261,7 +261,12 @@
 {
     if (enable) {
         addTextLine("Remote Basic enabled");
-        mKeyCapture->captureRemoteKeys(XQKeyCapture::CaptureBasic);
+        QFlags<XQKeyCapture::CapturingFlag> flags = XQKeyCapture::CaptureNone;
+        if (toggleRemoteExtEvents->isChecked())
+            flags = XQKeyCapture::CaptureEnableRemoteExtEvents;
+        if (toggleRemoteCallHandlingEx->isChecked())
+            flags |= XQKeyCapture::CaptureCallHandlingExt;
+        mKeyCapture->captureRemoteKeys(flags |= XQKeyCapture::CaptureBasic);
     } else {
         addTextLine("Remote Basic disabled");
         mKeyCapture->cancelCaptureRemoteKeys(XQKeyCapture::CaptureBasic);
@@ -272,7 +277,12 @@
 {
     if (enable) {
         addTextLine("Remote Call Handling Ext. enabled");
-        mKeyCapture->captureRemoteKeys(XQKeyCapture::CaptureCallHandlingExt);
+        QFlags<XQKeyCapture::CapturingFlag> flags = XQKeyCapture::CaptureNone;
+        if (toggleRemoteExtEvents->isChecked())
+            flags = XQKeyCapture::CaptureEnableRemoteExtEvents;
+        if (toggleRemoteBasic->isChecked())
+            flags |= XQKeyCapture::CaptureBasic;
+        mKeyCapture->captureRemoteKeys(flags | XQKeyCapture::CaptureCallHandlingExt);
     } else {
         addTextLine("Remote Call Handling Ext. disabled");
         mKeyCapture->cancelCaptureRemoteKeys(XQKeyCapture::CaptureCallHandlingExt);
@@ -283,11 +293,15 @@
 {
     if (enable) {
         addTextLine("Remote Events Ext. enabled");
-        mKeyCapture->captureRemoteKeys(XQKeyCapture::CaptureBasic | XQKeyCapture::CaptureEnableRemoteExtEvents);
-        toggleRemoteBasic->setChecked(true);
+        QFlags<XQKeyCapture::CapturingFlag> flags = XQKeyCapture::CaptureNone;
+        if (toggleRemoteCallHandlingEx->isChecked())
+            flags = XQKeyCapture::CaptureCallHandlingExt;
+        if (toggleRemoteBasic->isChecked())
+            flags |= XQKeyCapture::CaptureBasic;
+        mKeyCapture->captureRemoteKeys(flags | XQKeyCapture::CaptureEnableRemoteExtEvents);
     } else {
         addTextLine("Remote Events Ext. disabled");
-        mKeyCapture->cancelCaptureRemoteKeys(XQKeyCapture::CaptureBasic | XQKeyCapture::CaptureEnableRemoteExtEvents);
+        mKeyCapture->cancelCaptureRemoteKeys(XQKeyCapture::CaptureEnableRemoteExtEvents);
     }
 }
 
@@ -307,6 +321,7 @@
     Q_UNUSED(enable);
     toggleRemoteBasic->setChecked(false);
     toggleRemoteCallHandlingEx->setChecked(false);
+    toggleRemoteExtEvents->setChecked(false);
     addTextLine("Remote: disable all");
     mKeyCapture->cancelCaptureRemoteKeys(XQKeyCapture::CaptureCallHandlingExt | XQKeyCapture::CaptureBasic | 
             XQKeyCapture::CaptureEnableRemoteExtEvents);