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') {