feat:add page scale shortcut key

This commit is contained in:
Hufe921
2022-11-06 20:50:22 +08:00
parent 9b227626fc
commit 8ed7b309e9
2 changed files with 20 additions and 0 deletions
+3
View File
@@ -14,6 +14,9 @@ export enum KeyMap {
PERIOD = '.',
LEFT_ANGLE_BRACKET = '<',
RIGHT_ANGLE_BRACKET = '>',
EQUAL = '=',
MINUS = '-',
PLUS = '+',
A = 'a',
B = 'b',
C = 'c',
+17
View File
@@ -639,6 +639,7 @@ window.onload = function () {
} else {
searchCollapseDom.style.right = 'unset'
}
searchInputDom.focus()
}
searchCollapseDom.querySelector<HTMLSpanElement>('span')!.onclick = function () {
searchCollapseDom.style.display = 'none'
@@ -989,6 +990,22 @@ window.onload = function () {
callback: () => {
searchDom.click()
}
},
{
key: KeyMap.MINUS,
ctrl: true,
isGlobal: true,
callback: (command: Command) => {
command.executePageScaleMinus()
}
},
{
key: KeyMap.EQUAL,
ctrl: true,
isGlobal: true,
callback: (command: Command) => {
command.executePageScaleAdd()
}
}
])