diff --git a/lib/hterm.js b/lib/hterm.js index 079a986d..d3750ee4 100644 --- a/lib/hterm.js +++ b/lib/hterm.js @@ -213,20 +213,22 @@ hterm.Keyboard.prototype.onKeyDown_ = function (e) { if (e.altKey || e.metaKey || isAccelerator(e)) { // hterm shouldn't consume a hyper accelerator + // // Was the hyperCaret removed for selectAll + if (e.key === 'v' && !this.terminal.cursorNode_.contains(this.hyperCaret)) { + this.terminal.focusHyperCaret(); + } return; } + // Test for valid keys in order to accept clear status + if (e.code !== 'Control' && e.key !== 'Shift' && e.code !== 'CapsLock' && e.key !== 'Dead') { + selection.clear(this.terminal); + } + // 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') { - // Test for valid keys in order to clear the terminal selection - selection.clear(this.terminal); - } return oldKeyDown.call(this, e); };