Add forward and backward type for Tab, Shift-Tab key 81/270781/2
authorjoogab.yun <joogab.yun@samsung.com>
Wed, 9 Feb 2022 02:01:31 +0000 (11:01 +0900)
committerjoogab.yun <joogab.yun@samsung.com>
Fri, 11 Feb 2022 10:05:19 +0000 (19:05 +0900)
Change-Id: I3f74f543463c776abf3f1d2a4b5e2ce856868fb4

dali-toolkit/internal/focus-manager/keyboard-focus-manager-impl.cpp
dali-toolkit/public-api/controls/control.h

index b8b8a6d..cc80372 100644 (file)
@@ -901,12 +901,8 @@ void KeyboardFocusManager::OnKeyEvent(const KeyEvent& event)
         // "Shift-Tab" key changes it in the backward direction.
         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);
-          }
+          // If the focus group is not changed, Move the focus towards forward, "Shift-Tap" key moves the focus towards backward.
+          MoveFocus(event.IsShiftModifier() ? Toolkit::Control::KeyboardFocus::BACKWARD : Toolkit::Control::KeyboardFocus::FORWARD);
         }
       }
 
index cbcb6ff..7ac183e 100644 (file)
@@ -147,12 +147,14 @@ public:
      */
     enum Direction
     {
-      LEFT,     ///< Move keyboard focus towards the left direction @SINCE_1_0.0
-      RIGHT,    ///< Move keyboard focus towards the right direction @SINCE_1_0.0
-      UP,       ///< Move keyboard focus towards the up direction @SINCE_1_0.0
-      DOWN,     ///< Move keyboard focus towards the down direction @SINCE_1_0.0
-      PAGE_UP,  ///< Move keyboard focus towards the previous page direction @SINCE_1_2.14
-      PAGE_DOWN ///< Move keyboard focus towards the next page direction @SINCE_1_2.14
+      LEFT,      ///< Move keyboard focus towards the left direction @SINCE_1_0.0
+      RIGHT,     ///< Move keyboard focus towards the right direction @SINCE_1_0.0
+      UP,        ///< Move keyboard focus towards the up direction @SINCE_1_0.0
+      DOWN,      ///< Move keyboard focus towards the down direction @SINCE_1_0.0
+      PAGE_UP,   ///< Move keyboard focus towards the previous page direction @SINCE_1_2.14
+      PAGE_DOWN, ///< Move keyboard focus towards the next page direction @SINCE_1_2.14
+      FORWARD,   ///< Move keyboard focus towards the forward direction @SINCE_2_1.10
+      BACKWARD,  ///< Move keyboard focus towards the backward direction @SINCE_2_1.10
     };
   };