fix(editor): route save shortcut by context
This commit is contained in:
1 parent
c2da1f866c
commit
72dd4d728b
6 files changed
+45
-11
No files matched your search
@@ -26,6 +26,13 @@ export function isFocusSearchShortcut(event: ShortcutLikeEvent): boolean {
|
||||
return event.key.toLowerCase() === "f";
|
||||
}
|
||||
|
||||
export function isSaveShortcut(event: ShortcutLikeEvent): boolean {
|
||||
if (event.isComposing) return false;
|
||||
if (event.altKey) return false;
|
||||
if (!event.metaKey && !event.ctrlKey) return false;
|
||||
return event.key.toLowerCase() === "s";
|
||||
}
|
||||
|
||||
export function isCancelSearchShortcut(event: ShortcutLikeEvent): boolean {
|
||||
if (event.isComposing) return false;
|
||||
return event.key === "Escape";
|
||||
|
||||
Reference in new issue
Block a user