feat:add page scale shortcut key

pr675
Hufe921 3 years ago
parent 9b227626fc
commit 8ed7b309e9

@ -14,6 +14,9 @@ export enum KeyMap {
PERIOD = '.', PERIOD = '.',
LEFT_ANGLE_BRACKET = '<', LEFT_ANGLE_BRACKET = '<',
RIGHT_ANGLE_BRACKET = '>', RIGHT_ANGLE_BRACKET = '>',
EQUAL = '=',
MINUS = '-',
PLUS = '+',
A = 'a', A = 'a',
B = 'b', B = 'b',
C = 'c', C = 'c',

@ -639,6 +639,7 @@ window.onload = function () {
} else { } else {
searchCollapseDom.style.right = 'unset' searchCollapseDom.style.right = 'unset'
} }
searchInputDom.focus()
} }
searchCollapseDom.querySelector<HTMLSpanElement>('span')!.onclick = function () { searchCollapseDom.querySelector<HTMLSpanElement>('span')!.onclick = function () {
searchCollapseDom.style.display = 'none' searchCollapseDom.style.display = 'none'
@ -989,6 +990,22 @@ window.onload = function () {
callback: () => { callback: () => {
searchDom.click() 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()
}
} }
]) ])

Loading…
Cancel
Save