save with ctrl-s
This commit is contained in:
parent
d0782b60cb
commit
0ef6871a93
@ -30,4 +30,18 @@ function save() {
|
||||
document.querySelector("#save_btn").onclick = function () {
|
||||
console.log("Click Save!");
|
||||
save();
|
||||
}
|
||||
|
||||
let isCtrl = false;
|
||||
document.onkeyup=function(e){
|
||||
if(e.keyCode === 17) isCtrl=false;
|
||||
}
|
||||
|
||||
document.onkeydown=function(e){
|
||||
if(e.keyCode === 17) isCtrl=true;
|
||||
if(e.keyCode === 83 && isCtrl === true) {
|
||||
//ctrl-s pressed
|
||||
save();
|
||||
return false;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user