This commit is contained in:
Vanessa 2022-08-23 00:43:51 +08:00
parent b3150e2ce7
commit d49e1a009e

View file

@ -56,7 +56,7 @@ export const matchHotKey = (hotKey: string, event: KeyboardEvent) => {
const keyCode = hotKeys.length === 3 ? hotKeys[2] : hotKeys[1];
if ((hotKeys.length === 3 ? isCtrl(event) : !isCtrl(event)) && event.altKey && !event.shiftKey &&
(
(/^[0-9]$/.test(keyCode) ? event.key === keyCode : event.code === "Key" + keyCode) ||
(/^[0-9]$/.test(keyCode) ? (event.code === "Digit" + keyCode || event.code === "Numpad" + keyCode) : event.code === "Key" + keyCode) ||
event.code === keyCode ||
(event.code === "Period" && keyCode === ".") ||
(event.code === "BracketLeft" && keyCode === "[") || (event.code === "BracketRight" && keyCode === "]")