From c995d6e277ab23e725b897754641967cdd2d9f2e Mon Sep 17 00:00:00 2001 From: Florian Mounier Date: Mon, 17 Mar 2014 10:18:54 +0100 Subject: [PATCH] Let the ctrl+shift+c, ctrl+shift+v go through to handle native copy paste. Fix #36 --- butterfly/static/coffees/term.coffee | 3 +++ butterfly/static/javascripts/main.js | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/butterfly/static/coffees/term.coffee b/butterfly/static/coffees/term.coffee index f3d595b..f854d0c 100644 --- a/butterfly/static/coffees/term.coffee +++ b/butterfly/static/coffees/term.coffee @@ -1101,6 +1101,9 @@ class Terminal # Handle shift insert and ctrl insert copy/paste usefull for typematrix keyboard return true if (ev.shiftKey or ev.ctrlKey) and ev.keyCode is 45 + # Let the ctrl+shift+c, ctrl+shift+v go through to handle native copy paste + return true if (ev.shiftKey and ev.ctrlKey) and ev.keyCode in [67, 86] + # Alt-z works as an escape to relay the following keys to the browser. # usefull to trigger browser shortcuts, i.e.: Alt+Z F5 to reload # May be redundant with keyPrefix diff --git a/butterfly/static/javascripts/main.js b/butterfly/static/javascripts/main.js index 8cbf67f..5c4ed89 100644 --- a/butterfly/static/javascripts/main.js +++ b/butterfly/static/javascripts/main.js @@ -1011,13 +1011,16 @@ Terminal = (function() { }; Terminal.prototype.keyDown = function(ev) { - var id, key, t; + var id, key, t, _ref; if (ev.keyCode > 15 && ev.keyCode < 19) { return true; } if ((ev.shiftKey || ev.ctrlKey) && ev.keyCode === 45) { return true; } + if ((ev.shiftKey && ev.ctrlKey) && ((_ref = ev.keyCode) === 67 || _ref === 86)) { + return true; + } if (ev.altKey && ev.keyCode === 90 && !this.skipNextKey) { this.skipNextKey = true; this.element.classList.add('skip');