Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Focus (computing)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Short description|The active GUI component receiving input}} 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.<ref>{{cite web | title=Managing UI Component Focus - Concept of Focus| website=Enlightenment| url=https://www.enlightenment.org/develop/legacy/program_guide/focus_ui_pg#Concept_of_Focus | access-date=4 June 2023}}</ref> Moving the focus away from a specific user interface element is known as a '''blur''' event in relation to this element.<ref>{{cite web | title=Javascript Window Blur() and Window Focus() Method|first=Naman|last=Garg| website=GeeksforGeeks | date=12 October 2018 | url=https://www.geeksforgeeks.org/javascript-window-blur-and-window-focus-method/ | access-date=4 June 2023}}</ref> Typically, the focus is withdrawn from an element by giving another element the focus. This means that focus and blur [[Event (computing)|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). The concept is similar to a [[Cursor (user interface)|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 [[Desktop environment|desktops]] also allow the focus to be changed with the keyboard. By convention, the [[Tab key|{{key press|Tab}}]] key is used to move the focus to the next focusable component and [[Shift key|{{key press|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 [[Computer accessibility|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 manager|window management]]. ===Click to focus=== On most mainstream user-interfaces, such as ones made by [[Microsoft]] and [[Apple Inc.|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.<ref>{{cite web|title=Sloppy Focus|url=http://c2.com/cgi/wiki?SloppyFocus|website=c2.com/cgi/wiki|date=25 February 2012}}</ref> 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== {| class="wikitable sortable" style="width: 50%; text-align: center" ! style="width: 5%" | ! style="width: 15%" | Clickfocus ! style="width: 15%" | Followfocus ! style="width: 15%" | Sloppyfocus |- ! style="text-align:left;" | [[aewm]]<ref>{{cite web|title=aewm - Red Bean|url=http://www.red-bean.com/decklin/aewm/|access-date=16 January 2016|date=27 December 2007|archive-url=https://web.archive.org/web/20160114133240/http://www.red-bean.com/decklin/aewm/|archive-date=14 January 2016|url-status=dead}}</ref> | {{no}} | {{yes}} | {{no}} |- ! style="text-align:left;" | [[aewm++]]<ref>{{cite web|title=Guide to X11/Window Managers/aewm++|url=https://en.wikibooks.org/wiki/Guide_to_X11/Window_Managers/aewm%2B%2B|access-date=16 January 2016|website=[[Wikibooks]]|date=18 July 2010}}</ref> | {{yes}} | {{no}} | {{no}} |- ! style="text-align:left;" | [[AHWM]]<ref>{{cite web|title=AHWM - Alex Hioreanu's Window Manager|url=http://www.hioreanu.net/cs/ahwm/|access-date=16 January 2016|website=hioreanu.net|date=24 February 2014}}</ref> | {{yes}} | {{no}} | {{yes}} |- ! style="text-align:left;" | [[Awesome (window manager)|awesome]] | {{yes}} | {{yes}} | {{yes}} |- ! style="text-align:left;" | [[CTWM]] | {{yes}} | {{yes}} | {{yes}} |- ! style="text-align:left;" | [[dwm]]<ref>{{cite web|title=dwm - dynamic window manager|url=http://dwm.suckless.org/|access-date=16 January 2016|website=suckless.org|date=9 November 2015}}</ref> | {{yes}} | {{yes}} | {{no}} |- ! style="text-align:left;" | [[Enlightenment (software)#E16|E16]] | {{yes}} | {{yes}} | {{yes}} (default) |- ! style="text-align:left;" | [[evilwm]]<ref>{{cite web|title=evilwm - a minimalist window manager for the X Window System|url=http://www.6809.org.uk/evilwm/|access-date=16 January 2016|website=The Dragon 32/64 Computers|date=13 July 2015}}</ref> | {{no}} | {{yes}} | {{no}} |- ! style="text-align:left;" | [[FLWM]] | {{no}} | {{no}} | {{yes}} |- ! style="text-align:left;" | [[Fluxbox]] | {{yes}} | {{yes}} | {{yes}} |- ! style="text-align:left;" | [[FVWM]]{{ref label|Alpha|Ξ±}} | {{yes}} | {{yes}} (default) | {{yes}} |- ! style="text-align:left;" | [[IceWM]]<ref>{{cite web|title=icewm(1)|url=https://ice-wm.org/man/icewm|access-date=16 February 2021|date=13 February 2021}}</ref> | {{yes}} | {{yes}} | {{yes}} |- ! style="text-align:left;" | [[Karmen (window manager)|Karmen]]<ref>{{cite web|title=Karmen: A Window Manager for X|url=http://karmen.sourceforge.net/|access-date=16 January 2016|date=28 December 2008}}</ref> | {{yes}} | {{no}} | {{no}} |- ! style="text-align:left;" | [[lwm]]<ref>{{cite web|title=lwm - Lightweight Window Manager|url=http://www.jfc.org.uk/software/lwm.html|access-date=16 January 2016|date=26 February 2015}}</ref> | {{yes}} | {{no}} | {{yes}} |- ! style="text-align:left;" | [[TinyWM]]<ref>{{cite web|title=incise.org: tinywm|url=http://incise.org/tinywm.html|access-date=16 January 2016|date=23 April 2014}}</ref> | {{no}} | {{no}} | {{yes}} |- ! style="text-align:left;" | [[Whim (window manager)|Whim]]<ref>{{cite web|title=Whim basic information|url=http://wiki.tcl.tk/13972#pagetoc79b8a397|access-date=16 January 2016|website=Tcler's Wiki|date=24 November 2009}}</ref> | {{yes}} | {{no}} | {{yes}} |- ! style="text-align:left;" | [[WindowLab]] | {{yes}} (with no [[autoraise]]) | {{no}} | {{no}} |- ! style="text-align:left;" | [[Xfce#Xfwm|Xfwm]] | {{yes}} | {{yes}} | {{yes}} |- ! style="text-align:left;" | [[Mutter_(software)|Mutter]] | {{yes}} | {{yes}} | {{yes}} |- ! style="text-align:left;" | JWM | {{yes}} | {{no}} | {{yes}} |- ! style="text-align:left;" | [[Motif Window Manager|MWM]] | {{yes}} | {{no}} | {{no}} |} ==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== * [[Tabbing navigation#Tab_order|Tab order]] * [[Focus stealing]] * [[Selection (user interface)]] ==References== {{reflist}} ==Notes== :{{note label|Alpha|Ξ±}}Per window or window class, with additional support for "never focus" β windows that should never receive focus. {{DEFAULTSORT:Focus (Computing)}} [[Category:Graphical user interfaces]] [[Category:User interface techniques]]
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)
Pages transcluded onto the current version of this page
(
help
)
:
Template:Cite web
(
edit
)
Template:Key press
(
edit
)
Template:No
(
edit
)
Template:Note label
(
edit
)
Template:Ref label
(
edit
)
Template:Reflist
(
edit
)
Template:Short description
(
edit
)
Template:Yes
(
edit
)