Focus (computing)
|
In computing, the focus is the component of the graphical user interface which is currently selected. Text entered at the keyboard or pasted from a clipboard is sent to the component which currently has the focus.
The concept is similar to a cursor in a text-based environment. However, when considering a graphical interface, there is also a mouse cursor involved. Moving the mouse will typically move the mouse cursor without changing the focus. The focus can usually be changed by clicking on a component that can receive focus with the mouse. Many desktops also allow the focus to be changed with the keyboard. By convention, the tab key is used to move the focus to the next focusable component and shift + tab to the previous one. This feature was designed to make it easier for people that have a hard time using a mouse to use the user interface. In certain circumstances, the arrow keys can also be used to move focus.
Individual components may also have a cursor position. For instance in a text editing package, the text editing window must have the Focus so that text can be entered. When text is entered into the component, it will appear at the position of the text-cursor, which will also normally be moveable using the mouse cursor.
Which component that should have the default focus and how focus should move between components is a difficult but important problem in user interface design. Giving the wrong thing focus means that the user has to waste time moving the focus. Conversively, giving the right thing focus can significantly enhance the users experience.