From 34da7d0a602393cec26f3742039432f816479b43 Mon Sep 17 00:00:00 2001 From: Tim Neutkens Date: Fri, 9 Dec 2016 20:03:03 +0100 Subject: [PATCH] Don't focus on caret when using modifier keys (#1106) * Don't focus on caret when using modifier keys * Removed trailing space --- lib/hterm.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/hterm.js b/lib/hterm.js index f2779986..c6f61375 100644 --- a/lib/hterm.js +++ b/lib/hterm.js @@ -222,10 +222,6 @@ hterm.Terminal.prototype.copySelectionToClipboard = function () { // hyper and not the terminal itself const oldKeyDown = hterm.Keyboard.prototype.onKeyDown_; hterm.Keyboard.prototype.onKeyDown_ = function (e) { - // Was the hyperCaret removed for selectAll - if (!this.terminal.cursorNode_.contains(this.hyperCaret)) { - this.terminal.focusHyperCaret(); - } const modifierKeysConf = this.terminal.modifierKeys; if (e.altKey && @@ -256,6 +252,12 @@ hterm.Keyboard.prototype.onKeyDown_ = function (e) { // hterm shouldn't consume a hyper accelerator return; } + + // Was the hyperCaret removed for selectAll + if (!this.terminal.cursorNode_.contains(this.hyperCaret)) { + this.terminal.focusHyperCaret(); + } + if ((!e.ctrlKey || e.code !== 'ControlLeft') && !e.shiftKey && e.code !== 'CapsLock' && e.key !== 'Dead') {