Aggiunge shortcut per cambi e aggiorna README.md
This commit is contained in:
@@ -301,36 +301,79 @@ export default {
|
||||
window.addEventListener("keydown", this.funzioneTastiSpeciali);
|
||||
},
|
||||
funzioneTastiSpeciali(e) {
|
||||
const target = e.target;
|
||||
if (target && (target.tagName === "INPUT" || target.tagName === "TEXTAREA" || target.isContentEditable)) {
|
||||
if (this.diaNomi.show || this.diaCambi.show) {
|
||||
return;
|
||||
}
|
||||
e.preventDefault();
|
||||
|
||||
const target = e.target;
|
||||
const path = typeof e.composedPath === "function" ? e.composedPath() : [];
|
||||
const elements = [target, ...path].filter(Boolean);
|
||||
const isTypingField = elements.some((el) => {
|
||||
if (!el || !el.tagName) {
|
||||
return false;
|
||||
}
|
||||
const tag = String(el.tagName).toLowerCase();
|
||||
if (tag === "input" || tag === "textarea") {
|
||||
return true;
|
||||
}
|
||||
if (el.isContentEditable) {
|
||||
return true;
|
||||
}
|
||||
if (el.classList && (el.classList.contains("w-input") || el.classList.contains("w-textarea"))) {
|
||||
return true;
|
||||
}
|
||||
const contentEditable = el.getAttribute && el.getAttribute("contenteditable");
|
||||
return contentEditable === "true";
|
||||
});
|
||||
if (isTypingField) {
|
||||
return;
|
||||
}
|
||||
|
||||
let handled = false;
|
||||
if (e.ctrlKey && e.key == "m") {
|
||||
this.diaNomi.show = true
|
||||
handled = true;
|
||||
} else if (e.ctrlKey && e.key == "b") {
|
||||
this.visuButt = !this.visuButt
|
||||
handled = true;
|
||||
} else if (e.ctrlKey && e.key == "f") {
|
||||
document.documentElement.requestFullscreen();
|
||||
handled = true;
|
||||
} else if (e.ctrlKey && e.key == "s") {
|
||||
this.speak();
|
||||
handled = true;
|
||||
} else if (e.ctrlKey && e.key == "z") {
|
||||
this.visuForm = !this.visuForm
|
||||
handled = true;
|
||||
} else if (e.ctrlKey && e.key == "ArrowUp") {
|
||||
this.incPunt("home")
|
||||
handled = true;
|
||||
} else if (e.ctrlKey && e.key == "ArrowDown") {
|
||||
this.decPunt("home")
|
||||
handled = true;
|
||||
} else if (e.ctrlKey && e.key == "ArrowRight") {
|
||||
this.incSet("home")
|
||||
handled = true;
|
||||
} else if (e.shiftKey && e.key == "ArrowUp") {
|
||||
this.incPunt("guest")
|
||||
handled = true;
|
||||
} else if (e.shiftKey && e.key == "ArrowDown") {
|
||||
this.decPunt("guest")
|
||||
handled = true;
|
||||
} else if (e.shiftKey && e.key == "ArrowRight") {
|
||||
this.incSet("guest")
|
||||
handled = true;
|
||||
} else if (e.ctrlKey && e.key == "ArrowLeft") {
|
||||
this.cambiaPalla()
|
||||
handled = true;
|
||||
} else if (e.ctrlKey && (e.key == "c" || e.key == "C")) {
|
||||
this.apriDialogCambi()
|
||||
handled = true;
|
||||
} else { return false }
|
||||
|
||||
if (handled) {
|
||||
e.preventDefault();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user