mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2025-12-30 01:38:01 +01:00
Mostly working for NetDriver
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user