Sunday, June 13, 2010

Controlling Windows : Changing the Input Focus

When you type on the keyboard, the window manager directs the characters you type somewhere, usually to a window. The active window is the window accepting input from the keyboard; it is said to have the input focus. Depending on how you set up your account, you can use the mouse in one of three ways to change the input focus:

• Click-to-focus (explicit focus)—Gives the input focus to a window when you click the window. That window continues to accept input from the keyboard regardless of the location of the mouse pointer. The window loses the focus when you click another window. Although clicking the middle or right mouse button also activates a window, use only the left mouse button for this purpose; other buttons may have unexpected effects when you use them to activate a window.

• Focus-follows-mouse (sloppy focus, enter-only, or focus-under-mouse)— Gives the input focus to a window when you move the mouse pointer onto the window. That window maintains the input focus until you move the mouse pointer onto another window, at which point the new window gets the focus. When you move the mouse pointer off a window and onto the root window, the window that had the input focus does not lose it.

• Focus-strictly-under-mouse (enter-exit focus)—Gives the input focus to a window when you move the mouse pointer onto the window. That window maintains the input focus until you move the mouse pointer off the window, at which point no window has the focus. When you move the mouse pointer off a window and onto the root window, the window that had the input focus loses it, and input from the keyboard is lost.

You can use the Window Preferences window to change the focus policy. Under Fedora, you must install the control-center-extra package before you can display this window. To display this window, select Main menu: System -> Preferences -> Windows or give the command gnome-window-properties from a terminal emulator or Run Application window (ALT-F2). Put a tick in the check box next to Select windows when the mouse moves over them to select the focusfollows- mouse policy. When there is no tick in this check box, click-to-focus is in effect. Click Close. Focus-strictly-under-mouse is not available from this window.

To determine which window has the input focus, compare the window borders. The border color of the active window is different from the others or, on a monochrome display, is darker. Another indication that a window is active is that the keyboard cursor is a solid rectangle; in windows that are not active, the cursor is an outline of a rectangle.

Use the following tests to determine which keyboard focus method you are using. If you position the mouse pointer in a window and that window does not get the input focus, your window manager is configured to use the click-to-focus method. If the border of the window changes, you are using the focus-follows-mouse or focusstrictly-under-mouse method. To determine which of the latter methods you are using, start typing something, with the mouse pointer positioned on the active window. Then move the mouse pointer over the root window and continue typing. If characters continue to appear within the window, you are using focus-followsmouse; otherwise, you are using focus-strictly-under-mouse.


Source of Information : Prentice Hall A.Practical Guide to Fedora and Red Hat Enterprise Linux 5th Edition

No comments: