From 62c5a5351c6828732ebe123f8aec285466245049 Mon Sep 17 00:00:00 2001 From: LuK1337 Date: Mon, 12 Jul 2021 16:04:41 +0200 Subject: [PATCH] LibGUI: Handle KeyDown when checking for Key_Escape in Dialog too This makes 'escaping' the dialogs seem bit faster :^) It also follows what RunWindow and probably others do. --- Userland/Libraries/LibGUI/Dialog.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Libraries/LibGUI/Dialog.cpp b/Userland/Libraries/LibGUI/Dialog.cpp index 314c534f51c..adf5fa9f007 100644 --- a/Userland/Libraries/LibGUI/Dialog.cpp +++ b/Userland/Libraries/LibGUI/Dialog.cpp @@ -54,7 +54,7 @@ void Dialog::done(int result) void Dialog::event(Core::Event& event) { - if (event.type() == Event::KeyUp) { + if (event.type() == Event::KeyUp || event.type() == Event::KeyDown) { auto& key_event = static_cast(event); if (key_event.key() == KeyCode::Key_Escape) { done(ExecCancel);