aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/mist/assets/ext/mist.js
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/mist/assets/ext/mist.js')
-rw-r--r--cmd/mist/assets/ext/mist.js14
1 files changed, 8 insertions, 6 deletions
diff --git a/cmd/mist/assets/ext/mist.js b/cmd/mist/assets/ext/mist.js
index 8734f8dc7..2fc38cdfa 100644
--- a/cmd/mist/assets/ext/mist.js
+++ b/cmd/mist/assets/ext/mist.js
@@ -20,16 +20,18 @@
console.log("loaded?");
document.onkeydown = function(evt) {
+ // This functions keeps track of keyboard inputs in order to allow copy, paste and other features
+
evt = evt || window.event;
if (evt.ctrlKey && evt.keyCode == 67) {
window.document.execCommand("copy");
- console.log("Ctrl-C");
} else if (evt.ctrlKey && evt.keyCode == 88) {
window.document.execCommand("cut");
- console.log("Ctrl-X");
- } if (evt.ctrlKey && evt.keyCode == 86) {
- console.log("Ctrl-V");
- } if (evt.ctrlKey && evt.keyCode == 90) {
- console.log("Ctrl-Z");
+ } else if (evt.ctrlKey && evt.keyCode == 86) {
+ window.document.execCommand("paste");
+ } else if (evt.ctrlKey && evt.keyCode == 90) {
+ window.document.execCommand("undo");
+ } else if (evt.ctrlKey && evt.shiftKey && evt.keyCode == 90) {
+ window.document.execCommand("redo");
}
}; \ No newline at end of file