Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Примеры брендбуков / apple_osx-aqua-human-interface.pdf
Скачиваний:
17
Добавлен:
16.02.2016
Размер:
8.01 Mб
Скачать

C H A P T E R 9

User Input

Command

On most keyboards, the Command key is labeled with a cloverleaf symbol () and an Apple logo ( ). Pressing the Command key at the same time as a character key tells the application to interpret the key as a command rather than a character. These key combinations are described in “Reserved and Recommended Keyboard Equivalents” (page 176).

In some applications, the Command key is used with other keys to provide special functions or shortcuts. It can also be used with the mouse to modify the effect of a click or drag.

Control

The Control key is used to modify the functions of other keys, with terminal-emulation programs for Control-key sequences, and, with a mouse click, to display contextual menus (see “Contextual Menus” (page 64)).

In Mac OS X 10.1 and later, Control-F7 temporarily overrides a user’s preference for simple navigation or full keyboard navigation in windows and dialogs. For more information, see “Keyboard Focus and Navigation” (page 182).

Cocoa developers should also consider additional behaviors, as described in the Programming Topic “Text System Defaults and Key Bindings,” available on the Mac OS X developer documentation website.

Arrow Keys

Apple keyboards have four arrow keys: Up Arrow, Down Arrow, Left Arrow, and Right Arrow. They can be used alone or in combination with other keys. Keyboard combinations using the arrow keys should be used only for shortcuts for mouse actions. It is never appropriate to implement only a keyboard combination and not provide a mouse-based way to perform the same action.

Appropriate Uses for the Arrow Keys

You can use arrow keys in these ways:

In text, the arrow keys move the insertion point. When used with the Shift key, they extend or shrink the selection. If the user makes a selection and then presses the Right Arrow or Left Arrow, shrink the selection to zero length and place the insertion point at the right or left edge of the selection.

170The Keyboard

Apple Computer, Inc. June 2002

C H A P T E R 9

User Input

In lists, the arrow keys change the selection.

In a graphics application, the arrow keys can be used to move a selected object the smallest possible increment (one pixel or one grid unit).

In full keyboard access mode, the arrow keys move between values within a control. This behavior is described in “Keyboard Focus and Navigation” (page 182).

Don’t use the arrow keys to

move the mouse pointer onscreen

duplicate the function of the scroll bars

If it’s important for your application to make use of the numeric keypad, don’t use the Shift–arrow key combinations to extend text selections; the keypad’s codes for the four Shift–arrow key combinations are the same as those for the keypad’s

+, *, /, and = keys.

Moving the Insertion Point

When the insertion point moves vertically in a text document, its horizontal position is maintained in terms of screen pixels, not characters (in other words, the insertion point could move from the twenty-fifth character in a line down to the fiftieth character, depending on the font and size). As the insertion point moves from line to line, keep it as close as possible to its original horizontal position, moving it slightly left or right to the nearest new character boundary.

The Option and Command keys are used as semantic modifiers with the arrow keys. As a general rule, the Option key increases the size of the semantic unit by one compared to the arrow keys alone, and Command key enlarges the semantic unit again. The application determines what the semantic units are. In a word processor, typically the units are characters, words, lines, paragraphs, and documents. In a spreadsheet, a basic semantic unit could be a cell.

The Keyboard

171

Apple Computer, Inc. June 2002

C H A P T E R 9

User Input

Table 9-1 describes the appropriate behavior of the arrow keys in text documents and fields. In some cases, the behavior describes what happens when the indicated keys are pressed more than once in succession.

Table 9-1 Moving the insertion point with the arrow keys

Key

Moves insertion point

Right Arrow

One character to the right

 

 

Left Arrow

One character to the left

 

 

Up Arrow

To the line above, to the nearest character boundary

 

at the same horizontal location

 

 

Down Arrow

To the line below, to the nearest character boundary

 

at the same horizontal location

 

 

Option–Right Arrow

To end of current word, then to the end of the next

 

word

 

 

Option–Left Arrow

To the beginning of the current word, then to the

 

beginning of the previous word

 

 

Option–Up Arrow

To the beginning of the current paragraph, then to

 

the beginning of the previous paragraph

 

 

Option–Down Arrow

To the end of the current paragraph, then to the end

 

of the next paragraph (not to the blank line after the

 

paragraph, if there is one)

 

 

Command–Right Arrow

To the next semantic unit, typically the end of the

 

current line, then the end of the next line

 

 

Command–Left Arrow

To the previous semantic unit, typically the

 

beginning of the current line, then the previous unit

 

 

Command–Up Arrow

Upward in the next semantic unit, typically the

 

beginning of the document

 

 

Command–Down Arrow

Downward in the next semantic unit, typically the

 

end of the document

 

 

Note: For non-Roman script systems, Command–Left Arrow and Command–Right Arrow are reserved for changing the direction of keyboard input.

172The Keyboard

Apple Computer, Inc. June 2002

C H A P T E R 9

User Input

Extending Text Selection With the Shift and Arrow Keys

Table 9-2 describes how to extend text selection by pressing the Shift key with the arrow keys.

If no text is selected, the extension begins at the insertion point. If text is selected by dragging, then the extension begins at the selection boundary. For example, in the phrase stop time, if the user places the insertion point between the “s” and “t” and then presses Shift–Option–Right Arrow, top is selected. However, if the user double-clicks so the whole word is selected, and then extends the selection left or up, it’s as if the insertion point were before the “s.” If the user extends the selection right or down, it’s as if the insertion point were between the “p” and the space after the word.

Reversing the direction of the selection deselects the appropriate unit. In the previous example, if the word stop is selected and the user presses Shift–Option–Right Arrow, so stop time is selected, and then presses Shift–Option–Left Arrow, time is deselected and stop remains selected.

Table 9-2 Extending text selection with the Shift and arrow keys

Keys

Extends selection

Shift–Right Arrow

One character to the right

 

 

Shift–Left Arrow

One character to the left

 

 

Shift–Up Arrow

To the line above, to the nearest character

 

boundary at the same horizontal location

 

 

Shift–Down Arrow

To the line below, to the nearest character

 

boundary at the same horizontal location

 

 

Shift–Option–Right Arrow

To the end of the current word, then to the end

 

of the next word

 

 

Shift–Option–Left Arrow

To the beginning of the current word, then to

 

the beginning of the previous word

 

 

Shift–Option–Up Arrow

To the beginning of the current paragraph, then

 

to the beginning of the next paragraph

 

 

The Keyboard

173

Apple Computer, Inc. June 2002

Соседние файлы в папке Примеры брендбуков