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 Name | Default Hotkey | Description |
|---|---|---|
PAGE_NEXT | PageDown | Move to the next page |
PAGE_PREV | PageUp | Move to the previous page |
PAGE_FIRST | Home | Move to the first page |
PAGE_LAST | End | Move to the last page |
ZOOM_IN | CTRL + + | Increase the zoom level |
ZOOM_OUT | CTRL + - | Decrease the zoom level |
ZOOM_RESET | CTRL + 0 | Reset the zoom to the default level |
ZOOM_FIT_BOTH | CTRL + 1 | Dynamically fit pages vertical and horizontal |
ZOOM_FIT_WIDTH | CTRL + 2 | Dynamically fit pages horizontal |
ZOOM_FIT_HEIGHT | CTRL + 3 | Dynamically fit pages vertical |
ROTATE_LEFT | CTRL + ArrowLeft | Rotate the selected page to the left |
ROTATE_RIGHT | CTRL + ArrowRight | Rotate the selected page to the right |
PRINT | CTRL + p | Export the current document as PDF |
OPEN_FILE | CTRL + o | Opens/uploads a new file |
SIMPLE_SEARCH_DOCUMENT | CTRL + f | Open the search popup |
FOCUS_VIEWER | CTRL + ALT + v | Move the keyboard focus into the viewer area |
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
SHIFTuse the lower-case letter (p,o,f), withSHIFTuse the upper-case letter (P,O,F). - Keys that YAML would otherwise interpret as something else must be quoted, e.g.
"-","1","0".
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.