-
Notifications
You must be signed in to change notification settings - Fork 306
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change: ショートカットキー周りをHotkeyManagerにまとめる #1822
Merged
Merged
Changes from all commits
Commits
Show all changes
52 commits
Select commit
Hold shift + click to select a range
9d55fb9
Add: HotkeyManagerを追加
sevenc-nanashi 421903b
Add: とりあえずUndo/Redoは動いた
sevenc-nanashi 22c572c
Change: Pluginに
sevenc-nanashi a83f4a3
Change: hotkey-jsに
sevenc-nanashi cd5469c
Change: hotkeyManagerに置き換え
sevenc-nanashi f5fe090
Change: デフォルトパラメータに
sevenc-nanashi b93a07c
Code: ドキュメントを追加
sevenc-nanashi 60c7336
Add: sing側に同じ名前でショートカットを登録できるように
sevenc-nanashi 35dce47
Revert: Spaceキー再生のコードを削除
sevenc-nanashi 5e9d70e
Improve: 可読性を改善
sevenc-nanashi 171d8d2
Delete: keepDefaultBehaviorを削除
sevenc-nanashi cf5c441
Change: scopeを使うように
sevenc-nanashi ccc6b62
Code: 「ショートカットキーの処理」を使うように
sevenc-nanashi 933cc43
Merge: main -> refactor/hotkey
sevenc-nanashi e18c353
Fix: 同じキーバインドが登録されてると片方が動かなくなるのを修正
sevenc-nanashi 693f738
Code: 可読性を向上
sevenc-nanashi 735a6c7
Merge: main -> refactor/hotkey
sevenc-nanashi a226127
Code: 変数名周りを改修
sevenc-nanashi 14c62cf
Change: HotkeyAction -> HotkeyActionName
sevenc-nanashi 796405a
Change: ActionKey -> ActionId
sevenc-nanashi bd74cfc
Change: action ->name
sevenc-nanashi 473a780
Change: window.electron.logInfoをを使うようにする
sevenc-nanashi 84729c8
Code: 変数名を変更
sevenc-nanashi 3881365
Change: undefined | HotkeySetting[]にする
sevenc-nanashi 2a0b170
Add: テストを追加
sevenc-nanashi c3fac82
Refactor: refreshBindingsを分解
sevenc-nanashi 299dc1c
Change: hotkeys.filterを一番上に持ってくる
sevenc-nanashi 45d1992
Change: getSettingでthrowするようにする
sevenc-nanashi 44f2bb7
Delete: eslintのignoreを使わないコードにする
sevenc-nanashi 10f474f
Code: コメントを追加
sevenc-nanashi 1571003
Change: as unknown asをなくす
sevenc-nanashi 5e3c03f
Fix: 割り当て -> 未割り当て -> 割り当ての挙動を修正
sevenc-nanashi 035eb23
Change: logをDIする
sevenc-nanashi c68fc07
Merge: main -> refactor/hotkey
sevenc-nanashi 1ae9b38
Code: コメントを追加
sevenc-nanashi 1452b82
Change: 条件を変更
sevenc-nanashi 5c63293
下に移動
Hiroshiba 7a5e6f8
Merge remote-tracking branch 'upstream/main' into pr/sevenc-nanashi/1…
Hiroshiba 96ed5d7
to combination
Hiroshiba ed32545
Fix: 良い感じにクリーンアップするように
sevenc-nanashi 5475247
Fix: テストを修正
sevenc-nanashi 925fd13
Improve: 良い感じに
sevenc-nanashi 017d69e
Improve: エラーメッセージを改善
sevenc-nanashi c90ae78
Change: IDを使わないように
sevenc-nanashi e81b28a
Refactor: isSameHotkeyTarget/isNotSameHotkeyTargetを追加
sevenc-nanashi 81afdfc
Delete: unbindUnregisteredCombinationsを削除
sevenc-nanashi 22e0236
Merge: main -> refactor/hotkey
sevenc-nanashi 02ebfdd
unbindedCombinationsを下に
Hiroshiba 7fefe74
doc集約
Hiroshiba 92551fe
プライベート変数の説明追加
Hiroshiba 116a796
Code: コメントをdoc commentに
sevenc-nanashi ea7a853
Change: beforeEachで登録するのをやめる
sevenc-nanashi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,16 +34,18 @@ import TitleBarButtons from "./TitleBarButtons.vue"; | |
import TitleBarEditorSwitcher from "./TitleBarEditorSwitcher.vue"; | ||
import { useStore } from "@/store"; | ||
import { base64ImageToUri } from "@/helpers/imageHelper"; | ||
import { HotkeyActionType, HotkeyReturnType } from "@/type/preload"; | ||
import { setHotkeyFunctions } from "@/store/setting"; | ||
import { useHotkeyManager } from "@/plugins/hotkeyPlugin"; | ||
|
||
const props = | ||
defineProps<{ | ||
/** 「ファイル」メニューのサブメニュー */ | ||
fileSubMenuData: MenuItemData[]; | ||
/** エディタの種類 */ | ||
editor: "talk" | "song"; | ||
Comment on lines
+43
to
+44
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. この引数を受け取る設計、本当は良くないのですが、今の状態からだとベストな気がしました! |
||
}>(); | ||
|
||
const store = useStore(); | ||
const { registerHotkeyWithCleanup } = useHotkeyManager(); | ||
const currentVersion = ref(""); | ||
|
||
// デフォルトエンジンの代替先ポート | ||
|
@@ -439,14 +441,26 @@ watch(uiLocked, () => { | |
} | ||
}); | ||
|
||
const hotkeyMap = new Map<HotkeyActionType, () => HotkeyReturnType>([ | ||
["新規プロジェクト", createNewProject], | ||
["プロジェクトを上書き保存", saveProject], | ||
["プロジェクトを名前を付けて保存", saveProjectAs], | ||
["プロジェクト読み込み", importProject], | ||
]); | ||
|
||
setHotkeyFunctions(hotkeyMap); | ||
registerHotkeyWithCleanup({ | ||
editor: props.editor, | ||
callback: createNewProject, | ||
name: "新規プロジェクト", | ||
}); | ||
registerHotkeyWithCleanup({ | ||
editor: props.editor, | ||
callback: saveProject, | ||
name: "プロジェクトを上書き保存", | ||
}); | ||
registerHotkeyWithCleanup({ | ||
editor: props.editor, | ||
callback: saveProjectAs, | ||
name: "プロジェクトを名前を付けて保存", | ||
}); | ||
registerHotkeyWithCleanup({ | ||
editor: props.editor, | ||
callback: importProject, | ||
name: "プロジェクト読み込み", | ||
}); | ||
</script> | ||
|
||
<style lang="scss"> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mousetrap、
ので、代替に挙げられているhotkey-jsを使う用にしました。