diff --git a/src/App.vue b/src/App.vue index 55eaee0..7f40662 100644 --- a/src/App.vue +++ b/src/App.vue @@ -38,6 +38,9 @@ const activeFrame = computed(() => { : previewFrame2.value; }); +// Detect platform for keyboard shortcut display +const isMac = typeof navigator !== 'undefined' && navigator.platform.toUpperCase().indexOf('MAC') >= 0; + // Handle keyboard shortcuts const handleKeyboardShortcut = (event) => { // Escape key - close any open popup @@ -60,6 +63,13 @@ const handleKeyboardShortcut = (event) => { return; } + // Cmd+P (Mac) or Ctrl+P (Windows/Linux) - print + if ((event.metaKey || event.ctrlKey) && event.key === 'p') { + event.preventDefault(); + printPreview(); + return; + } + // Cmd+S (Mac) or Ctrl+S (Windows/Linux) - save if ((event.metaKey || event.ctrlKey) && event.key === 's') { event.preventDefault(); @@ -645,7 +655,7 @@ onUnmounted(() => { @close="handlePagePopupClose" /> -