Skip to main content

Keyboard-Hotkeys

The jadice web viewer contains a set of predefined keyboard hotkeys that allow users to quickly perform common actions such as opening files, printing, rotating pages, adjusting the zoom level, or navigating between pages.

The currently active hotkeys are also listed inside the viewer itself, in the shortcuts panel. The panel always reflects the effective configuration, so it is a good way to verify a customization.

Default Hotkeys

Action NameDefault HotkeyDescription
PAGE_NEXTPageDownMove to the next page
PAGE_PREVPageUpMove to the previous page
PAGE_FIRSTHomeMove to the first page
PAGE_LASTEndMove to the last page
ZOOM_INCTRL + +Increase the zoom level
ZOOM_OUTCTRL + -Decrease the zoom level
ZOOM_RESETCTRL + 0Reset the zoom to the default level
ZOOM_FIT_BOTHCTRL + 1Dynamically fit pages vertical and horizontal
ZOOM_FIT_WIDTHCTRL + 2Dynamically fit pages horizontal
ZOOM_FIT_HEIGHTCTRL + 3Dynamically fit pages vertical
ROTATE_LEFTCTRL + ArrowLeftRotate the selected page to the left
ROTATE_RIGHTCTRL + ArrowRightRotate the selected page to the right
PRINTCTRL + pExport the current document as PDF
OPEN_FILECTRL + oOpens/uploads a new file
SIMPLE_SEARCH_DOCUMENTCTRL + fOpen the search popup
FOCUS_VIEWERCTRL + ALT + vMove the keyboard focus into the viewer area
note

These are exactly the actions that the viewer registers as hotkeys. Only these action names can be customized — any other value for actionName is silently ignored.

Customize Keyboard Hotkeys via application.yml

Configuration Setup

The application configuration file allows customizing existing keyboard hotkeys by overriding the defaults. To override specific shortcuts, add the following configuration block to the application.yml file:

webtoolkit:
clientConfiguration:
keyboardHotkeys:
- actionName: PAGE_NEXT
key: PageDown
modifiers: []

- actionName: ZOOM_FIT_BOTH
key: "1"
modifiers:
- CTRL
- SHIFT

- actionName: ZOOM_OUT
key: "-"
modifiers:
- CTRL

How to apply a custom application.yml file is described in the chapter Customization.

How It Works

Action Name

The actionName field specifies which action the hotkey will trigger. See the table of default hotkeys above for the supported values.

Modifiers

The modifiers field specifies additional keys that must be pressed along with the main key. Supported modifiers are: CTRL, SHIFT, ALT and ALT_GR.

The modifiers are matched exactly: a hotkey configured with modifiers: [CTRL] does not fire when CTRL + SHIFT is pressed. For a hotkey without any modifier, write an explicit empty list:

      - actionName: PAGE_NEXT
key: PageDown
modifiers: []

Key

The key field specifies the main key that triggers the action. Its value is compared against the browser's KeyboardEvent.key value, which means:

  • Named keys are written exactly as the browser reports them, e.g. PageUp, PageDown, Home, End, ArrowLeft, ArrowRight, Escape, Enter, F3.
  • Character keys are case-sensitive, and the case has to match what the browser reports for the configured modifiers. Without SHIFT use the lower-case letter (p, o, f), with SHIFT use the upper-case letter (P, O, F).
  • Keys that YAML would otherwise interpret as something else must be quoted, e.g. "-", "1", "0".
caution

Hotkeys are registered globally on the document. Choose combinations carefully — browser shortcuts such as CTRL + w or CTRL + t cannot be intercepted reliably, and overriding common browser shortcuts may confuse users. Also make sure a combination is not assigned twice: if two actions share the same key and modifiers, only one of them will be triggered.

Default Behavior

If a hotkey is not defined in the configuration, the application will use the default predefined shortcut. This configuration block is only used to override specific default hotkeys. There is no need to include all hotkeys, only the shortcuts to be overridden need to be defined.

Hotkeys can neither be added nor removed via application.yml — the set of available actions is fixed, only their key bindings can be changed.