Don't focus on caret when using modifier keys (#1106)

* Don't focus on caret when using modifier keys

* Removed trailing space
This commit is contained in:
Tim Neutkens 2016-12-09 20:03:03 +01:00 committed by Matheus Fernandes
parent a45fb97283
commit 34da7d0a60

View file

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