123456789101112131415161718192021222324252627282930313233343536373839404142 |
- using System;
- using static Terminal.Gui.NetEvents;
- namespace Terminal.Gui;
- internal class FakeMainLoop : IMainLoopDriver {
- public Action<ConsoleKeyInfo> KeyPressed;
- public FakeMainLoop (ConsoleDriver consoleDriver = null)
- {
- // No implementation needed for FakeMainLoop
- }
- public void Setup (MainLoop mainLoop)
- {
- // No implementation needed for FakeMainLoop
- }
- public void Wakeup ()
- {
- // No implementation needed for FakeMainLoop
- }
- public bool EventsPending ()
- {
- // Always return true for FakeMainLoop
- return true;
- }
- public void Iteration ()
- {
- if (FakeConsole.MockKeyPresses.Count > 0) {
- KeyPressed?.Invoke (FakeConsole.MockKeyPresses.Pop ());
- }
- }
- public void TearDown ()
- {
- }
- }
|