Keyboard:Mnemonics

From KDE-HIG_Wiki

An accelerator key provides another keyboard alternative to activate a menu or other interface elements. It is an alphanumeric key that must be pressed simultaneously with a Meta-key, usually Alt, to select an item which is visible on the screen. The accelerator key is marked by underlining the corresponding character in the menu title, the menu item, or in other interface components.


For example, to choose the Quit command from the File menu, the user has to hold the Alt key and F to post the File menu, and then press Q to quit the application.


Note that accelerator keys are subject to translation: a French menu will have different accelerators from those of an English menu.


Table of contents

Keyboard Accelerator Basics


Guidelines


Provide accelerator keys for all application features, especially menu titles, menu items, and controls within dialogs.


When possible, provide standard accelerators for the application's actions (see section Standard Keyboard Accelerators.


Avoid conflicts among the application's accelerator keys. For example, R cannot be used for both the Reload and the Open Recent command of the equal menu (in this case the File menu).


When defining application-specific accelerators, start with the most frequently used controls.


Assign the first letter of the label as the accelerator key, or of one of its other words if it has more than one. If another letter provides a better association (e.g. X in Export), consider using that instead.


If the first letter of the item conflicts with those of other items, choose a prominent consonant.


If the first letter of the menu item and the prominent consonant conflict with those of other menu items, choose a prominent vowel.


Implementation Notes


No special classes are needed to define accelerators. An accelerator is created automatically by QLabel. The developer or translator can specify which key to use as accelerator by preceding this character in the label text with an ampersand (&).



Standard Keyboard Accelerators

Browse these pages at http://www.kde.org/areas/guidelines/html/keyboard_accelerators.html