This commit is contained in:
Vanessa 2023-11-16 10:56:38 +08:00
parent 2696349ff3
commit 43ec0a2997

View file

@ -138,12 +138,12 @@ export const updateHotkeyTip = (hotkey: string) => {
const keys = [];
if (hotkey.indexOf("⌘") > -1) keys.push(KEY_MAP.get("⌘"));
if ((hotkey.indexOf("⌘") > -1 || hotkey.indexOf("⌃") > -1)) keys.push(KEY_MAP.get("⌘"));
if (hotkey.indexOf("⇧") > -1) keys.push(KEY_MAP.get("⇧"));
if (hotkey.indexOf("⌥") > -1) keys.push(KEY_MAP.get("⌥"));
// 不能去最后一个,需匹配 F2
const lastKey = hotkey.replace(/⌘|⇧|⌥/g, "");
const lastKey = hotkey.replace(/⌘|⇧|⌥|⌃/g, "");
if (lastKey) {
keys.push(KEY_MAP.get(lastKey) || lastKey);
}