The keyboard shortcut handler component uses the Javascript library Mousetrap (https://github.com/ccampbell/mousetrap).
Inhalt |
---|
Installation
...
To use the keyboard shortcuts handling, the following JavaScript resources must be included in the header of the used HTML template where all the other JavaScript libraries are defined (e.g. templates/Root.html):
...
Codeblock | ||||||
---|---|---|---|---|---|---|
| ||||||
{"new":"alt+n", "copy":"alt+k", "delete":"alt+r", "moveUp":"alt+u", "moveDown":"alt+i", "selectPrevious":"alt+up", "selectNext":"alt+down"} |
Available id's are:
id | description | default shortcut |
---|---|---|
new | Add a new list entry | alt + ctrl + n |
copy | Copy the selected list entry | alt + ctrl + c |
delete | Delete the selected list entry | alt + ctrl + d |
moveUp | Move the selected list entry up | alt + ctrl + up |
moveDown | Move the selected list entry down | alt + ctrl + down |
selectPrevious | Selects the previous list entry | ctrl + up |
selectNext | Selects the next list entry | ctrl + down |
If no simplifiedConf param is passed, the following defined default value is taken in place:
{"new":"alt+ctrl+n", "copy":"alt+ctrl+c", "delete":"alt+ctrl+d", "moveUp":"alt+ctrl+up", "moveDown":"alt+ctrl+down", "selectPrevious":"ctrl+up", "selectNext":"ctrl+down"}!
searchGlobalList (boolean, [optional])
...
If no searchGlobalList param is passed, it's default value "true" is taken in place.
System Variables
To simplify the configuration of the shortcuts, the system variable shortcutConfig can be used within the javascript call.
Codeblock | ||||||
---|---|---|---|---|---|---|
| ||||||
registerListShortcuts('${shortcutConfig}', true); |
The variable shortcutConfig can be configured with the following options:
- Declaration with the config key jaxfront.html.shortcuts.keyConfiguration within the jaxfront.xml config file
- Setup throug the Global-Definitions with the function setShortcutKeyConfiguratio(String) of GlobalDefinition.java
Supported keys/shortcuts
The shortcuts should be defined as combination like "alt+n", with the plus as seperator.
...