add onBinary on CoreService, use for DEFAULT mouse reports

This commit is contained in:
Jörg Breitbart
2019-11-13 23:46:01 +01:00
parent 414eea2a2c
commit b780abaf3b
5 changed files with 39 additions and 14 deletions
+10
View File
@@ -23,6 +23,8 @@ export class CoreService implements ICoreService {
public get onData(): IEvent<string> { return this._onData.event; }
private _onUserInput = new EventEmitter<void>();
public get onUserInput(): IEvent<void> { return this._onUserInput.event; }
private _onBinary = new EventEmitter<string>();
public get onBinary(): IEvent<string> { return this._onBinary.event; }
constructor(
// TODO: Move this into a service
@@ -59,4 +61,12 @@ export class CoreService implements ICoreService {
this._logService.debug(`sending data "${data}"`, () => data.split('').map(e => e.charCodeAt(0)));
this._onData.fire(data);
}
public triggerBinaryEvent(data: string): void {
if (this._optionsService.options.disableStdin) {
return;
}
this._logService.debug(`sending binary "${data}"`, () => data.split('').map(e => e.charCodeAt(0)));
this._onBinary.fire(data);
}
}