shortcut
Overview
The shortcut
component allows developers to register view-level keyboard shortcuts for specified actions.
Note: These shortcuts only persist while the user remains on the corresponding view. For use cases where shortcuts should persist across views, see the documentation for the ShortcutManager
JS/TS API.
Basic Example
<shortcut keys="CTRL+I" name="Show dialog" action="$:showDialog()" />
function showDialog() {
journey.dialog.simple({
title: "Success"
})
}
Reserved keys
The following keys are reserved and hence cannot be used as keys
:
CTRL+Z
CTRL+SHIFT+Z
CTRL+Y
CTRL+C
CTRL+V
CTRL+R
ESC
ENTER
BACKSPACE
DELETE
OXIDE will show an error if a reserved key combination is used:

Standard Attributes
keys
keys
Required
Type: string
Default: unset
Specify a key or key combination for the shortcut. Only one key or key combination is supported.
Example:
<shortcut keys="CTRL+I" action="$:showDialog()" />
action
action
Required
Type: JS/TS function
Default: unset
An event that calls a JS/TS $:function or navigation when a user presses the key or key combination specified in the keys
attribute.
<shortcut keys="CTRL+I" action="$:showDialog()" />
function showDialog() {
journey.dialog.simple({
title: "Success"
})
}
Advanced Attributes
name
name
Optional
Type: string
Default: unset
A human readable name to identify or describe the shortcut.
Last updated