- // If mClearFocusOnTouch is false, do not clear the focus even if user touch the screen.
- if( (( touch.GetPointCount() < 1 ) || ( touch.GetState( 0 ) == PointState::DOWN )) && mClearFocusOnTouch )
+ if(((touch.GetPointCount() < 1) || (touch.GetState(0) == PointState::DOWN)))
+ {
+ // If you touch the currently focused actor again, you don't need to do SetCurrentFocusActor again.
+ Actor hitActor = touch.GetHitActor(0);
+ if(hitActor && hitActor == GetCurrentFocusActor())
+ {
+ return;
+ }
+ // If KEYBOARD_FOCUSABLE and TOUCH_FOCUSABLE is true, set focus actor
+ if(hitActor && hitActor.GetProperty<bool>(Actor::Property::KEYBOARD_FOCUSABLE) && hitActor.GetProperty<bool>(DevelActor::Property::TOUCH_FOCUSABLE))
+ {
+ // If mClearFocusOnTouch is false, do not clear the focus
+ if(mClearFocusOnTouch)
+ {
+ ClearFocus();
+ }
+ SetCurrentFocusActor(hitActor);
+ }
+ else
+ {
+ // If mClearFocusOnTouch is false, do not clear the focus indicator even if user touch the screen.
+ if(mClearFocusOnTouch)
+ {
+ ClearFocusIndicator();
+ }
+ }
+ }
+}
+
+void KeyboardFocusManager::OnWheelEvent(const WheelEvent& event)
+{
+ if(event.GetType() == Dali::WheelEvent::CUSTOM_WHEEL)
+ {
+ Toolkit::Control::KeyboardFocus::Direction direction = (event.GetDelta() > 0) ? Toolkit::Control::KeyboardFocus::CLOCKWISE : Toolkit::Control::KeyboardFocus::COUNTER_CLOCKWISE;
+ // Move the focus
+ MoveFocus(direction);
+ }
+}
+
+bool KeyboardFocusManager::OnCustomWheelEvent(const WheelEvent& event)
+{
+ bool consumed = false;
+ Actor actor = GetCurrentFocusActor();
+ if(actor)