Prevent selected text from being erased by Power button. 40/42540/2
authorAgnelo Vaz <agnelo.vaz@samsung.com>
Mon, 29 Jun 2015 15:47:17 +0000 (16:47 +0100)
committerVictor Cebollada <v.cebollada@samsung.com>
Tue, 30 Jun 2015 07:04:03 +0000 (08:04 +0100)
Power button and Menu button are now consumed so don't erase selected text.

Change-Id: Idaa2f50f67d6c77e3062ec21a179a3c8d79d1fcc
Signed-off-by: Agnelo Vaz <agnelo.vaz@samsung.com>
dali-toolkit/internal/text/text-controller.cpp

index e8df944..814c4fe 100644 (file)
@@ -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() );