| Posted: 12:48pm 31 Mar 2025 |
|
|
|
Don't know, if this is the right thread for this idea?:
In an other thread, somebody had the wish, to be able to have the console-output to appear simultaneously on a secondary device.. E.g. on the LCD and a COM port..
Perhaps it would be possible, to implement the ability, to have a "console output callback" which, if existant, would be called on every character?
The callback should return the char(s) to be "printed" on the "standard console". If complete "redirection" would be active, the callback would return always a "" as result.
Something like this:
FUNCTION MM.OnConsoleOut$(ByVal OutChar$ As String) As String ' Minimal trivial implementation, a NOP ! MM.OnConsoleOut$ = OutChar$ END FUNCTION
Such a callback would give the ability, to "filter" ("translate") the output stream, interpret e.g. VT100 ESC sequences, dublicate/mirror the output stream, ...
Of course the implementation should be done in a way, that has minimal impact on the output speed, especially if no callback is installed/present.
bfwolf
Edit: Just remembered and read in the manual: There already exists the "sister" for this functionality, to "filter" the console input stream:
ON KEY target or ON KEY ASCIIcode, target
So perhaps it could be done in the same manner:
ON CONOUT target Edited 2025-03-31 23:10 by bfwolf |