+ 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)
+ {
+ // Notify the actor about the wheel event
+ consumed = EmitCustomWheelSignals(actor, event);
+ }
+ return consumed;
+}
+
+bool KeyboardFocusManager::EmitCustomWheelSignals(Actor actor, const WheelEvent& event)
+{
+ bool consumed = false;
+
+ if(actor)
+ {
+ Dali::Actor oldParent(actor.GetParent());
+
+ // Only do the conversion and emit the signal if the actor's wheel signal has connections.
+ if(!actor.WheelEventSignal().Empty())
+ {
+ // Emit the signal to the parent
+ consumed = actor.WheelEventSignal().Emit(actor, event);
+ }
+ // if actor doesn't consume WheelEvent, give WheelEvent to its parent.
+ if(!consumed)
+ {
+ // The actor may have been removed/reparented during the signal callbacks.
+ Dali::Actor parent = actor.GetParent();
+
+ if(parent &&
+ (parent == oldParent))
+ {
+ consumed = EmitCustomWheelSignals(parent, event);
+ }
+ }