Cut, Copy, Undo and Redo working in webview

This commit is contained in:
Alexandre Van de Sande
2015-02-17 17:37:26 +01:00
parent abb9b7f46f
commit 0e2f6691bf
3 changed files with 20 additions and 18 deletions

View File

@@ -27,9 +27,14 @@ document.onkeydown = function(evt) {
} else if (evt.ctrlKey && evt.keyCode == 88) {
window.document.execCommand("cut");
console.log("Ctrl-X");
} if (evt.ctrlKey && evt.keyCode == 86) {
} else if (evt.ctrlKey && evt.keyCode == 86) {
window.document.execCommand("paste");
console.log("Ctrl-V");
} if (evt.ctrlKey && evt.keyCode == 90) {
} else if (evt.ctrlKey && evt.keyCode == 90) {
window.document.execCommand("undo");
console.log("Ctrl-Z");
} else if (evt.ctrlKey && evt.shiftKey && evt.keyCode == 90) {
window.document.execCommand("redo");
console.log("Ctrl-Z");
}
};