NetInputProcessor.cs 737 B

123456789101112131415161718192021222324
  1. using System.Collections.Concurrent;
  2. namespace Terminal.Gui.Drivers;
  3. /// <summary>
  4. /// Input processor for <see cref="NetInput"/>, deals in <see cref="ConsoleKeyInfo"/> stream
  5. /// </summary>
  6. public class NetInputProcessor : InputProcessorImpl<ConsoleKeyInfo>
  7. {
  8. /// <inheritdoc/>
  9. public NetInputProcessor (ConcurrentQueue<ConsoleKeyInfo> inputBuffer) : base (inputBuffer, new NetKeyConverter ())
  10. {
  11. DriverName = "dotnet";
  12. }
  13. /// <inheritdoc/>
  14. protected override void Process (ConsoleKeyInfo input)
  15. {
  16. foreach (Tuple<char, ConsoleKeyInfo> released in Parser.ProcessInput (Tuple.Create (input.KeyChar, input)))
  17. {
  18. ProcessAfterParsing (released.Item2);
  19. }
  20. }
  21. }