How can I disable user input on mac console app C#?

90 views Asked by At

I'm trying to develop a console application for macOs that displays characters with a small delay in between each character, like if someone was typing the lines in the console.

I want to disable the user input while the message is being typed, but I can't figure out how to do it:

static void WriteToConsoleWithDelay(string msg, int delay = 75)
    {
        var e = msg.GetEnumerator();

        while (e.MoveNext())
        {
            var c = e.Current;
            Console.Write(c.ToString());
            Thread.Sleep(totalDelay);
        }
        Console.WriteLine();
    }
1

There are 1 answers

1
jeydevv On