diff --git a/apps/red-ui/src/app/modules/file-preview/file-preview-screen.component.ts b/apps/red-ui/src/app/modules/file-preview/file-preview-screen.component.ts index 1964f966f..63c9a75d3 100644 --- a/apps/red-ui/src/app/modules/file-preview/file-preview-screen.component.ts +++ b/apps/red-ui/src/app/modules/file-preview/file-preview-screen.component.ts @@ -21,6 +21,7 @@ import { Debounce, ErrorService, FilterService, + HelpModeService, List, LoadingService, NestedFilter, @@ -132,6 +133,7 @@ export class FilePreviewScreenComponent private readonly _fileManagementService: FileManagementService, private readonly _translateService: TranslateService, private readonly _readableRedactionsService: ReadableRedactionsService, + private readonly _helpModeService: HelpModeService, ) { super(); document.documentElement.addEventListener('fullscreenchange', () => { @@ -376,6 +378,17 @@ export class FilePreviewScreenComponent this.toggleFullScreen(); return; } + + if (['h', 'H'].includes($event.key)) { + if ($event.target instanceof HTMLInputElement || $event.target instanceof HTMLTextAreaElement) { + return; + } + this._ngZone.run(() => { + window.focus(); + this._helpModeService.activateHelpMode(false); + }); + return; + } } async viewerReady(pageNumber: string = this._activatedRoute.snapshot.queryParams.page) { diff --git a/apps/red-ui/src/app/modules/file-preview/utils/constants.ts b/apps/red-ui/src/app/modules/file-preview/utils/constants.ts index bedb27197..14ec193cf 100644 --- a/apps/red-ui/src/app/modules/file-preview/utils/constants.ts +++ b/apps/red-ui/src/app/modules/file-preview/utils/constants.ts @@ -11,7 +11,7 @@ export const ActionsHelpModeKeys = { 'hint-image': 'picture', } as const; -export const ALL_HOTKEYS: List = ['Escape', 'F', 'f', 'ArrowUp', 'ArrowDown'] as const; +export const ALL_HOTKEYS: List = ['Escape', 'F', 'f', 'ArrowUp', 'ArrowDown', 'H', 'h'] as const; export const HeaderElements = { SHAPE_TOOL_GROUP_BUTTON: 'SHAPE_TOOL_GROUP_BUTTON', diff --git a/apps/red-ui/src/app/modules/pdf-viewer/services/document-viewer.service.ts b/apps/red-ui/src/app/modules/pdf-viewer/services/document-viewer.service.ts index 487fb69bd..cbc960487 100644 --- a/apps/red-ui/src/app/modules/pdf-viewer/services/document-viewer.service.ts +++ b/apps/red-ui/src/app/modules/pdf-viewer/services/document-viewer.service.ts @@ -58,7 +58,7 @@ export class REDDocumentViewer { return fromEvent(this.#document, 'keyUp').pipe( tap(stopAndPreventIfNotAllowed), filter($event => ($event.target as HTMLElement)?.tagName?.toLowerCase() !== 'input'), - filter($event => $event.key.startsWith('Arrow') || $event.key === 'f'), + filter($event => $event.key.startsWith('Arrow') || $event.key === 'f' || ['h', 'H'].includes($event.key)), tap(stopAndPrevent), log('[PDF] Keyboard shortcut'), );