DALI_LOG_INFO( gLogFilter, Debug::General, "Controller::RemoveText %p mText.Count() %d cursor %d cursorOffset %d numberOfChars %d\n",
this, mImpl->mLogicalModel->mText.Count(), mImpl->mEventData->mPrimaryCursorPosition, cursorOffset, numberOfChars );
- if( ! mImpl->IsShowingPlaceholderText() )
+ if( !mImpl->IsShowingPlaceholderText() )
{
// Delete at current cursor position
Vector<Character>& currentText = mImpl->mLogicalModel->mText;
REORDER );
// Queue a cursor reposition event; this must wait until after DoRelayout()
- mImpl->mEventData->mScrollAfterDelete = true;
+ if( 0u == mImpl->mLogicalModel->mText.Count() )
+ {
+ mImpl->mEventData->mUpdateCursorPosition = true;
+ }
+ else
+ {
+ mImpl->mEventData->mScrollAfterDelete = true;
+ }
}
bool Controller::DoRelayout( const Size& size,
// Menu/Home key behaviour does not allow edit mode to resume like Power key
// Avoids calling the InsertText() method which can delete selected text
}
+ else if( Dali::DALI_KEY_SHIFT_LEFT == keyCode )
+ {
+ // DALI_KEY_SHIFT_LEFT is the key code for the Left Shift. It's sent (by the imf?) when the predictive text is enabled
+ // and a character is typed after the type of a upper case latin character.
+
+ // Do nothing.
+ }
else
{
DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Controller::KeyEvent %p keyString %s\n", this, keyString.c_str() );
}
case ImfManager::DELETESURROUNDING:
{
- RemoveText( imfEvent.cursorOffset, imfEvent.numberOfChars );
+ update = RemoveText( imfEvent.cursorOffset, imfEvent.numberOfChars );
+
+ if( update )
+ {
+ if( 0u != mImpl->mLogicalModel->mText.Count() ||
+ !mImpl->IsPlaceholderAvailable() )
+ {
+ mImpl->QueueModifyEvent( ModifyEvent::TEXT_DELETED );
+ }
+ else
+ {
+ ShowPlaceholderText();
+ mImpl->mEventData->mUpdateCursorPosition = true;
+ }
+ }
requestRelayout = true;
break;
}