From 04a2c0f1a0afeaecefaa8a87e2db3c826c099ff6 Mon Sep 17 00:00:00 2001 From: Hiroshiba Date: Sat, 27 Apr 2024 05:29:54 +0900 Subject: [PATCH] =?UTF-8?q?[fix]=20=E3=82=BD=E3=83=B3=E3=82=B0=E3=81=A7?= =?UTF-8?q?=E4=BF=9D=E5=AD=98=E3=82=B7=E3=83=A7=E3=83=BC=E3=83=88=E3=82=AB?= =?UTF-8?q?=E3=83=83=E3=83=88=E3=82=AD=E3=83=BC=E3=81=8C=E5=8A=B9=E3=81=8B?= =?UTF-8?q?=E3=81=AA=E3=81=84=E3=83=90=E3=82=B0=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Menu/MenuBar/MenuBar.vue | 29 +++++++++++++++++-------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/src/components/Menu/MenuBar/MenuBar.vue b/src/components/Menu/MenuBar/MenuBar.vue index 7f45459197..8e7b072171 100644 --- a/src/components/Menu/MenuBar/MenuBar.vue +++ b/src/components/Menu/MenuBar/MenuBar.vue @@ -34,7 +34,7 @@ import TitleBarButtons from "./TitleBarButtons.vue"; import TitleBarEditorSwitcher from "./TitleBarEditorSwitcher.vue"; import { useStore } from "@/store"; import { base64ImageToUri } from "@/helpers/imageHelper"; -import { useHotkeyManager } from "@/plugins/hotkeyPlugin"; +import { HotkeyAction, useHotkeyManager } from "@/plugins/hotkeyPlugin"; const props = defineProps<{ /** 「ファイル」メニューのサブメニュー */ @@ -477,23 +477,34 @@ watch(uiLocked, () => { } }); -registerHotkeyWithCleanup({ - editor: props.editor, +/** + * 全エディタに対してホットキーを登録する + * FIXME: hotkeyPlugin側で全エディタに対して登録できるようにする + */ +function registerHotkeyForAllEditors(action: Omit) { + registerHotkeyWithCleanup({ + editor: "talk", + ...action, + }); + registerHotkeyWithCleanup({ + editor: "song", + ...action, + }); +} + +registerHotkeyForAllEditors({ callback: createNewProject, name: "新規プロジェクト", }); -registerHotkeyWithCleanup({ - editor: props.editor, +registerHotkeyForAllEditors({ callback: saveProject, name: "プロジェクトを上書き保存", }); -registerHotkeyWithCleanup({ - editor: props.editor, +registerHotkeyForAllEditors({ callback: saveProjectAs, name: "プロジェクトを名前を付けて保存", }); -registerHotkeyWithCleanup({ - editor: props.editor, +registerHotkeyForAllEditors({ callback: importProject, name: "プロジェクト読み込み", });