+ // If the focusable property is set then determine next focusable actor
+ if( index != Property::INVALID_INDEX)
+ {
+ value = currentFocusActor.GetProperty( index );
+ actorId = value.Get<int>();
+
+ // If actor's id is valid then find actor form actor's id. The actor should be on the stage.
+ if( actorId != -1 )
+ {
+ if( currentFocusActor.GetParent() )
+ {
+ nextFocusableActor = currentFocusActor.GetParent().FindChildById( actorId );
+ }
+
+ if( !nextFocusableActor )
+ {
+ nextFocusableActor = Stage::GetCurrent().GetRootLayer().FindChildById( actorId );
+ }
+ }
+ }
+ }
+
+ if( !nextFocusableActor )
+ {
+ // If the implementation of CustomAlgorithmInterface is provided then the PreFocusChangeSignal is no longer emitted.
+ if( mCustomAlgorithmInterface )
+ {
+ mIsWaitingKeyboardFocusChangeCommit = true;
+ nextFocusableActor = mCustomAlgorithmInterface->GetNextFocusableActor( currentFocusActor, Actor(), direction );
+ mIsWaitingKeyboardFocusChangeCommit = false;
+ }
+ else if( !mPreFocusChangeSignal.Empty() )
+ {
+ // Don't know how to move the focus further. The application needs to tell us which actor to move the focus to
+ mIsWaitingKeyboardFocusChangeCommit = true;
+ nextFocusableActor = mPreFocusChangeSignal.Emit( currentFocusActor, Actor(), direction );
+ mIsWaitingKeyboardFocusChangeCommit = false;
+ }
+ }
+
+ if( nextFocusableActor && nextFocusableActor.IsKeyboardFocusable() )