Drop visual kb keys when window is blurred

Prevents 'ghosts' active keys
上级 ce696ca6
......@@ -307,6 +307,13 @@ class Keyboard {
window.audioManager.granted.play();
}
};
window.addEventListener("blur", () => {
document.querySelectorAll("div.keyboard_key.active").forEach(key => {
key.setAttribute("class", key.getAttribute("class").replace("active", ""));
key.onmouseup({preventDefault: () => {return true}});
});
});
}
pressKey(key) {
let cmd = key.dataset.cmd || "";
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册