Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

Focus (computing)

From Wikipedia, the free encyclopedia
Active GUI component receiving input

In acomputinggraphical user interface (GUI), a component hasfocus 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 ablur 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 blurevents 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 acursor in a text-based environment. However, when considering a graphical interface, there is also amouse 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. Manydesktops also allow the focus to be changed with the keyboard. By convention, theTab ↹ 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 forpeople unable to use a mouse to use the user interface. In certain circumstances thearrow keys can be used to change focus.

Window focus

[edit]

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

Click to focus

[edit]

On most mainstream user-interfaces, such as ones made byMicrosoft andApple, 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 aclickfocus 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

[edit]

Another common policy onUnix systems usingX 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 afollowfocus 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

[edit]

Thesloppy focus 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

[edit]
ClickfocusFollowfocusSloppyfocus
aewm[4]NoYesNo
aewm++[5]YesNoNo
AHWM[6]YesNoYes
awesomeYesYesYes
CTWMYesYesYes
dwm[7]YesYesNo
E16YesYesYes (default)
evilwm[8]NoYesNo
FLWMNoNoYes
FluxboxYesYesYes
FVWM[α]YesYes (default)Yes
IceWM[9]YesYesYes
Karmen[10]YesNoNo
lwm[11]YesNoYes
TinyWM[12]NoNoYes
Whim[13]YesNoYes
WindowLabYes (with noautoraise)NoNo
XfwmYesYesYes
MutterYesYesYes
JWMYesNoYes
MWMYesNoNo

Intra-window component focus

[edit]

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

[edit]

References

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

Notes

[edit]
α Per window or window class, with additional support for "never focus" — windows that should never receive focus.
Retrieved from "https://en.wikipedia.org/w/index.php?title=Focus_(computing)&oldid=1316368695"
Categories:
Hidden categories:

[8]ページ先頭

©2009-2026 Movatter.jp