Mostly working for NetDriver

This commit is contained in:
tznind
2024-10-13 13:54:39 +01:00
parent effe1991e3
commit 563eace487

View File

@@ -407,6 +407,8 @@ internal class NetEvents : IDisposable
return true;
}
public AnsiResponseParser Parser { get; private set; } = new ();
// Process a CSI sequence received by the driver (key pressed, mouse event, or request/response event)
private void ProcessRequestResponse (
ref ConsoleKeyInfo newConsoleKeyInfo,
@@ -415,6 +417,16 @@ internal class NetEvents : IDisposable
ref ConsoleModifiers mod
)
{
if (cki != null)
{
// If the response is fully consumed by parser
if(cki.Length > 1 && string.IsNullOrEmpty(Parser.ProcessInput (new string(cki.Select (k=>k.KeyChar).ToArray ()))))
{
// Lets not double process
return;
}
}
// isMouse is true if it's CSI<, false otherwise
EscSeqUtils.DecodeEscSeq (
EscSeqRequests,
@@ -1036,6 +1048,15 @@ internal class NetDriver : ConsoleDriver
}
}
/// <inheritdoc />
public override IAnsiResponseParser GetParser () => _mainLoopDriver._netEvents.Parser;
/// <inheritdoc />
public override void RawWrite (string str)
{
Console.Write (str);
}
internal override void End ()
{
if (IsWinPlatform)