This module type adds the ability for an add-on to declare keyboard shortcuts. Currently only available for Jira.
A Connect keyboard shortcut can perform one of three actions: navigate to a page, open a dialog module, or invoke an action represented by a web-item on a page. Pages, dialog modules and web-items referenced by the shortcut must be declared by the same add-on.
A shortcut is identified by a sequence of letters which need to be pressed in order for the shortcut action to be invoked. You cannot declare shortcuts that would shadow shortcuts defined by the product. A shortcut shadows all shortcuts which start with its sequence.
On the other hand, it's possible to shadow shortcuts defined by the same or other add-ons, although those won't be accessible anymore.
In case multiple shortcuts have the same sequence, there is no guarantee on which will be invoked.
Example
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
{
"modules": {
"keyboardShortcuts": [
{
"shortcut": "gmm",
"target": {
"key": "page-key"
},
"context": "global",
"name": {
"value": "My keyboard shortcut"
},
"key": "keyboard-shortcut-key"
}
]
}
}
key
Type | |
Max length | 100 |
Required | Yes |
Pattern | ^[a-zA-Z0-9-]+$ |
Description | A key to identify this module. This key must be unique relative to the add on, with the exception of Confluence macros: Their keys need to be globally unique. Keys must only contain alphanumeric characters and dashes. The key is used to generate the url to your add-on's module. The url is generated as a combination of your add-on key and module key. For example, an add-on which looks like: 1 2 3 4 5 6 7 8 9
Will have a configuration page module with a URL of |
name
Type | |
Required | Yes |
Description | A human readable name. Represents a string that can be resolved via a localization properties file. You can use the same Example1 2 3 4
|
value |
| ||||||||
i18n |
|
shortcut
Type | |
Max length | 3 |
Required | Yes |
Pattern | [a-z]{1,3} |
Description | The shortcut sequence. The current limitations are
|
target
Type | |
Required | Yes |
Description | The target must be the key of another module defined by the add-on. Below are the actions which will be executed by the shortcut depending on the module type of the target.
The bean containing the key of the target module of the shortcut. |
key |
|
context
Type | |
Allowed values |
|
Description | The context in which the shortcut will be available. This is optional, if not given the shortcut is assumed to be global. Different products define different contexts. Jira supported contexts:
|
Rate this page: