ArticleslgStudy

computer science

Focus (computing)

Focus (computing) is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Focus (computing) rather than just read about it. In short: 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. Moving the focus away from a specific user interface element is known as a blur event in relation to this element.

Key takeaways

  • Focus (computing) belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Focus (computing) to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Focus (computing) from memory before moving on to harder problems.

Reference excerpt

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. Moving the focus away from a specific user interface element is known as a blur event in relation to this element. 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). 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. Ostensibly prior to the widespread adoption of the term "focus", in the Sapphire window manager for the PERQ workstation's Accent-based operating system, the window retaining the focus was known as the "listener".

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 sloppy focus model is a variant of the followfocus model. 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

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 Tab order Focus stealing Selection (user interface)

References

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

Worked examples

Example 1 — a first encounter with Focus (computing)

Start with the simplest possible case. Write down what Focus (computing) claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Focus (computing) before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Focus (computing) ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Focus (computing)

In research
Focus (computing) appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Focus (computing) in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Focus (computing) is common in secondary-school and first-year university syllabi. It links to neighbouring topics Graphical user interfaces, User interface techniques, so understanding it makes those chapters shorter.
In everyday life
Look for Focus (computing) outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Focus (computing)” →

How to study Focus (computing) in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Focus (computing) means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Focus (computing) out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Focus (computing) in simple terms?

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. Moving the focus away from a specific user interface element is known as a blur event in relation to this element.

Why does Focus (computing) matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Focus (computing)?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Focus (computing).

Tags

  • Graphical user interfaces
  • User interface techniques

Keep exploring