Design and Layout:Interaction:Focus
From KDE-HIG_Wiki
Introduction Text
Keyboard Focus and Tab Sequence
An application is a collection of windows and widgets combined in a hierarchical tree. A window can have several widgets, and each of these widgets can in turn have several other widgets. Having child widgets is restricted to container widgets like a frame or a tab widget, among others. In contrast, widgets like a line edit or a label never have children.
To navigate this nested tree of widgets using nothing but the keyboard, there is an active widget which is said to have the focus - the so-called keyboard or input focus. The input focus is typically drawn with an outline around the text of the widget.
Each widget decides if it can get focus or not, or, in the case of container widgets, if only its children will get focus. This is the case for a tab widget where the different tabs can get focus, but the whole tab widget itself can not. Widgets like that are called focus roots. This is because to navigate from a button on a tab page you first have to go up to the focus root where you can switch tab.
Guidelines
- The initial keyboard focus should be set to the widget which first needs to be operated.
- If the sequence of operation can not be determined, the one in the upper left corner (Roman system) should be chosen.
- The tab sequence should make it easy to navigate between related widgets. Typically it leads from the upper left to the bottom right corner in Roman systems.
- The automatic tab sequence assigned by Designer should be checked for reasonableness.
