customKeyEventHandler is not invoked properly
First of all, thank you for this package.
Describe the bug
When using the customKeyEventHandler to intercept keys, the KeyBoardEvent object is not passed as a parameter as expected. Instead is it passed as the this:
https://github.com/BattlefieldDuck/XtermBlazor/blob/main/XtermBlazor/src/index.ts#L47
I'm not sure what the this object is when Xtermjs calls the handler directly, but it would make sense to me to pass the terminal as the this.
To Reproduce Steps to reproduce the behavior:
- Create a terminal
- In
OnFirstRenderor some other lifecycle method, useterminal.SetCustomKeyEventHandlerto set a custom key handler. - Type anything inside the terminal
- The function called in
SetCustomKeyEventHandlerwill have no param passed and instead thethisobject will contain the event information.
Expected behavior
The first function param should contain the KeyboardEvent object.
Desktop (please complete the following information):
- OS: Windows
- Browser: Edge (WebView2)
- Version [e.g. 22
I've created a pull request but I have not tested the changes.
Let me know what you think.
Thanks @Hastaroth1! Great catch on the issue. I’ll review the pull request shortly.