Friday, November 27, 2009

Keep those hands on the keyboard (3): Fast dialoguing

From time to time Atlantis pops up various windows that will not go away until you "talk" to them. You have to reply to the questions asked in these windows, choose some options, etc. These windows are called modal dialogs, or simply dialogs.

Many menu commands of Atlantis display dialogs when they are activated. You can easily tell when a menu command will open a dialog: its menu caption ends with an ellipsis (3 dots). For example, this is the case with most commands in the "Insert" menu:



A typical dialog has "OK" and "Cancel" buttons in the right bottom corner, plus a cross button on the title bar:



Clicking the "OK" button registers the changes that you have made in the dialog. The "Cancel" button obviously discards any changes. Clicking the cross button is equivalent to pressing the "Cancel" button.

Of course, any of these three buttons can be clicked with the mouse. But you can also "click" them from the keyboard.

Let's start with the "OK" button. It initially displays with a thicker border:



This means that the "OK" button is the "default button" of this dialog. A "default button" can be "clicked" by pressing the Enter key. So when you need to click the "OK" button in a dialog, you can simply press Enter. Note that this works only when the "OK" button has a special thicker border around it.

"Clicking" the "Cancel" button from the keyboard is also extremely easy. You only have to press the Esc key to close the dialog and cancel all the changes made in it.

Now here are more ways you can communicate with dialogs through the keyboard. Let's take the "Tools | Options..." dialog as an example:



* When a dialog has multiple tabs, as the "Tools | Options..." dialog:



switching over to the next tab is done by pressing Ctrl+Tab. And again repeatedly until you reach the appropriate tab.


* In most cases, one of the controls (GUI elements) of a dialog is focused (ie has the input focus). This means that you can interact with the focused element through the keyboard.

How do you find out which of the dialog elements is focused?

Focused buttons have a dotted rectangle around them:



And so have check or "tick" boxes:



When a button is focused, you can press the Space bar or the Enter key to run the corresponding command.

When a checkbox is focused, pressing the Space bar checks or unchecks the box, and hence activates or inactivates the corresponding option.

Text edit boxes can also be focused. In the absence of a selection, focused edit boxes display a blinking caret:



and any selection with a special color:



So whenever an edit box is focused, the text in it behaves pretty much like any editable text in the document window.

You can use the arrow keys to select its text or just move the blinking caret within the box.
You can press Ctrl+C to copy the edit box selection to the clipboard, or Ctrl+V to paste the clipboard text into the edit box.
You can press Del or the Backspace key to remove any selection within the edit box.
In the absence of a selection, the Backspace key allows you to erase one character at a time, going backwards.
And obviously, you can also type text directly into the focused edit box.


Focused boxes with attached drop-down lists display with a special background color:



or with a dotted rectangle:



When such a drop-down box is focused, you can use the arrow keys to cycle through the list items. You can also press Alt+Down Arrow to display the whole drop down list, and again cycle through the list items with the arrow keys:



When focused, ordinary list boxes display a dotted rectangle around the selected item:



When such a list box is focused, you can also use the arrow keys to cycle through the list items.


* Dialog elements become focused when you click them with the mouse. But you can also press the Tab key to switch focus from one dialog element to another. Pressing the Tab key repeatedly takes you from one element to the next until the desired element becomes focused.


* Most dialog elements have associated keyboard accelerators. If you press the Alt key in any dialog of Atlantis, you will notice underlined letters within most captions:



If you maintain the Alt key down and press the corresponding letter keys, you will "click" the corresponding element of a dialog. In other words, you will either

  • focus the related list,
  • check or uncheck the associated option,
  • or actually press the target button.

For example, pressing Alt+Z when the above dialog is showing is the same as clicking its "Font Sizes..." button.

No comments: