Skip to content

Commit

Permalink
Merge pull request #59 from Hastaroth1/main
Browse files Browse the repository at this point in the history
Change customKeyEventHandler.call to pass the terminal as `thisArgs`
  • Loading branch information
BattlefieldDuck authored Sep 17, 2024
2 parents c3ecdb7 + 0bbf613 commit 5f28b1d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions XtermBlazor/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class XtermBlazor {
} catch {
// Asynchronous for both Blazor Server and Blazor WebAssembly apps.
DotNet.invokeMethodAsync(this._ASSEMBLY_NAME, 'AttachCustomKeyEventHandler', id, this.parseKeyboardEvent(event));
return this.getTerminalObjectById(id).customKeyEventHandler?.call(event) ?? true;
return this.getTerminalObjectById(id).customKeyEventHandler(event);
}
});
terminal.attachCustomWheelEventHandler(event => {
Expand All @@ -54,7 +54,7 @@ class XtermBlazor {
} catch {
// Asynchronous for both Blazor Server and Blazor WebAssembly apps.
DotNet.invokeMethodAsync(this._ASSEMBLY_NAME, 'AttachCustomWheelEventHandler', id, event);
return this.getTerminalObjectById(id).customWheelEventHandler?.call(event) ?? true;
return this.getTerminalObjectById(id).customWheelEventHandler(event);
}
});

Expand All @@ -73,8 +73,8 @@ class XtermBlazor {
this._terminals.set(id, {
terminal: terminal,
addons: addons,
customKeyEventHandler: undefined,
customWheelEventHandler: undefined
customKeyEventHandler: (event: KeyboardEvent) => true,
customWheelEventHandler: (event: WheelEvent) => true,
});
}

Expand Down

0 comments on commit 5f28b1d

Please sign in to comment.