Focus (computing)

Last updated

In a computing graphical user interface (GUI), a component has focus when it is selected to receive input from the user by an event such as a mouse button click or keypress. [1] Moving the focus away from a specific user interface element is known as a blur event in relation to this element. [2] Typically, the focus is withdrawn from an element by giving another element the focus. This means that focus and blur events are virtually simultaneous in relation to different user interface elements, one that becomes focused and one that is "blurred" (in the computing, not visual, sense).

Contents

The concept is similar to a cursor in a text-based environment. However, when considering a graphical interface, there is also a mouse pointer involved. Moving the mouse will typically move the mouse pointer 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. When graphical interfaces were first introduced, many computers did not have mice, so this alternative was necessary. This feature makes it easier for people unable to use a mouse to use the user interface. In certain circumstances the arrow keys can be used to change focus.

Window focus

The behaviour of focus on one's desktop can be governed by policies in window management.

Click to focus

On most mainstream user-interfaces, such as ones made by Microsoft and Apple, it is common to find a "focus follows click" policy (or "click to focus"), where one must click the mouse inside of the window for that window to gain focus. This also typically results in the window being raised above all other windows on screen. If a clickfocus model such as this is being used, the current application window continues to retain focus and collect input, even if the mouse pointer is over another application window.

Focus follows pointer

Another common policy on Unix systems using X Window System (X11) is the "focus follows mouse" policy (or FFM), where the focus automatically follows the current placement of the pointer. The focused window is not necessarily raised; parts of it may remain below other windows. Window managers with this policy usually offer "autoraise," which raises the window when it is focused, typically after a configurable short delay. A possible consequence of a followfocus policy is that no window has focus when the pointer is moved over the background with no window underneath; otherwise the focus simply remains in the last window.

Sloppy focus

The sloppyfocus model is a variant of the followfocus model. [3] It allows input to continue to be collected by the last focused window when the mouse pointer is moved away from any window, such as over a menubar or desktop area.

Focus models used by X11 window managers

ClickfocusFollowfocusSloppyfocus
aewm [4] NoYesNo
aewm++ [5] YesNoNo
AHWM [6] YesNoYes
awesome YesYesYes
CTWM YesYesYes
dwm [7] YesYesNo
E16 YesYesYes (default)
evilwm [8] NoYesNo
FLWM NoNoYes
Fluxbox YesYesYes
FVWM [α] YesYes (default)Yes
IceWM [9] YesYesYes
Karmen [10] YesNoNo
lwm [11] YesNoYes
TinyWM [12] NoNoYes
Whim [13] YesNoYes
WindowLab Yes (with no autoraise)NoNo
Xfwm YesYesYes
Mutter YesYesYes
JWM YesNoYes
MWM YesNoNo

Intra-window component focus

Individual components of a window may also have a focal 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 movable using the mouse pointer.

Which component should have the default focus, and how focus should move between components, are difficult but important problems in user interface design. Giving the wrong thing focus means that the user has to waste time moving the focus. Conversely, giving the right thing focus can significantly enhance the user experience.

See also

Related Research Articles

<span class="mw-page-title-main">Context menu</span> User interface element

A context menu is a menu in a graphical user interface (GUI) that appears upon user interaction, such as a right-click mouse operation. A context menu offers a limited set of choices that are available in the current state, or context, of the operating system or application to which the menu belongs. Usually the available choices are actions related to the selected object. From a technical point of view, such a context menu is a graphical control element.

The graphical user interface, or GUI, is a form of user interface that allows users to interact with electronic devices through graphical icons and audio indicator such as primary notation, instead of text-based UIs, typed command labels or text navigation. GUIs were introduced in reaction to the perceived steep learning curve of command-line interfaces (CLIs), which require commands to be typed on a computer keyboard.

<span class="mw-page-title-main">History of the graphical user interface</span>

The history of the graphical user interface, understood as the use of graphic icons and a pointing device to control a computer, covers a five-decade span of incremental refinements, built on some constant core principles. Several vendors have created their own windowing systems based on independent code, but with basic elements in common that define the WIMP "window, icon, menu and pointing device" paradigm.

<span class="mw-page-title-main">Pie menu</span> Software menu where elements are arranged in a circle

In user interface design, a pie menu or radial menu is a circular context menu where selection depends on direction. It is a graphical control element. A pie menu is made of several "pie slices" around an inactive center and works best with stylus input, and well with a mouse. Pie slices are drawn with a hole in the middle for an easy way to exit the menu.

<span class="mw-page-title-main">Windowing system</span> Software that manages separately different parts of display screens

In computing, a windowing system is software that manages separately different parts of display screens. It is a type of graphical user interface (GUI) which implements the WIMP paradigm for a user interface.

In computing, a window is a graphical control element. It consists of a visual area containing some of the graphical user interface of the program it belongs to and is framed by a window decoration. It usually has a rectangular shape that can overlap with the area of other windows. It displays the output of and may allow input to one or more processes.

<span class="mw-page-title-main">Screen magnifier</span>

A screen magnifier is software that interfaces with a computer's graphical output to present enlarged screen content. By enlarging part of a screen, people with visual impairments can better see words and images. This type of assistive technology is useful for people with some functional vision; people with visual impairments and little or no functional vision usually use a screen reader.

