Commit f6d1ca298c7b3b2181cc3fbad6389f63b200015e
1 parent
37a9fafe
(Popup) Fix back/ESC key handling & ToastPopup
Change-Id: Ibab6ccde4b3ed1d26e75bacc10f3e96c506b8f2d
Showing
1 changed file
with
8 additions
and
3 deletions
examples/popup/popup-example.cpp
| ... | ... | @@ -19,6 +19,7 @@ |
| 19 | 19 | #include <dali/dali.h> |
| 20 | 20 | #include <dali-toolkit/dali-toolkit.h> |
| 21 | 21 | #include <dali-toolkit/devel-api/controls/popup/popup.h> |
| 22 | +#include <dali-toolkit/devel-api/focus-manager/keyinput-focus-manager.h> | |
| 22 | 23 | |
| 23 | 24 | using namespace Dali; |
| 24 | 25 | |
| ... | ... | @@ -111,8 +112,12 @@ public: |
| 111 | 112 | // The Init signal is received once (only) during the Application lifetime |
| 112 | 113 | Stage stage = Stage::GetCurrent(); |
| 113 | 114 | |
| 114 | - // Respond to key events | |
| 115 | - stage.KeyEventSignal().Connect(this, &PopupExample::OnKeyEvent); | |
| 115 | + // Respond to key events if not handled | |
| 116 | + Toolkit::KeyInputFocusManager keyInputFocusManager = Toolkit::KeyInputFocusManager::Get(); | |
| 117 | + if( keyInputFocusManager ) | |
| 118 | + { | |
| 119 | + keyInputFocusManager.UnhandledKeyEventSignal().Connect( this, &PopupExample::OnKeyEvent ); | |
| 120 | + } | |
| 116 | 121 | |
| 117 | 122 | // Creates a default view with a default tool bar. |
| 118 | 123 | // The view is added to the stage. |
| ... | ... | @@ -471,7 +476,7 @@ public: |
| 471 | 476 | else if( button.GetName() == POPUP_BUTTON_TOAST_ID ) |
| 472 | 477 | { |
| 473 | 478 | // Create a toast popup via the type registry (as it is a named-type). |
| 474 | - TypeInfo typeInfo = TypeRegistry::Get().GetTypeInfo( "popupToast" ); | |
| 479 | + TypeInfo typeInfo = TypeRegistry::Get().GetTypeInfo( "PopupToast" ); | |
| 475 | 480 | if( typeInfo ) |
| 476 | 481 | { |
| 477 | 482 | BaseHandle baseHandle = typeInfo.CreateInstance(); | ... | ... |