The workbench defines many keyboard accelerators for invoking common actions with the keyboard. When your plug-in defines a new action using the actionSets or editorActions extension points, an accelerator attribute can be specified with any action. This is one way to establish the key combination that will invoke the action. However, allowing each plug-in to define their own accelerator keys for actions introduces several problems:
In order to alleviate these problems, the platform defines a configurable key binding strategy that is extendable by plug-ins. It solves the problems listed above and introduces new capabilities:
The basic strategy is that plug-ins use action definitions to define semantic actions. Action definitions are simply declarations of an action. They do not define an implementation for the action. When a plug-in defines an action for an editor, action set, or view, the action can specify that it is an implementation of one of these action definitions. This allows semantically similar actions to be associated with the same action definition.
Meanwhile, plug-ins can define accelerator sets that map action definitions to key combinations. These accelerator sets can be grouped into accelerator configurations that the user may activate via the Preferences dialog.
Finally, plug-ins can define accelerator scopes which determine the lookup order for key bindings.
This is all best understood by walking through the workbench and looking at how actions and accelerators are declared. We'll look at all of this from the point of view of defining key bindings for existing actions.