mirror of
https://github.com/quine-global/hyper.git
synced 2026-01-16 05:38:41 -09:00
Fix key focus (#1218)
This commit is contained in:
parent
63ab44778b
commit
4943e4a2f8
1 changed files with 9 additions and 7 deletions
16
lib/hterm.js
16
lib/hterm.js
|
|
@ -213,20 +213,22 @@ hterm.Keyboard.prototype.onKeyDown_ = function (e) {
|
||||||
|
|
||||||
if (e.altKey || e.metaKey || isAccelerator(e)) {
|
if (e.altKey || e.metaKey || isAccelerator(e)) {
|
||||||
// hterm shouldn't consume a hyper accelerator
|
// 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;
|
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
|
// Was the hyperCaret removed for selectAll
|
||||||
if (!this.terminal.cursorNode_.contains(this.hyperCaret)) {
|
if (!this.terminal.cursorNode_.contains(this.hyperCaret)) {
|
||||||
this.terminal.focusHyperCaret();
|
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);
|
return oldKeyDown.call(this, e);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue