public bool DispatchKeyDownEvent(System.Windows.Forms.Keys ckey) { if (KeyDownEvent == null) { return(false); } bool ret = false; foreach (KeyDownEventDelegate del in KeyDownEvent.GetInvocationList()) { try { ret = del(ckey); } catch (Exception e) { ChiConsole.WriteError("Error calling console key handler", e); } if (ret == true) { break; } } return(ret); }