[Mono-dev] System.Console.CancelKeyPress

Robert Jordan robertj at gmx.net
Wed Oct 26 16:11:15 EDT 2005


Andy,

> System.Console.CancelKeyPress does not seem to be implemented yet.  Is
> there something I can do using Mono.Unix or otherwise to handle Cntl-C
> in a Linux Mono command line app?

Ignoring SIGINT (Ctrl-C) is the only operation you can do at present.

Rob

//
// compile with: mcs -r:Mono.Posix test.cs
//
using System;
using Mono.Unix.Native;

class Test
{
         static void Main ()
         {
                 Stdlib.signal (Signum.SIGINT, Stdlib.SIG_IGN);
                 Console.ReadLine ();
         }
}




More information about the Mono-devel-list mailing list