From c82cd3a1fe2d96cb0b1313ca0c44849179493748 Mon Sep 17 00:00:00 2001 From: ppot Date: Wed, 14 Dec 2016 22:23:16 -0500 Subject: [PATCH] Fix key focus --- lib/hterm.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/lib/hterm.js b/lib/hterm.js index 079a986d4ee9..d3750ee4c6e1 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); };