diff --git a/CliFx/Infrastructure/FakeConsole.cs b/CliFx/Infrastructure/FakeConsole.cs index 9f21109..cbe7639 100644 --- a/CliFx/Infrastructure/FakeConsole.cs +++ b/CliFx/Infrastructure/FakeConsole.cs @@ -84,13 +84,18 @@ namespace CliFx.Infrastructure _cancellationTokenSource.Cancel(); } } - + /// public void Clear() { } + /// + public void ReadKey(bool intercept = false) + { + } + /// public virtual void Dispose() => _cancellationTokenSource.Dispose(); } -} \ No newline at end of file +} diff --git a/CliFx/Infrastructure/IConsole.cs b/CliFx/Infrastructure/IConsole.cs index affe574..eb79f2a 100644 --- a/CliFx/Infrastructure/IConsole.cs +++ b/CliFx/Infrastructure/IConsole.cs @@ -87,6 +87,11 @@ namespace CliFx.Infrastructure /// Clears the console buffer and corresponding console window of display information. /// void Clear(); + + /// + /// Obtains the next character or function key pressed by the user. + /// + void ReadKey(bool intercept = false); } /// @@ -131,4 +136,4 @@ namespace CliFx.Infrastructure console.WithBackgroundColor(backgroundColor) ); } -} \ No newline at end of file +} diff --git a/CliFx/Infrastructure/SystemConsole.cs b/CliFx/Infrastructure/SystemConsole.cs index 322feaf..fb04152 100644 --- a/CliFx/Infrastructure/SystemConsole.cs +++ b/CliFx/Infrastructure/SystemConsole.cs @@ -89,10 +89,13 @@ namespace CliFx.Infrastructure return (_cancellationTokenSource = cts).Token; } - + /// public void Clear() => Console.Clear(); + /// + public void ReadKey(bool intercept = false) => Console.ReadKey(intercept); + /// public void Dispose() { @@ -103,4 +106,4 @@ namespace CliFx.Infrastructure Error.Dispose(); } } -} \ No newline at end of file +}