private void MaterialEditor_KeyDown(object sender, KeyEventArgs e) { var materialEditor = (frmMaterialEditor)sender; if (e.KeyCode == Keys.Escape) { materialEditor.Close(); //here parent OnEscKeyPressed.Invoke(materialEditor, null); } }
void Update() { if (Input.GetKeyDown(KeyCode.F)) { OnFKeyPressed?.Invoke(); } if (Input.GetKeyDown(KeyCode.Escape)) { OnEscKeyPressed?.Invoke(); } }
private static void PrintJobProperties_OnEscKeyPressed(object sender, EventArgs e) { OnEscKeyPressed.Invoke(sender, e); }