EV3 Event Delegation
Note: I have no particular knowledge of how monobrick work.


You're never escaping the while (true) loop. The example you're pointing too use an event-based model, and it looks like you prefer a loop. This is what you want:



class R_Main  
{  
    public static void Main (string[] args)
    {  
        R_Main main = new R_Main ();
    }

    public R_Main()
    {

        var sensor = new EV3ColorSensor (SensorPort.In2);  
        bool continue = true;
        ButtonEvents buts = new ButtonEvents ();  
        buts.EscapePressed += () =&gt; {continue = false;};
        while (continue) 
        {

        }
    }         
} 


But depending on the internals of monobrick this might not work at all.