using System.Collections.Concurrent;
namespace Terminal.Gui.Drivers;
///
/// Input processor for , deals in stream.
///
internal class UnixInputProcessor : InputProcessor
{
///
public UnixInputProcessor (ConcurrentQueue inputBuffer) : base (inputBuffer, new UnixKeyConverter ())
{
DriverName = "Unix";
}
///
protected override void Process (char input)
{
foreach (Tuple released in Parser.ProcessInput (Tuple.Create (input, input)))
{
ProcessAfterParsing (released.Item2);
}
}
///
protected override void ProcessAfterParsing (char input)
{
var key = KeyConverter.ToKey (input);
// If the key is not valid, we don't want to raise any events.
if (IsValidInput (key, out key))
{
OnKeyDown (key);
OnKeyUp (key);
}
}
}