Size negotiation Example only exits if BACK/ESC is unhandled 08/91308/3
authorAdeel Kazmi <adeel.kazmi@samsung.com>
Thu, 6 Oct 2016 18:36:53 +0000 (19:36 +0100)
committerAdeel Kazmi <adeel.kazmi@samsung.com>
Thu, 6 Oct 2016 18:38:04 +0000 (11:38 -0700)
Change-Id: Ia11d6ba26ef654ca6c531a169223bc27b4d86e58

examples/size-negotiation/size-negotiation-example.cpp

index ba6becd..5e03efa 100644 (file)
@@ -19,6 +19,7 @@
 #include <dali/dali.h>
 #include <dali-toolkit/dali-toolkit.h>
 #include <dali-toolkit/devel-api/controls/popup/popup.h>
+#include <dali-toolkit/devel-api/focus-manager/keyinput-focus-manager.h>
 
 using namespace Dali;
 
@@ -112,8 +113,12 @@ public:
     // The Init signal is received once (only) during the Application lifetime
     Stage stage = Stage::GetCurrent();
 
-    // Respond to key events
-    stage.KeyEventSignal().Connect(this, &SizeNegotiationController::OnKeyEvent);
+    // Respond to key events if not handled
+    Toolkit::KeyInputFocusManager keyInputFocusManager = Toolkit::KeyInputFocusManager::Get();
+    if( keyInputFocusManager )
+    {
+      keyInputFocusManager.UnhandledKeyEventSignal().Connect(this, &SizeNegotiationController::OnKeyEvent);
+    }
 
     // Creates a default view with a default tool bar.
     // The view is added to the stage.