2.4. Working with a MouseLet's look at basics of using a mouse or other pointing device. We assume that your mouse has three buttons, as mice on Unix systems usually do. (If your mouse has two buttons, you may be able to simulate the missing middle button by pressing both of the other buttons at once. Your X system may need to be reconfigured to work this way, though.) When we say "the first button," we mean the leftmost button for right-handed users, or the rightmost button for left-handed users. (Under X, a mouse can be set for either left-handed or right-handed users, so the button you use to click on and drag is the button under your index finger.) 2.4.1. Pointer ShapeAs you move the mouse pointer[6] from the desktop on to other windows or menus, the shape of the pointer changes. For instance, on some window systems, while the pointer is over the desktop, it's shaped like a big X. The pointer may change to an hourglass shape to tell you to wait. When you resize a window, the pointer could change to a cross with arrows.
2.4.2. Using a Mouse with xterm WindowsOne advantage terminal windows have over plain (nonwindowing) terminals is you can copy and paste text within an xterm window or between xterm windows. NOTE: Although this section is specifically about xterm windows, most tips here also apply to other kinds of terminal windows. Check your documentation or just try these and see! To get started, move the pointer inside an xterm window and be sure it has the focus (if your window manager doesn't do that automatically). Notice that the pointer changes to an "I-beam" shape as you move it into the window. We discuss this I-beam pointer later in this section. There's also a block cursor (which is shown in all terminal windows in this chapter--and labeled at Figure 2-4.) The block cursor is the window's insertion point, where text goes when you type on the keyboard. The block cursor doesn't follow the mouse. If your window doesn't have some previously completed command lines, as in Figure 2-3, type command lines at a couple of prompts; this gives you text to copy. (The mail command, shown in Figure 2-3 and explained in Chapter 6, is a good example, but you can use any command line that you want to rerun from another window.) The I-beam pointer selects text for copying. Let's try it. Point to the first character of a command line (not the prompt) and click the first mouse button. Next, move the pointer to the end of the text you want to select and click the third button. The text between the first and third clicks should be highlighted; your xterm window should look something like Figure 2-3. (Problems? If you select the wrong text, you can undo the selection by clicking the first button anywhere in the window. If you accidentally click the second button, this may paste some random text at the block cursor; in that case, you can erase the pasted text with your backspace key.) Another way to select text is by pointing to the first character you want to copy, then holding down the first mouse button while you drag the pointer across the text. By the time you release the mouse button, the whole area of text should be highlighted. The instant you highlight text (as you did a moment ago), the text is also automatically copied, so you can paste it somewhere else. (In an original xterm window, there's no menu with a "Copy" command on it. In most X window programs--the original X programs, at least--highlighting text copies it automatically.) You can paste text in the window you copied it from or in another window. Let's choose another open terminal window. With the block cursor at a shell prompt, click the middle mouse button anywhere in the window. (You don't have to click at the block cursor!) The selected text will be inserted (pasted) into the window at the block cursor, just as if you had typed it in. Press RETURN to run the command; otherwise, backspace over it to get back to the prompt. You can also select text in a window just by clicking. Point to a word and double-click the first button; the word should be highlighted. Next, let's select an entire line. Point to any character on a line (a space is OK too) and triple-click the first button to highlight the whole line. You can select and copy any text, not just command lines. With the mail command, for instance, you can copy a line from the body of the email message. Figure 2-3. Copying a command lineThe same copying and pasting works between xterm windows and between many other (but not all) windows that handle text. Before you paste text into an xterm window, always be sure the block cursor is at the place you want to insert the newly pasted text! 2.4.2.1. Problem checklist
Copyright © 2003 O'Reilly & Associates. All rights reserved. |
|