mirror of
https://github.com/openvk/openvk
synced 2025-07-04 06:49:50 +03:00
feat(grafity-CtrlZ): Added script for basic keyboard support in grafity
This commit is contained in:
parent
4b7d2b9b17
commit
6b33ccc812
1 changed files with 17 additions and 2 deletions
|
@ -6429,6 +6429,21 @@ tools.ToolWithStroke = ToolWithStroke = (function(superClass) {
|
||||||
|
|
||||||
module.exports = tools;
|
module.exports = tools;
|
||||||
|
|
||||||
|
|
||||||
},{}]},{},[22])(22)
|
},{}]},{},[22])(22)
|
||||||
});
|
});
|
||||||
|
|
||||||
|
document.addEventListener('keydown', function (e) {
|
||||||
|
const redoBtn = document.querySelector(".lc-redo")
|
||||||
|
const undoBtn = document.querySelector(".lc-undo")
|
||||||
|
|
||||||
|
if (e.ctrlKey && undoBtn && redoBtn) {
|
||||||
|
if ((e.code === "KeyY") || (e.code === "KeyZ" && e.shiftKey)) {
|
||||||
|
e.preventDefault()
|
||||||
|
redoBtn.click()
|
||||||
|
}
|
||||||
|
else if (e.code === "KeyZ") {
|
||||||
|
e.preventDefault()
|
||||||
|
undoBtn.click()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
Loading…
Reference in a new issue