mirror of
https://github.com/wavetermdev/xterm.js.git
synced 2026-08-05 13:43:48 -07:00
Merge pull request #857 from Tyriar/744_remove_attachCustomKeydownHandler
Remove deprecated attachCustomKeydownHandler
This commit is contained in:
@@ -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
@@ -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;
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user