This commit is contained in:
Vanessa 2022-10-25 00:40:46 +08:00
parent 0e050b607c
commit 40d95b095b
8 changed files with 17 additions and 5 deletions

View file

@ -1,4 +1,6 @@
{
"expandDown": "Expand Down",
"expandUp": "Expand Up",
"goForward": "Go forward",
"goBack": "Go back",
"docNameAndContent": "Doc Name and Content",

View file

@ -1,4 +1,6 @@
{
"expandDown": "Expandir hacia abajo",
"expandUp": "Expandir hacia arriba",
"goForward": "Ir hacia adelante",
"goBack": "Ir hacia atrás",
"docNameAndContent": "Nombre y contenido del documento",

View file

@ -1,4 +1,6 @@
{
"expandDown": "Développer vers le bas",
"expandUp": "Développer vers le haut",
"goForward": "Suivant",
"goBack": "Retour",
"docNameAndContent": "Nom et contenu du document",

View file

@ -1,4 +1,6 @@
{
"expandDown": "向下擴選",
"expandUp": "向上擴選",
"goForward": "前進",
"goBack": "後退",
"docNameAndContent": "文檔名和內容",

View file

@ -1,4 +1,6 @@
{
"expandDown": "向下扩选",
"expandUp": "向上扩选",
"goForward": "前进",
"goBack": "后退",
"docNameAndContent": "文档名和内容",

View file

@ -276,7 +276,7 @@ export const keymap = {
}
if (["⌘", "⇧", "⌥", "⌃"].includes(keymapStr.substr(keymapStr.length - 1, 1)) ||
["⌘A", "⌘X", "⌘C", "⌘V", "⌘/", "⌥⇧↑", "⌥⇧↓", "⇧↑", "⇧↓", "⇧→", "⇧←", "⇧⇥", "⇧⌘⇥", "⌃⇥", "⌘⇥", "⌃⌘⇥", "⇧⌘→", "⇧⌘←", "⌘Home", "⌘End", "⇧↩", "↩", "PageUp", "PageDown", "⌫", "⌦"].includes(keymapStr)) {
["⌘A", "⌘X", "⌘C", "⌘V", "⌘/", "⇧↑", "⇧↓", "⇧→", "⇧←", "⇧⇥", "⇧⌘⇥", "⌃⇥", "⌘⇥", "⌃⌘⇥", "⇧⌘→", "⇧⌘←", "⌘Home", "⌘End", "⇧↩", "↩", "PageUp", "PageDown", "⌫", "⌦"].includes(keymapStr)) {
showMessage(tip + "] " + window.siyuan.languages.invalid);
return;
}

View file

@ -105,7 +105,7 @@ export abstract class Constants {
"222": ["'", '"'],
};
// "⌘", "⇧", "⌥", "⌃"
// "⌘A", "⌘X", "⌘C", "⌘V", "⌘/", "⌥⇧↑", "⌥⇧↓", "⇧↑", "⇧↓", "⇧→", "⇧←", "⇧⇥", "⇧⌘⇥", "⌃⇥", "⌘⇥", "⌃⌘⇥", "⇧⌘→", "⇧⌘←", "⌘Home", "⌘End", "⇧↩", "↩", "PageUp", "PageDown", "⌫", "⌦", "⌃I", "⌃E", "⌃N", "⌃U" 不可自定义
// "⌘A", "⌘X", "⌘C", "⌘V", "⌘/", "⇧↑", "⇧↓", "⇧→", "⇧←", "⇧⇥", "⇧⌘⇥", "⌃⇥", "⌘⇥", "⌃⌘⇥", "⇧⌘→", "⇧⌘←", "⌘Home", "⌘End", "⇧↩", "↩", "PageUp", "PageDown", "⌫", "⌦", "⌃I", "⌃E", "⌃N", "⌃U" 不可自定义
public static readonly SIYUAN_KEYMAP: IKeymap = {
general: {
syncNow: {default: "F9", custom: "F9"},
@ -137,6 +137,8 @@ export abstract class Constants {
},
editor: {
general: {
expandDown: {default: "⌥⇧↓", custom: "⌥⇧↓"},
expandUp: {default: "⌥⇧↑", custom: "⌥⇧↑"},
copyPlainText: {default: "", custom: ""},
copyID: {default: "", custom: ""},
netImg2LocalAsset: {default: "", custom: ""},

View file

@ -282,7 +282,7 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {
}
}
if (matchHotKey("⌥⇧↑", event)) {
if (matchHotKey(window.siyuan.config.keymap.editor.general.expandUp.custom, event)) {
upSelect({
protyle, event, nodeElement, editorElement, range,
cb(selectElements) {
@ -307,7 +307,7 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {
return;
}
if (matchHotKey("⌥⇧↓", event)) {
if (matchHotKey(window.siyuan.config.keymap.editor.general.expandDown.custom, event)) {
downSelect({
protyle, event, nodeElement, editorElement, range,
cb(selectElements) {