Add Tab key focus movement. 56/261056/3
authorJoogab Yun <joogab.yun@samsung.com>
Fri, 9 Jul 2021 06:41:24 +0000 (15:41 +0900)
committerJoogab Yun <joogab.yun@samsung.com>
Tue, 13 Jul 2021 09:58:56 +0000 (18:58 +0900)
If the focus group is not changed, Move the focus towards right, "Shift-Tap" key moves the focus towards left.
Still if the focus is not moved, Move the focus towards down, "Shift-Tap" key moves the focus towards up.

Change-Id: Iecfbe8a94ca96caff580714ef94ead7002e01e4b

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;