* [[#Customizing_Collision_of_Both|Customizing Collision of Both]]
* [[#Focus_on_UI_Component|Focus on UI Component]]
==== Focus Presentation ====
=== Concept of Focus ===
Focus is a graphical user interface concept. A component, for example, a UI
component, has a focus when it is selected to receive input from the user. The
input can be an event, such as mouse button click or key press.
=== Giving Focus ===
Focusing can be immediate (selected by the touchscreen or mouse) or relative
(selected by a key press).
There are mainly two ways to set focus on a graphical elements:
* Direct selection: this is done by clicking on the element.
* Relative selection: this is done by moving the selection from a UI component to another, such as going to the previous or next one; this is done with a keyboard.
Direct selection does not really need any kind of special treatment as the
user explicitly selects the UI component to interact with.
Relative selection' default order is the one the UI components have been added
to the canvas. That may not be appropriate, if they are added programmatically
in different order than they appear on-screen.
==== Moving Focus ====
=== Concept of Focus Chain ===
The order the focus goes from a UI component to another is called the focus
chain. As said before, the default focus chain is set to the order the UI
components have been added to the canvas.
=== Focusable Objects ===
An object can be focused if the following conditions apply:
* object is visible
* object is enabled
* object accepts focus
* object's subtree (if any) is focusable
* all of object's parents have their subtrees focusable
If any of these conditions do not apply, the object is unfocusable.
=== Handling Key Input ===
Handling of the keys is done automatically by Elementary. According to which
key the user pressed, Elementary switches the focus in the selected direction.
For example, using the ''Tab'' key the focus goes to the next object in the
natural order, whereas using the direction keys the focus goes to the next
object in the requested direction.
=== Hiding, Deleting or Disabling a Focused Object ===
When a UI component is hidden, deleted, or disabled, it becomes unfocusable.
When a focused object is unfocusable, the focus is moved to another object.
=== Selecting Next Object ===
When the user wants to switch the focus to the next object (i.e. cycle focus),
Elementary searches the first object which is focusable.
If there is a disabled or read-only object in the focus chain, the focus goes
to the following object in the requested direction.
==== Customizing Focus ====
There are several reasons why to customize the focus chain of an application,
for example:
* If you have created a form with labels and text entries next to them, the focus moves to the entry field when the user clicks on the associated label.
* If you have created an interface with several columns (table), set the focus chain as you wish, for example, going horizontally instead of going vertically, regardless whatever the order the UI components are added.
=== Customizing Object's Focus Exit Chain ===
Set the object to focus after other object in a specific direction using
''elm_object_focus_next_object_set(object, next, direction)''. Use the
following directions:
* ''ELM_FOCUS_NEXT'': next UI component in natural order
* ''ELM_FOCUS_PREVIOUS'': previous UI component in natural order
* ''ELM_FOCUS_UP'': UI component to focus when going up
* ''ELM_FOCUS_DOWN'': UI component to focus when going down
* ''ELM_FOCUS_RIGHT'': UI component to focus when going right
* ''ELM_FOCUS_LEFT'': UI component to focus when going left
Set the object next to another in a specific direction using