From now hotkey
can be object with key
, scope
and splitKey
or string as before.
You can define action like follow:
{
title: 'Outside action',
hotkey: {key: 'x', scope: 'outside'},
description: 'Open dialog',
onAction() {
alert('Default oustide action triggered with hotkey "x"');
},
}
This action is only active outside the cmd-dialog
, you can type freely and the x
key does not trigger any action when the dialog is open. The default behavior remains the same all keyboard hotkeys are active in any scope. The outside
scope is reserved word for any action outside cmd-dialog
.
You can also add splitKey
if you need use +
character as hotkey hotkey: {key: 'cmd-+', splitKey: '-'}
- check hotkeys-js options for more information.