From 77c9237f0924c5947ecb2a2981a133f7634f723d Mon Sep 17 00:00:00 2001 From: Agnelo Vaz Date: Mon, 29 Jun 2015 16:47:17 +0100 Subject: [PATCH] Prevent selected text from being erased by Power button. Power button and Menu button are now consumed so don't erase selected text. Change-Id: Idaa2f50f67d6c77e3062ec21a179a3c8d79d1fcc Signed-off-by: Agnelo Vaz --- dali-toolkit/internal/text/text-controller.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dali-toolkit/internal/text/text-controller.cpp b/dali-toolkit/internal/text/text-controller.cpp index e8df944..814c4fe 100644 --- a/dali-toolkit/internal/text/text-controller.cpp +++ b/dali-toolkit/internal/text/text-controller.cpp @@ -1152,6 +1152,11 @@ bool Controller::KeyEvent( const Dali::KeyEvent& keyEvent ) { textChanged = BackspaceKeyEvent(); } + else if ( IsKey( keyEvent, Dali::DALI_KEY_POWER ) || IsKey( keyEvent, Dali::DALI_KEY_MENU ) ) + { + // Do nothing when the Power or Menu Key is pressed. + // It avoids call the InsertText() method and delete the selected text. + } else { DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Controller::KeyEvent %p keyString %s\n", this, keyString.c_str() ); -- 2.7.4