Fix cursor display issue. 29/114029/3
authorVictor Cebollada <v.cebollada@samsung.com>
Thu, 9 Feb 2017 14:33:57 +0000 (14:33 +0000)
committerVictor Cebollada <v.cebollada@samsung.com>
Thu, 9 Feb 2017 16:06:43 +0000 (16:06 +0000)
* On resume after the power key is pressed the text controller is
  still in edit mode.
  When the power key is pressed, the text controller is set to the
  INACTIVE state.

* @todo: Different applications may want a different behaviour on resume.

Change-Id: I770b991bc0c141b5a2db260cf7ef7a693ead4b02
Signed-off-by: Victor Cebollada <v.cebollada@samsung.com>
dali-toolkit/internal/text/text-controller.cpp

index f10d93e..d02bc57 100644 (file)
@@ -1709,17 +1709,14 @@ bool Controller::KeyEvent( const Dali::KeyEvent& keyEvent )
     {
       textChanged = BackspaceKeyEvent();
     }
     {
       textChanged = BackspaceKeyEvent();
     }
-    else if( IsKey( keyEvent,  Dali::DALI_KEY_POWER ) )
-    {
-      mImpl->ChangeState( EventData::INTERRUPTED ); // State is not INACTIVE as expect to return to edit mode.
-      // Avoids calling the InsertText() method which can delete selected text
-    }
-    else if( IsKey( keyEvent, Dali::DALI_KEY_MENU ) ||
+    else if( IsKey( keyEvent, Dali::DALI_KEY_POWER ) ||
+             IsKey( keyEvent, Dali::DALI_KEY_MENU ) ||
              IsKey( keyEvent, Dali::DALI_KEY_HOME ) )
     {
              IsKey( keyEvent, Dali::DALI_KEY_HOME ) )
     {
+      // Power key/Menu/Home key behaviour does not allow edit mode to resume.
       mImpl->ChangeState( EventData::INACTIVE );
       mImpl->ChangeState( EventData::INACTIVE );
-      // Menu/Home key behaviour does not allow edit mode to resume like Power key
-      // Avoids calling the InsertText() method which can delete selected text
+
+      // This branch avoids calling the InsertText() method of the 'else' branch which can delete selected text.
     }
     else if( Dali::DALI_KEY_SHIFT_LEFT == keyCode )
     {
     }
     else if( Dali::DALI_KEY_SHIFT_LEFT == keyCode )
     {