Merge pull request #857 from Tyriar/744_remove_attachCustomKeydownHandler

Remove deprecated attachCustomKeydownHandler
This commit is contained in:
Daniel Imms
2017-08-07 01:21:26 -07:00
committed by GitHub
2 changed files with 1 additions and 13 deletions
-12
View File
@@ -1358,18 +1358,6 @@ export class Terminal extends EventEmitter implements ITerminal, IInputHandlingT
this.write(data + '\r\n');
}
/**
* DEPRECATED: only for backward compatibility. Please use attachCustomKeyEventHandler() instead.
* @param {function} customKeydownHandler The custom KeyboardEvent handler to attach. This is a
* function that takes a KeyboardEvent, allowing consumers to stop propogation and/or prevent
* the default action. The function returns whether the event should be processed by xterm.js.
*/
public attachCustomKeydownHandler(customKeydownHandler: CustomKeyEventHandler): void {
const message = 'attachCustomKeydownHandler() is DEPRECATED and will be removed soon. Please use attachCustomKeyEventHandler() instead.';
console.warn(message);
this.attachCustomKeyEventHandler(customKeydownHandler);
}
/**
* Attaches a custom key event handler which is run before keys are processed, giving consumers of
* xterm.js ultimate control as to what keys should be processed by the terminal and what keys
+1 -1
View File
@@ -239,7 +239,7 @@ describe('xterm.js', function() {
xterm.writeln('test');
}
var startYDisp = (xterm.rows * 2) + 1;
xterm.attachCustomKeydownHandler(function () {
xterm.attachCustomKeyEventHandler(function () {
return false;
});