#include <unistd.h>
#include <dali/public-api/rendering/renderer.h>
#include <dali/devel-api/adaptor-framework/clipboard.h>
+#include <dali/devel-api/adaptor-framework/key-devel.h>
#include <dali/integration-api/events/key-event-integ.h>
#include <dali/integration-api/events/touch-event-integ.h>
#include <dali/integration-api/events/tap-gesture-event.h>
application.SendNotification();
application.Render();
+ application.ProcessEvent( GenerateKey( "", "", Dali::DevelKey::DALI_KEY_DELETE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.SendNotification();
+ application.Render();
+
END_TEST;
}
#include <dali/integration-api/debug.h>
#include <dali/devel-api/adaptor-framework/clipboard-event-notifier.h>
#include <dali/devel-api/text-abstraction/font-client.h>
+#include <dali/devel-api/adaptor-framework/key-devel.h>
// INTERNAL INCLUDES
#include <dali-toolkit/public-api/controls/text-controls/placeholder-properties.h>
// Will request for relayout.
relayoutNeeded = true;
}
- else if( Dali::DALI_KEY_BACKSPACE == keyCode )
+ else if( ( Dali::DALI_KEY_BACKSPACE == keyCode ) ||
+ ( Dali::DevelKey::DALI_KEY_DELETE == keyCode ) )
{
- textChanged = BackspaceKeyEvent();
+ textChanged = DeleteEvent( keyCode );
// Will request for relayout.
relayoutNeeded = true;
}
}
-bool Controller::BackspaceKeyEvent()
+bool Controller::DeleteEvent( int keyCode )
{
- DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Controller::KeyEvent %p DALI_KEY_BACKSPACE\n", this );
+ DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Controller::KeyEvent %p KeyCode : %d \n", this, keyCode );
bool removed = false;
{
removed = RemoveSelectedText();
}
- else if( mImpl->mEventData->mPrimaryCursorPosition > 0 )
+ else if( ( mImpl->mEventData->mPrimaryCursorPosition > 0 ) && ( keyCode == Dali::DALI_KEY_BACKSPACE) )
{
// Remove the character before the current cursor position
removed = RemoveText( -1,
1,
UPDATE_INPUT_STYLE );
}
+ else if( ( mImpl->mEventData->mPrimaryCursorPosition >= 0 ) && ( keyCode == Dali::DevelKey::DALI_KEY_DELETE ) )
+ {
+ // Remove the character after the current cursor position
+ removed = RemoveText( 0,
+ 1,
+ UPDATE_INPUT_STYLE );
+ }
if( removed )
{
void SelectEvent( float x, float y, bool selectAll );
/**
- * @brief Helper to KeyEvent() to handle the backspace case.
+ * @brief Helper to KeyEvent() to handle the backspace or delete key case.
*
+ * @param[in] keyCode The keycode for the key pressed
* @return True if a character was deleted.
*/
- bool BackspaceKeyEvent();
+ bool DeleteEvent( int keyCode );
private: // Helpers.