fix: Store hotkeys to specified name (#3280)

* fix: Store hotkeys to specified name

* fix: Move hotkey name into a new hotkey object
This commit is contained in:
Bill Wallace authored and GitHub committed 2023-03-28 12:15:55 -04:00
1 parent b2128976a3
commit 2f33e42004
4 files changed
+32 -16

No files matched your search

+10 -2
View File
@@ -315,7 +315,9 @@ handles creation of the displaySets.
### Hotkeys
`hotkeys` is another property in the configuration of a mode that can be defined
to add the specific hotkeys to the viewer at all routes.
to add the specific hotkeys to the viewer on the mode route. Additionally, the
name under which the hotkeys are stored can be configured as `hotkeyName`.
This allows user customization of the mode specific hotkeys.
```js
// default hotkeys
@@ -347,7 +349,13 @@ function modeFactory() {
/*
...
*/
hotkeys: [..hotkeys.defaults.hotkeyBindings, ...myHotkeys],
hotkeys: {
// The name in preferences to use for this set of hotkeys
// Allows defining different sets for different modes
name: 'custom-hotkey-name',
// And the actual custom values here.
hotkeys:[..hotkeys.defaults.hotkeyBindings, ...myHotkeys]
},
}
}