I want to use ctrl+c as input in console. I can disable the ctrl+c to terminate console. But i cannot use the ctrl+c to get input. how can i get the ctrl+c as input????
Console.CancelKeyPress += (object sender, ConsoleCancelEventArgs e) =>
{
var isctrlc = e.SpecialKey == ConsoleSpecialKey.ControlC;
if (isctrlc)
{
e.Cancel = true;
}
};
k = Console.ReadKey(true);
if((k.Modifiers & ConsoleModifiers.Control) != 0)
{
if((k.Key & ConsoleKey.C)!=0)
{
break;
}
}