From aefac7b91818861d25e2312ea4b63d2deb1a9a86 Mon Sep 17 00:00:00 2001 From: Joogab Yun Date: Fri, 9 Jul 2021 15:41:24 +0900 Subject: [PATCH] Add Tab key focus movement. 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 --- .../internal/focus-manager/keyboard-focus-manager-impl.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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 8dadb11..c03b7dd 100644 --- a/dali-toolkit/internal/focus-manager/keyboard-focus-manager-impl.cpp +++ b/dali-toolkit/internal/focus-manager/keyboard-focus-manager-impl.cpp @@ -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; -- 2.7.4