diff --git a/src/xterm.js b/src/xterm.js index 85efc223..d47da683 100644 --- a/src/xterm.js +++ b/src/xterm.js @@ -2425,15 +2425,15 @@ Terminal.prototype.attachCustomKeydownHandler = function(customKeydownHandler) { * @param {KeyboardEvent} ev The keydown event to be handled. */ Terminal.prototype.keyDown = function(ev) { + if (this.customKeydownHandler && this.customKeydownHandler(ev) === false) { + return false; + } + // Scroll down to prompt, whenever the user presses a key. if (this.ybase !== this.ydisp) { this.scrollToBottom(); } - if (this.customKeydownHandler && this.customKeydownHandler(ev) === false) { - return false; - } - if (!this.compositionHelper.keydown.bind(this.compositionHelper)(ev)) { return false; }