feat(toolbar/hokeys): add pub sub events to hotkeys manager class, subscribe toolbar to hotkeys pressed event (#5157)

This commit is contained in:
Ibrahim authored and GitHub committed 2025-06-25 10:43:27 -04:00
1 parent b1ad3787e4
commit 57f07ad9f2
2 files changed
+30 -1

No files matched your search

+6 -1
View File
@@ -3,6 +3,7 @@ import { calculateSUVScalingFactors } from '@cornerstonejs/calculate-suv';
import getPTImageIdInstanceMetadata from './getPTImageIdInstanceMetadata';
import { registerHangingProtocolAttributes } from './hangingprotocols';
import { HotkeysManager } from '@ohif/core'
const metadataProvider = classes.MetadataProvider;
@@ -11,13 +12,17 @@ const metadataProvider = classes.MetadataProvider;
* @param {Object} servicesManager
* @param {Object} configuration
*/
export default function init({ servicesManager, commandsManager }: withAppTypes): void {
export default function init({ servicesManager, commandsManager, hotkeysManager }: withAppTypes): void {
const { toolbarService, cineService, viewportGridService } = servicesManager.services;
toolbarService.registerEventForToolbarUpdate(cineService, [
cineService.EVENTS.CINE_STATE_CHANGED,
]);
toolbarService.registerEventForToolbarUpdate(hotkeysManager, [
HotkeysManager.EVENTS.HOTKEY_PRESSED,
]);
// Add
DicomMetadataStore.subscribe(DicomMetadataStore.EVENTS.INSTANCES_ADDED, handleScalingModules);