I wrote this code for a console calculator to get math operations from the user and do it and now I want to read my keyboards key like Escape in my program while it is run, and at the same time as the input of a string for operating.
       string func, funcText;
        do
        {
            funcText = Console.ReadLine();
            if (funcText.ToLower() == "esc")
                calculator.calculate();
           Console.WriteLine( math(funcText));
        } while (true);