From 0492bdd969888b4c010c74a9edbf12dc59d2f9be Mon Sep 17 00:00:00 2001 From: Ceebug Date: Wed, 23 Sep 2026 19:39:40 +1000 Subject: [PATCH] Prevent print dialog with keyboard shortcuts Add prevention for print dialog opening with Ctrl+P/Cmd+P. Signed-off-by: Ceebug --- packages/ui/src/composables/i18n-debug.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/ui/src/composables/i18n-debug.ts b/packages/ui/src/composables/i18n-debug.ts index 384e14eb322..608f289ea1c 100644 --- a/packages/ui/src/composables/i18n-debug.ts +++ b/packages/ui/src/composables/i18n-debug.ts @@ -239,6 +239,14 @@ function setupKeyTooltip() { function registerKeyboardShortcuts(panelOpen: Ref, keyReveal: Ref) { useEventListener(document, 'keydown', (e: KeyboardEvent) => { + // Prevent the browser/app print dialog from opening with Ctrl+P / Cmd+P + if (e.ctrlKey || e.metaKey) { + if (e.code === 'KeyP') { + e.preventDefault() + return + } + } + // Use Cmd on macOS, Ctrl on other platforms const mod = e.metaKey || e.ctrlKey if (!mod || !e.shiftKey) return