single arg for DCS and ESC handler registration

This commit is contained in:
Jörg Breitbart
2018-05-01 21:07:13 +02:00
parent 89cf45c514
commit 9a32852e61
3 changed files with 36 additions and 38 deletions
+23 -23
View File
@@ -158,30 +158,30 @@ export class InputHandler implements IInputHandler {
/**
* ESC handlers
*/
this._parser.setEscHandler('', '7', () => this.saveCursor([]));
this._parser.setEscHandler('', '8', () => this.restoreCursor([]));
this._parser.setEscHandler('', 'D', () => this.index());
this._parser.setEscHandler('', 'E', () => this.nextLine());
this._parser.setEscHandler('', 'H', () => this.tabSet());
this._parser.setEscHandler('', 'M', () => this.reverseIndex());
this._parser.setEscHandler('', '=', () => this.keypadApplicationMode());
this._parser.setEscHandler('', '>', () => this.keypadNumericMode());
this._parser.setEscHandler('', 'c', () => this.reset());
this._parser.setEscHandler('', 'n', () => this.setgLevel(2));
this._parser.setEscHandler('', 'o', () => this.setgLevel(3));
this._parser.setEscHandler('', '|', () => this.setgLevel(3));
this._parser.setEscHandler('', '}', () => this.setgLevel(2));
this._parser.setEscHandler('', '~', () => this.setgLevel(1));
this._parser.setEscHandler('%', '@', () => this.selectDefaultCharset());
this._parser.setEscHandler('%', 'G', () => this.selectDefaultCharset());
this._parser.setEscHandler('7', () => this.saveCursor([]));
this._parser.setEscHandler('8', () => this.restoreCursor([]));
this._parser.setEscHandler('D', () => this.index());
this._parser.setEscHandler('E', () => this.nextLine());
this._parser.setEscHandler('H', () => this.tabSet());
this._parser.setEscHandler('M', () => this.reverseIndex());
this._parser.setEscHandler('=', () => this.keypadApplicationMode());
this._parser.setEscHandler('>', () => this.keypadNumericMode());
this._parser.setEscHandler('c', () => this.reset());
this._parser.setEscHandler('n', () => this.setgLevel(2));
this._parser.setEscHandler('o', () => this.setgLevel(3));
this._parser.setEscHandler('|', () => this.setgLevel(3));
this._parser.setEscHandler('}', () => this.setgLevel(2));
this._parser.setEscHandler('~', () => this.setgLevel(1));
this._parser.setEscHandler('%@', () => this.selectDefaultCharset());
this._parser.setEscHandler('%G', () => this.selectDefaultCharset());
for (let flag in CHARSETS) {
this._parser.setEscHandler('(', flag, () => this.selectCharset('(' + flag));
this._parser.setEscHandler(')', flag, () => this.selectCharset(')' + flag));
this._parser.setEscHandler('*', flag, () => this.selectCharset('*' + flag));
this._parser.setEscHandler('+', flag, () => this.selectCharset('+' + flag));
this._parser.setEscHandler('-', flag, () => this.selectCharset('-' + flag));
this._parser.setEscHandler('.', flag, () => this.selectCharset('.' + flag));
this._parser.setEscHandler('/', flag, () => this.selectCharset('/' + flag)); // FIXME: supported?
this._parser.setEscHandler('(' + flag, () => this.selectCharset('(' + flag));
this._parser.setEscHandler(')' + flag, () => this.selectCharset(')' + flag));
this._parser.setEscHandler('*' + flag, () => this.selectCharset('*' + flag));
this._parser.setEscHandler('+' + flag, () => this.selectCharset('+' + flag));
this._parser.setEscHandler('-' + flag, () => this.selectCharset('-' + flag));
this._parser.setEscHandler('.' + flag, () => this.selectCharset('.' + flag));
this._parser.setEscHandler('/' + flag, () => this.selectCharset('/' + flag)); // FIXME: supported?
}
/**