diff --git a/src/common/shortcuts.ts b/src/common/shortcuts.ts index 42a17c3f..9092f285 100644 --- a/src/common/shortcuts.ts +++ b/src/common/shortcuts.ts @@ -3,13 +3,18 @@ export const shortcutEvents: { [key: string]: { l18n: string; l18nParam?: string 'close-tab': { l18n: 'message.closeTab', context: 'tab' }, 'next-tab': { l18n: 'message.nextTab', context: 'tab' }, 'prev-tab': { l18n: 'message.previousTab', context: 'tab' }, - 'open-connections-modal': { l18n: 'message.allConnections' }, - 'toggle-console': { l18n: 'message.toggleConsole' } + 'open-all-connections': { l18n: 'message.openAllConnections' }, + 'toggle-console': { l18n: 'message.toggleConsole' }, + 'save-content': { l18n: 'message.saveContent' }, + 'run-or-reload': { l18n: 'message.runOrReload' }, + 'create-connection': { l18n: 'message.createNewConnection' }, + 'open-settings': { l18n: 'message.openSettings' }, + 'open-scratchpad': { l18n: 'message.openScratchpad' } }; interface ShortcutRecord { event: string; - keys: Electron.Accelerator[]; + keys: Electron.Accelerator[] | string[]; /** Needed for default shortcuts */ os: NodeJS.Platform[]; } @@ -18,6 +23,16 @@ interface ShortcutRecord { * Default shortcuts */ const shortcuts: ShortcutRecord[] = [ + { + event: 'run-or-reload', + keys: ['F5'], + os: ['darwin', 'linux', 'win32'] + }, + { + event: 'save-content', + keys: ['CommandOrControl+S'], + os: ['darwin', 'linux', 'win32'] + }, { event: 'open-new-tab', keys: ['CommandOrControl+T'], @@ -49,7 +64,7 @@ const shortcuts: ShortcutRecord[] = [ os: ['linux', 'win32'] }, { - event: 'open-connections-modal', + event: 'open-all-connections', keys: ['Shift+CommandOrControl+Space'], os: ['darwin', 'linux', 'win32'] }, diff --git a/src/renderer/App.vue b/src/renderer/App.vue index d67852e5..5a683508 100644 --- a/src/renderer/App.vue +++ b/src/renderer/App.vue @@ -67,7 +67,7 @@ const { changeApplicationTheme } = settingsStore; const isAllConnectionsModal: Ref = ref(false); -ipcRenderer.on('open-connections-modal', () => { +ipcRenderer.on('open-all-connections', () => { isAllConnectionsModal.value = true; }); diff --git a/src/renderer/components/BaseConfirmModal.vue b/src/renderer/components/BaseConfirmModal.vue index f0ae2a2e..76481f79 100644 --- a/src/renderer/components/BaseConfirmModal.vue +++ b/src/renderer/components/BaseConfirmModal.vue @@ -68,6 +68,10 @@ const props = defineProps({ disableAutofocus: { type: Boolean, default: false + }, + closeOnConfirm: { + type: Boolean, + default: true } }); const emit = defineEmits(['confirm', 'hide']); @@ -90,7 +94,7 @@ const modalSizeClass = computed(() => { const confirmModal = () => { emit('confirm'); - hideModal(); + if (props.closeOnConfirm) hideModal(); }; const hideModal = () => { diff --git a/src/renderer/components/KeyPressDetector.vue b/src/renderer/components/KeyPressDetector.vue index b08dc538..40d56325 100644 --- a/src/renderer/components/KeyPressDetector.vue +++ b/src/renderer/components/KeyPressDetector.vue @@ -1,10 +1,9 @@