Keyboard:Shortcuts
From KDE-HIG_Wiki
A keyboard shortcut is a combination of keystroke combinations that starts a command from the menu. It consists of one or more modifier and a character key, e.g. Ctrl+C. Unlike accelerators, keyboard shortcuts do not post menus but perform the action directly.
The keyboard shortcuts are displayed next to their corresponding item in the menu so that the user can learn about the shortcuts by using the application.
| Table of contents |
Keyboard Shortcuts Basics
Guidelines
- Where possible, provide standard shortcuts for the application's actions (see section Standard Keyboard Shortcuts.
- Do not use any of the shortcuts described in the section Standard Keyboard Shortcuts for any other purposes, even if they are not supported by your application.
- Assign shortcuts to the application's most commonly-used actions only. Do not assign them to items that change over time, such as Recent Files.
- Keyboard shortcuts are defined application wide, that means the same shortcut key will always start the same action.
- If the action is not supported within a certain context, no action will be taken.
- If a shortcut supports different actions in a local and a general context (see e.g. volume versus tab navigation in section keyboard navigation), the local context has priority over the general context when the local context is focused.
- For application specific shortcuts, it is recommended to use Ctrl+character in preference to other combinations.
- Shortcut keys should be chosen to be as mnemonic as possible to facilitate learning and remembering. For example, Ctrl+I would be a good shortcut for a menu item called Indent.
- When a function reverses another function, the keyboard shortcut should be Ctrl+Shift+character. For example, Ctrl+A and Ctrl+Shift+A for Select All and Deselect All.
- Do not use combinations of the Alt key without another modifier key for keyboard shortcuts, as these may conflict with window manager or menu access keys.
- Do not use symbols that require Shift or other modifiers as part of the shortcut, for example Ctrl+%. It may cause problems as symbols are accessed differently on international keyboards.
- Note that the shortcut keys are not subject to translation. The shortcut for File->Open will be Ctrl+O in all languages, even if the menu item does not contain an O in one language.
Implementation Notes
Caution: Shortcuts and accelerators are often mixed up because Qt™ and KDE use the QAccel and KAccel classes to define shortcuts, but no special classes are needed to define accelerators (see section Keyboard Accelerator Basics).
Do not hardcode shortcut keys — use the KStdAccel and its related classes for defining them. That way, your application will stay consistent with other applications if the user decides to configure other keys as shortcut keys.
Standard Keyboard Shortcuts
Guidelines
These pages are available in svn:
[1] (http://websvn.kde.org/trunk/www/areas/guidelines/html/) (Download the page keyboard_shortcuts.html)
<todo> Missing:
- Shortcut to switch into docker windows.
- How to hande toolbars? should they get keyboard focus?
- What about the panel? should it be reachable via a keyboard shortcut?
- Are all these shortcuts necessary? Is it necessary, to reserve each of them?
</todo>
Reserved Combinations
Guidelines
[2] (http://websvn.kde.org/trunk/www/areas/guidelines/html/) (Download the page keyboard_shortcuts.html)
