Filtering Input Character In Terminal

0 votes
asked Mar 22 by sp (160 points)

Good Morning,
How to introduce filtering of input data from a terminal connected to a serial port. I need to display some of the input data starting with # in another text box and the rest as normal in TerminalControl.
Thank You very much for help

1 Answer

0 votes
answered Mar 22 by Lukas Pokorny (124,570 points)

Hello,

Rebex Terminal API makes it possible to process incoming terminal data,
detect specific built-in or custom-defined events, and grab data from the terminal screen. Check out Scripting and Screen scraping for details, or try the TerminalScriptingWinForm sample.

However, from the wording of your question, it seems like you actually want to intercept some input data and prevent it from being displayed on the terminal. Unfortunately, that is not really a supported scenario. It might be possible to achieve something like that using a VirtualTerminal (which is basically a UI-less TerminalControl) to receive the data, and a separate TerminalControl to display parts of the received data, but I'm afraid that making this operational would still require a substantial amount of work.

commented Mar 22 by sp (160 points)
Thanks for help. Is there possiblity to override some method which interpret character in TerminalControl? I can check that character and put it something else.
Thank You
commented Mar 22 by Lukas Pokorny (124,570 points)
You might implement a custom IShellChannelFactory/ShellChannel that wraps the SerialPortChannel class and its CreateShellChannel method, and adds a filtering layer that wraps the ShellChannel class and intercepts Receive/Poll/Available calls. The AnsiPlayer sample (https://www.rebex.net/sample/ansi-player/) shows how to implement a custom IShellChannelFactory/ShellChannel, although not a filtering one, which would be a bit more complex.
...