twm Window manager for the X Window System

twm is a window manager for the X Window System. Started in 1987 by Tom LaStrange, it has been the standard window manager for the X Window System since version X11R4. The name originally stood for Tom's Window Manager, but the software was renamed Tab Window Manager by the X Consortium when they adopted it in 1989. twm is a stacking window manager that provides title bars, shaped windows and icon management. It is highly configurable and extensible.

The Taskbar is a graphical user interface element that has been part of Microsoft Windows since Windows 95, displaying and facilitating switching between running programs. The Taskbar and the associated Start Menu were created and named in 1993 by Daniel Oran, a program manager at Microsoft who had previously collaborated on Great ape language research with the behavioral psychologist B.F. Skinner at Harvard.

<span class="mw-page-title-main">Text-based user interface</span> Type of interface based on outputting to or controlling a text display

In computing, text-based user interfaces (TUI), is a retronym describing a type of user interface (UI) common as an early form of human–computer interaction, before the advent of modern conventional graphical user interfaces (GUIs). Like GUIs, they may use the entire screen area and accept mouse and other inputs. They may also use color and often structure the display using special graphical characters such as ┌ and ╣, referred to in Unicode as the "box drawing" set. The modern context of use is usually a terminal emulator.

<span class="mw-page-title-main">WIMP (computing)</span> Style of human-computer interaction

In human–computer interaction, WIMP stands for "windows, icons, menus, pointer", denoting a style of interaction using these elements of the user interface. Other expansions are sometimes used, such as substituting "mouse" and "mice" for menus, or "pull-down menu" and "pointing" for pointer.

<span class="mw-page-title-main">Graphical widget</span> Element of interaction in a graphical user interface

A graphical widget in a graphical user interface is an element of interaction, such as a button or a scroll bar. Controls are software components that a computer user interacts with through direct manipulation to read or edit information about an application. User interface libraries such as Windows Presentation Foundation, Qt, GTK, and Cocoa, contain a collection of controls and the logic to render these.

<span class="mw-page-title-main">Window manager</span> Type of system software

A window manager is system software that controls the placement and appearance of windows within a windowing system in a graphical user interface. Most window managers are designed to help provide a desktop environment. They work in conjunction with the underlying graphical system that provides required functionality—support for graphics hardware, pointing devices, and a keyboard—and are often written and created using a widget toolkit.

<span class="mw-page-title-main">Tooltip</span> Graphical user interface element

The tooltip, also known as infotip or hint, is a common graphical user interface (GUI) element in which, when hovering over a screen element or component, a text box displays information about that element, such as a description of a button's function, what an abbreviation stands for, or the exact absolute time stamp over a relative time. In common practice, the tooltip is displayed continuously as long as the user hovers over the element or the text box provided by the tool. It is sometimes possible for the mouse to hover within the text box provided to activate a nested tooltip, and this can continue to any depth, often with multiple text boxes overlapped.

In computing, the X Window System is a network-transparent windowing system for bitmap displays. This article details the protocols and technical structure of X11.

In human–computer interaction, a cursor is an indicator used to show the current position on a computer monitor or other display device that will respond to text input.

A menu bar is a graphical control element which contains drop-down menus.

A compositing manager is software that provides applications with an off-screen buffer for each window. The compositing manager composites the window buffers into an image representing the screen and writes the result into the display memory. A compositing window manager, or compositor, is a window manager that is also a compositing manager.

<span class="mw-page-title-main">Mouse button</span> Electric switch on a computer mouse

A mouse button is an electric switch on a computer mouse which can be pressed (“clicked”) to select or interact with an element of a graphical user interface. Mouse buttons are most commonly implemented as miniature snap-action switches.

References

  1. "Managing UI Component Focus - Concept of Focus". Enlightenment. Retrieved 4 June 2023.
  2. Garg, Naman (12 October 2018). "Javascript Window Blur() and Window Focus() Method". GeeksforGeeks. Retrieved 4 June 2023.
  3. "Sloppy Focus". c2.com/cgi/wiki. 25 February 2012.
  4. "aewm - Red Bean". 27 December 2007. Archived from the original on 14 January 2016. Retrieved 16 January 2016.
  5. "Guide to X11/Window Managers/aewm++". Wikibooks . 18 July 2010. Retrieved 16 January 2016.
  6. "AHWM - Alex Hioreanu's Window Manager". hioreanu.net. 24 February 2014. Retrieved 16 January 2016.
  7. "dwm - dynamic window manager". suckless.org. 9 November 2015. Retrieved 16 January 2016.
  8. "evilwm - a minimalist window manager for the X Window System". The Dragon 32/64 Computers. 13 July 2015. Retrieved 16 January 2016.
  9. "icewm(1)". 13 February 2021. Retrieved 16 February 2021.
  10. "Karmen: A Window Manager for X". 28 December 2008. Retrieved 16 January 2016.
  11. "lwm - Lightweight Window Manager". 26 February 2015. Retrieved 16 January 2016.
  12. "incise.org: tinywm". 23 April 2014. Retrieved 16 January 2016.
  13. "Whim basic information". Tcler's Wiki. 24 November 2009. Retrieved 16 January 2016.

Notes

αPer window or window class, with additional support for "never focus" — windows that should never receive focus.