From c07d2127a90afcb892b82193b37c1661ac48b02b Mon Sep 17 00:00:00 2001 From: denisabt Date: Wed, 23 Oct 2024 20:44:12 +0200 Subject: [PATCH] Fix: pressing escape while Alt-Tabbing (thus cancelling Alt-Tabbing) hiding Hass.Agent Window. (#161) * Fixes pressing escape while Alt-Tabbing (thus cancelling Alt-Tabbing) hiding Hass.Agent Window. Issue #157 --- src/HASS.Agent/HASS.Agent/Forms/Main.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/HASS.Agent/HASS.Agent/Forms/Main.cs b/src/HASS.Agent/HASS.Agent/Forms/Main.cs index 0f8467f..84408a6 100644 --- a/src/HASS.Agent/HASS.Agent/Forms/Main.cs +++ b/src/HASS.Agent/HASS.Agent/Forms/Main.cs @@ -766,6 +766,10 @@ private void Main_KeyUp(object sender, KeyEventArgs e) { if (e.KeyCode != Keys.Escape) return; + + // Escape Pressed, but make sure it's not escape while alt-tabbing + if (e.Alt) return; + Hide(); }