Merge "Add Tab key focus movement." into devel/master
authorjoogab yun <joogab.yun@samsung.com>
Thu, 15 Jul 2021 04:37:11 +0000 (04:37 +0000)
committerGerrit Code Review <gerrit@review>
Thu, 15 Jul 2021 04:37:11 +0000 (04:37 +0000)
dali-toolkit/internal/focus-manager/keyboard-focus-manager-impl.cpp

index 8dadb11..c03b7dd 100644 (file)
@@ -878,7 +878,15 @@ void KeyboardFocusManager::OnKeyEvent(const KeyEvent& event)
       {
         // "Tab" key changes the focus group in the forward direction and
         // "Shift-Tab" key changes it in the backward direction.
-        DoMoveFocusToNextFocusGroup(!event.IsShiftModifier());
+        if(!DoMoveFocusToNextFocusGroup(!event.IsShiftModifier()))
+        {
+          // If the focus group is not changed, Move the focus towards right, "Shift-Tap" key moves the focus towards left.
+          if(!MoveFocus(event.IsShiftModifier() ? Toolkit::Control::KeyboardFocus::LEFT : Toolkit::Control::KeyboardFocus::RIGHT))
+          {
+            // If the focus is not moved, Move the focus towards down, "Shift-Tap" key moves the focus towards up.
+            MoveFocus(event.IsShiftModifier() ? Toolkit::Control::KeyboardFocus::UP : Toolkit::Control::KeyboardFocus::DOWN);
+          }
+        }
       }
 
       isFocusStartableKey = true;