Viewers icon indicating copy to clipboard operation
Viewers copied to clipboard

Allow HotkeyManager runCommands with options

Open galelis opened this issue 6 years ago • 2 comments

Description

Currently we only store for a hotkey configuration:

{
   commandName: <string>,
   keys: <array[string]>,
   label: <string>,
}

We should be able to store options as well, to be used in the runCommand() so we can accomplish changes where we have dinamic options, e.g.:

{
   commandName: 'setVOI',
   keys: ['V'],
   label: 'Set Window/Level',
   options: {
      window: 500,
      level: 100,
   }
}

Adittional Items that must be considered:

  • Make sure window level presets data are store into hotkeys and nuke it from redux state
  • Make sure setZoomTool command is worked by this new changes, and we can just use the current command of setActiveTool
  • Make sure nextViewportDisplaySet and prevViewportDisplaySet is also refactored to have a single command moving next/prev using options

galelis avatar Feb 14 '20 19:02 galelis

Related:

  • https://github.com/OHIF/Viewers/pull/1429/files/48897599f6ccd0332b41d0baaa738e3d86f2c921#diff-4c16e239269d3929f2d1e13e891e0490
  • https://github.com/OHIF/Viewers/pull/1429/files/48897599f6ccd0332b41d0baaa738e3d86f2c921#diff-71595f419c1b47eac605e7332dbb9073

dannyrb avatar Feb 20 '20 20:02 dannyrb

Done in master

sedghi avatar Oct 13 '23 16:10 sedghi