Skip to content

Commit

Permalink
截屏 alt显示快捷键
Browse files Browse the repository at this point in the history
  • Loading branch information
xushengfeng committed Jan 17, 2024
1 parent f1c2ee6 commit 3531998
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/renderer/clip/clip_window.ts
Original file line number Diff line number Diff line change
Expand Up @@ -627,9 +627,6 @@ for (let k of toolList) {
let drawHotKey: setting["截屏编辑快捷键"] = store.get(`截屏编辑快捷键`);
for (let i in drawHotKey) {
let mainKey = i as keyof EditType;
// todo hotkey tip
console.log(drawMainEls);

drawMainEls[mainKey].setAttribute("data-key", drawHotKey[mainKey].);
hotkeys(drawHotKey[mainKey]., () => {
setEditType(mainKey, editType[mainKey]);
Expand All @@ -642,6 +639,18 @@ for (let i in drawHotKey) {
}
}

// alt显示快捷键
document.addEventListener("keydown", (e) => {
if (e.key === "Alt") {
document.documentElement.style.setProperty("--hotkey-show", "block");
}
});
document.addEventListener("keyup", (e) => {
if (e.key === "Alt") {
document.documentElement.style.setProperty("--hotkey-show", "none");
}
});

var autoDo = store.get("框选后默认操作");
if (autoDo != "no") {
document.getElementById(`tool_${autoDo}`).style.backgroundColor = "var(--hover-color)";
Expand Down

0 comments on commit 3531998

Please sign in to comment.