mirror of
https://github.com/AkiChase/scrcpy-mask
synced 2025-02-23 15:32:17 +08:00
fix(KeyBoard): new hotkey not work when saved by nav
This commit is contained in:
parent
eee073ecd2
commit
1cf1891598
@ -122,8 +122,8 @@ function isKeyUnique(curKey: string): boolean {
|
|||||||
function setCurButtonKey(curKey: string) {
|
function setCurButtonKey(curKey: string) {
|
||||||
if (
|
if (
|
||||||
keyboardStore.activeButtonIndex === -1 ||
|
keyboardStore.activeButtonIndex === -1 ||
|
||||||
keyboardStore.activeButtonIndex >= store.editKeyMappingList.length||
|
keyboardStore.activeButtonIndex >= store.editKeyMappingList.length ||
|
||||||
keyboardStore.showButtonSettingFlag||
|
keyboardStore.showButtonSettingFlag ||
|
||||||
keyboardStore.showButtonAddFlag
|
keyboardStore.showButtonAddFlag
|
||||||
)
|
)
|
||||||
return;
|
return;
|
||||||
@ -233,26 +233,32 @@ onActivated(() => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
onBeforeRouteLeave(() => {
|
onBeforeRouteLeave(() => {
|
||||||
document.removeEventListener("keyup", handleKeyUp);
|
return new Promise((resolve, _) => {
|
||||||
document.removeEventListener("wheel", handleMouseWheel);
|
document.removeEventListener("keyup", handleKeyUp);
|
||||||
if (keyboardStore.edited) {
|
document.removeEventListener("wheel", handleMouseWheel);
|
||||||
dialog.warning({
|
if (keyboardStore.edited) {
|
||||||
title: "Warning",
|
dialog.warning({
|
||||||
content: "当前方案尚未保存,是否保存?",
|
title: "Warning",
|
||||||
positiveText: "保存",
|
content: "当前方案尚未保存,是否保存?",
|
||||||
negativeText: "取消",
|
positiveText: "保存",
|
||||||
onPositiveClick: () => {
|
negativeText: "取消",
|
||||||
if (store.applyEditKeyMappingList()) {
|
onPositiveClick: () => {
|
||||||
keyboardStore.edited = false;
|
if (store.applyEditKeyMappingList()) {
|
||||||
} else {
|
keyboardStore.edited = false;
|
||||||
message.error("存在重复按键,无法保存");
|
resolve(true);
|
||||||
}
|
} else {
|
||||||
},
|
message.error("存在重复按键,无法保存");
|
||||||
onNegativeClick: () => {
|
resolve(false);
|
||||||
resetKeyMappingConfig();
|
}
|
||||||
},
|
},
|
||||||
});
|
onNegativeClick: () => {
|
||||||
}
|
resetKeyMappingConfig();
|
||||||
|
resolve(true);
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
resolve(true);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user