Versionen im Vergleich

Schlüssel

  • Diese Zeile wurde hinzugefügt.
  • Diese Zeile wurde entfernt.
  • Formatierung wurde geändert.
Kommentar: Migrated to Confluence 5.3

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
themeEclipse
languagejavascript
titlegeneral configuration
initShortcuts(shortcutHolderClass, bindingConf, searchGlobal);

shortcutHolderClass (String)

String which holds the class defining the starting point of an element for searching the shortcuts actions. (e.g. for lists the class is "jax-list-generalholder-div")

bindingConf (String)

For the mapping of the shortcut keys, each shortcut can be paired with an html element id which holds the action called by the fired shortcut.

Codeblock
themeEclipse
languagejavascript
titlebindingConf example
{"newLI":"alt+n", "cpLI":"alt+k", "delLI":"alt+r", "selPrevLI":"alt+up"}
searchGlobal (boolean, [optional])

Boolean parameter which indicates if the focused field is not within the shortcutHolderClass, the shortcuts should be searched document wide instead.

If no searchGlobal param is passed, it's default value "true" is taken in place.

Configuration for list related shortcuts

...

Codeblock
themeEclipse
languagejavascript
titlelist related configuration
registerListShortcuts(simplifiedConf, searchGlobalsearchGlobalList); 
simplifiedConf (String, [optional])

JSON-String for mapping each list function to a corresponding key. ("function" : "key kombination")

Codeblock
themeEclipse
languagejavascript
titlebindingConf example
{"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:

iddescriptiondefault shortcut
newAdd a new list entryalt + ctrl + n
copyCopy the selected list entryalt + ctrl + c
deleteDelete the selected list entryalt + ctrl + d
moveUpMove the selected list entry upalt + ctrl + up
moveDownMove the selected list entry downalt + ctrl + down

...

selectPreviousSelects the previous list entryctrl + up
selectNextSelects the next list entryctrl + down

If no simplifiedConf param is passed, the defined default value is taken in place!

searchGlobalList (boolean, [optional])

Boolean parameter which indicates if the focus is not within a list, the first list in the view should be applied if available instead.

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
themeEclipse
languagejs
titleconfiguration with system variable
registerListShortcuts('${shortcutConfig}', true);

The variable shortcutConfig can be configured with the following options:

  1. Declaration with the config key jaxfront.html.shortcuts.keyConfiguration within the jaxfront.xml config file
  2. 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.

The following keys are available.

Modifier keys

  • shift
  • ctrl
  • alt
  • option
  • meta
  • command
  • mod (os dependent generic key: Windows/Linux = ctrl, Mac = command)

Special keys

  • backspace
  • tab
  • enter
  • return
  • capslock
  • esc
  • escape
  • space
  • pageup
  • pagedown
  • end
  • home
  • left
  • up
  • right
  • down
  • ins
  • del

Other keys

All other keys can be referenced by name like a, 3, /, $ ...

Browser support

  • Internet Explorer 6+
  • Safari
  • Firefox
  • Chrome