X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Ffocus-manager%2Fkeyboard-focus-manager-impl.cpp;h=745da1593b16967c13b0d2e1a93fdd054d435412;hb=HEAD;hp=3ee2331712579fc48101cbe3a197b0c82ac7bfae;hpb=cb91dc2eda1f14d1240ae366828e8d897059f81c;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/internal/focus-manager/keyboard-focus-manager-impl.cpp b/dali-toolkit/internal/focus-manager/keyboard-focus-manager-impl.cpp index 3ee2331..e8a990f 100644 --- a/dali-toolkit/internal/focus-manager/keyboard-focus-manager-impl.cpp +++ b/dali-toolkit/internal/focus-manager/keyboard-focus-manager-impl.cpp @@ -130,7 +130,8 @@ KeyboardFocusManager::KeyboardFocusManager() mFocusGroupLoopEnabled(false), mIsWaitingKeyboardFocusChangeCommit(false), mClearFocusOnTouch(true), - mEnableDefaultAlgorithm(false) + mEnableDefaultAlgorithm(false), + mCurrentWindowId(0) { // TODO: Get FocusIndicatorEnable constant from stylesheet to set mIsFocusIndicatorShown. @@ -238,6 +239,7 @@ bool KeyboardFocusManager::DoSetCurrentFocusActor(Actor actor) { Layer rootLayer = currentWindow.GetRootLayer(); mCurrentFocusedWindow = rootLayer; + mCurrentWindowId = static_cast(currentWindow.GetNativeId()); } if((mIsFocusIndicatorShown == SHOW) && (mEnableFocusIndicator == ENABLE)) @@ -680,6 +682,7 @@ void KeyboardFocusManager::ClearFocus() Actor actor = GetCurrentFocusActor(); if(actor) { + DALI_LOG_RELEASE_INFO("ClearFocus id:(%d)\n", actor.GetProperty(Dali::Actor::Property::ID)); // Send notification for the change of focus actor if(!mFocusChangedSignal.Empty()) { @@ -798,8 +801,24 @@ Actor KeyboardFocusManager::GetFocusIndicatorActor() return mFocusIndicatorActor; } +uint32_t KeyboardFocusManager::GetCurrentWindowId() const +{ + return mCurrentWindowId; +} + void KeyboardFocusManager::OnKeyEvent(const KeyEvent& event) { + if(mCurrentFocusedWindow.GetHandle()) + { + // If it is a key event that occurred in another window, it returns. + uint32_t eventWindowId = event.GetWindowId(); + if(eventWindowId > 0 && GetCurrentWindowId() != eventWindowId) + { + DALI_LOG_RELEASE_INFO("CurrentFocusedWindow id %d, window ID where key event occurred %d : key event skip\n", GetCurrentWindowId(), eventWindowId); + return; + } + } + const std::string& keyName = event.GetKeyName(); const std::string& deviceName = event.GetDeviceName(); @@ -1087,6 +1106,7 @@ void KeyboardFocusManager::OnWindowFocusChanged(Window window, bool focusIn) // Change Current Focused Window Layer rootLayer = window.GetRootLayer(); mCurrentFocusedWindow = rootLayer; + mCurrentWindowId = static_cast(Integration::SceneHolder::Get(rootLayer).GetNativeId()); // Get Current Focused Actor from window Actor currentFocusedActor = GetFocusActorFromCurrentWindow();