Commit e43bfb7fabc22041182ae21eb6905d4a246f002a
Committed by
Gerrit Code Review
Merge "Size negotiation Example only exits if BACK/ESC is unhandled" into devel/master
Showing
1 changed file
with
7 additions
and
2 deletions
examples/size-negotiation/size-negotiation-example.cpp
| @@ -19,6 +19,7 @@ | @@ -19,6 +19,7 @@ | ||
| 19 | #include <dali/dali.h> | 19 | #include <dali/dali.h> |
| 20 | #include <dali-toolkit/dali-toolkit.h> | 20 | #include <dali-toolkit/dali-toolkit.h> |
| 21 | #include <dali-toolkit/devel-api/controls/popup/popup.h> | 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 | using namespace Dali; | 24 | using namespace Dali; |
| 24 | 25 | ||
| @@ -112,8 +113,12 @@ public: | @@ -112,8 +113,12 @@ public: | ||
| 112 | // The Init signal is received once (only) during the Application lifetime | 113 | // The Init signal is received once (only) during the Application lifetime |
| 113 | Stage stage = Stage::GetCurrent(); | 114 | Stage stage = Stage::GetCurrent(); |
| 114 | 115 | ||
| 115 | - // Respond to key events | ||
| 116 | - stage.KeyEventSignal().Connect(this, &SizeNegotiationController::OnKeyEvent); | 116 | + // Respond to key events if not handled |
| 117 | + Toolkit::KeyInputFocusManager keyInputFocusManager = Toolkit::KeyInputFocusManager::Get(); | ||
| 118 | + if( keyInputFocusManager ) | ||
| 119 | + { | ||
| 120 | + keyInputFocusManager.UnhandledKeyEventSignal().Connect(this, &SizeNegotiationController::OnKeyEvent); | ||
| 121 | + } | ||
| 117 | 122 | ||
| 118 | // Creates a default view with a default tool bar. | 123 | // Creates a default view with a default tool bar. |
| 119 | // The view is added to the stage. | 124 | // The view is added to the stage. |