mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-03-14 00:16:13 +01:00
This commit is contained in:
parent
b195782a1c
commit
44d4387ca1
1 changed files with 26 additions and 1 deletions
|
|
@ -9,10 +9,35 @@ export const mobileKeydown = (app: App, event: KeyboardEvent) => {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const protyle = getCurrentEditor().protyle;
|
const protyle = getCurrentEditor().protyle;
|
||||||
Object.keys(window.siyuan.config.keymap.general).find((key) => {
|
const matchGeneral = Object.keys(window.siyuan.config.keymap.general).find((key) => {
|
||||||
if (matchHotKey(window.siyuan.config.keymap.general[key].custom, event)) {
|
if (matchHotKey(window.siyuan.config.keymap.general[key].custom, event)) {
|
||||||
execByCommand({command: key, app, protyle, previousRange: protyle.toolbar.range});
|
execByCommand({command: key, app, protyle, previousRange: protyle.toolbar.range});
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (matchGeneral) {
|
||||||
|
event.preventDefault();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
let matchCommand = false;
|
||||||
|
app.plugins.find(item => {
|
||||||
|
item.commands.find(command => {
|
||||||
|
if (command.callback &&
|
||||||
|
!command.fileTreeCallback && !command.editorCallback && !command.dockCallback && !command.globalCallback
|
||||||
|
&& matchHotKey(command.customHotkey, event)) {
|
||||||
|
matchCommand = true;
|
||||||
|
command.callback();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if (matchCommand) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if (matchCommand) {
|
||||||
|
event.preventDefault();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue