Полезная информация

Learning the Unix Operating System

Learning the Unix Operating SystemSearch this book
Previous: 2.3 Running ProgramsChapter 2
Using Window Systems
Next: 2.5 Working with Windows
 

2.4 Working with a Mouse

Let's look at some basics of using a mouse or other pointing device.

2.4.1 Pointer Shape

As you move the mouse pointer [1] from the root window onto other windows or menus, the shape of the pointer will change. For instance, on the root window, the pointer is a big X. The pointer may change to an hourglass shape to tell you to wait. When you resize a window, the pointer changes to a cross with arrows.

[1] The correct word for this symbol is cursor. But xterm and some other windows also have separate cursors to show where text will be entered. To avoid confusion, we use the word "pointer" for the cursor that moves all across the display under control of the mouse.

2.4.2 Pointing, Clicking, and Dragging

What's "pointing and clicking"? That's when you move the pointer to a place (usually over part of a window), then quickly press and release a mouse button (usually the first button). It's the same idea as pressing a button on a telephone or another electronic appliance.

Something else you'll do is "dragging." That means moving the pointer to a place (such as the corner of a window), then pressing a mouse button and holding it down while you move the pointer. This is called "dragging" a pointer or object, because the object will be dragged along with the pointer until you let go of the mouse button.

2.4.3 Using a Mouse with xterm Windows

Xterm windows have an advantage over plain UNIX terminals in that you can copy and paste text within a window or between windows. To get started, move the pointer inside an xterm window and select the window (set the focus there). Notice that the pointer changes to an "I-beam" shape. There's also a block cursor. As you type, notice that text you input appears at the block-shaped cursor, just like it would on a standard terminal. So, think of the block cursor as the window's input point.

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. (If you accidentally click another button, you may need to start over.) Your xterm window should look something like Figure 2.3.

Next, click (don't hold) the second (middle) mouse button. The selected text will be copied into the window at the block cursor, just as if you had typed it in. Press [RETURN] to run the command line; otherwise, backspace over it to get back to the prompt.

You can also select text by clicking in an xterm window. Point to a word and double-click (click twice, quickly) the first button; the word should be highlighted. Point to a line and triple-click to highlight the whole line. You can select and copy any text, not just command lines.

Figure 2.3: Copying and pasting a command line

Figure 2.3

The same copying and pasting works between xterm windows and between many other (but not all) windows that handle text. You can select text in one window and paste it into the other window. This is very handy for text editing.


Previous: 2.3 Running ProgramsLearning the Unix Operating SystemNext: 2.5 Working with Windows
2.3 Running ProgramsBook Index2.5 Working with Windows

The UNIX CD Bookshelf NavigationThe UNIX CD BookshelfUNIX Power ToolsUNIX in a NutshellLearning the vi Editorsed & awkLearning the Korn ShellLearning the UNIX Operating System