1 import { IInputHandler, ITerminal } from './Interfaces';
3 export class InputHandler implements IInputHandler {
4 // TODO: We want to type _terminal when it's pulled into TS
5 constructor(private _terminal: any) { }
8 if (!this._terminal.visualBell) {
11 this._terminal.element.style.borderColor = 'white';
12 setTimeout(() => this._terminal.element.style.borderColor = '', 10);
13 if (this._terminal.popOnBell) {
14 this._terminal.focus();
18 public lineFeed(): void {
19 if (this._terminal.convertEol) {
23 if (this._terminal.y > this._terminal.scrollBottom) {
25 this._terminal.scroll();
29 public carriageReturn(): void {
33 public backspace(): void {
34 if (this._terminal.x > 0) {
40 this._terminal.x = this._terminal.nextStop();
43 public shiftOut(): void {
44 this._terminal.setgLevel(1);
47 public shiftIn(): void {
48 this._terminal.setgLevel(0);