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.
This commit is contained in:
LuK1337 2021-07-12 16:04:41 +02:00 committed by Andreas Kling
parent d8ff46594a
commit 62c5a5351c
Notes: sideshowbarker 2024-07-18 09:06:35 +09:00

View File

@ -54,7 +54,7 @@ void Dialog::done(int result)
void Dialog::event(Core::Event& event) 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<KeyEvent&>(event); auto& key_event = static_cast<KeyEvent&>(event);
if (key_event.key() == KeyCode::Key_Escape) { if (key_event.key() == KeyCode::Key_Escape) {
done(ExecCancel); done(ExecCancel);