mirror of
https://github.com/quine-global/hyper.git
synced 2026-01-18 06:28:40 -09:00
This commit is contained in:
parent
0c71863560
commit
1b6d925524
1 changed files with 11 additions and 0 deletions
11
lib/hterm.js
11
lib/hterm.js
|
|
@ -182,11 +182,22 @@ hterm.Terminal.prototype.copySelectionToClipboard = function () {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
let lastEventTimeStamp;
|
||||||
|
let lastEventKey;
|
||||||
// passthrough all the commands that are meant to control
|
// passthrough all the commands that are meant to control
|
||||||
// hyper and not the terminal itself
|
// hyper and not the terminal itself
|
||||||
const oldKeyDown = hterm.Keyboard.prototype.onKeyDown_;
|
const oldKeyDown = hterm.Keyboard.prototype.onKeyDown_;
|
||||||
hterm.Keyboard.prototype.onKeyDown_ = function (e) {
|
hterm.Keyboard.prototype.onKeyDown_ = function (e) {
|
||||||
const modifierKeysConf = this.terminal.modifierKeys;
|
const modifierKeysConf = this.terminal.modifierKeys;
|
||||||
|
if (e.timeStamp === lastEventTimeStamp && e.key === lastEventKey) {
|
||||||
|
// Event was already processed.
|
||||||
|
// It seems to occur after a char composition ended by Tab and cause a blur.
|
||||||
|
// See https://github.com/zeit/hyper/issues/1341
|
||||||
|
e.preventDefault();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
lastEventTimeStamp = e.timeStamp;
|
||||||
|
lastEventKey = e.key;
|
||||||
|
|
||||||
if (e.altKey &&
|
if (e.altKey &&
|
||||||
e.which !== 16 && // Ignore other modifer keys
|
e.which !== 16 && // Ignore other modifer keys
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue