 (def having-focus-state {:mode :has-focus
                          :focused-child nil})
 
-(defn temporarily-taken-from-state [permanent-owner-child] {:mode :has-focus
-                                                            :focused-child permanent-owner-child})
+(defn temporarily-taken-from-state [permanent-owner-child dir] {:mode :has-focus
+                                                                :focused-child permanent-owner-child
+                                                                :throw-mode dir})
 
 (defn focus-child [child-id]
   (if (keyword? child-id)
     {:mode :parent-of-focused
      :focused-child child-id}
     (throw (IllegalArgumentException. (str "child-id must be a keyword but is: " child-id)))))
+
+;; For :parent-of-focused and :has-focus the latest focus movent direction (if any) is tracked in :throw-mode
+(defn focus-child-by-direction [child-id dir]
+  (assoc (focus-child child-id) :throw-mode dir))
 
 (defn accepts-focus? [component]
   (or

        :else old-focus-state)

      (fgc/parent-reason? reason)
      (case (do (println "Parent event into " (:id component) " parent-mode " parent-mode " this-mode " this-mode) parent-mode)
        ;; If parent has focus temporarily, I take focus back (*2)
        ;; Otherwise my parent has focus permanently and my state is clean
        :has-focus (if (= parent-focused-child (:id component)) ; This condition means that parent has focus temporarily
                     having-focus-state
                     clean-state)
        ;:has-focus clean-state
        :none clean-state

      (let [child-id (nth reason 1)
            child-focus-state (get-property [:this child-id] :focus-state)
            child-mode (:mode child-focus-state)
            child-throw-mode (:throw-mode child-focus-state)]
        (case child-mode
          ;; Nothing to change in this case
          :none old-focus-state

          ;; If my child is the parent of focused component (or parent of parent ...)
          ;; then I'm :parent-of-focused as well
          :parent-of-focused (focus-child-by-direction child-id child-throw-mode)

          ;; My child has focus itself - same thing
          :has-focus (focus-child-by-direction child-id child-throw-mode)

          :requests-focus (case this-mode
                            ;; I'm the parent of focused component (no matter which exactly) and my child requests
                            ;; focus - then I note that this child becomes the new focus owner. My :mode stays the same
                            :parent-of-focused (focus-child-by-direction child-id (:throw-mode old-focus-state))

                            ;; If I have focus and my child requests it - I give focus to it
                            :has-focus (focus-child child-id)
