From ea2ffdfd0ea2ad377d0d8aad870f23d0c0b9291d Mon Sep 17 00:00:00 2001 From: Lucas CHOLLET Date: Sun, 9 Jul 2023 14:32:46 -0400 Subject: [PATCH] LibGUI: Bubble up Key_Escape if no hook is plugged in TextEditor The TextEditor widget was always accepting the Key_Escape event even if the `on_escape_pressed` was empty. In other words, it was discarding the event. This behavior prevented shortcuts to be activated at a higher level. --- Userland/Libraries/LibGUI/TextEditor.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Userland/Libraries/LibGUI/TextEditor.cpp b/Userland/Libraries/LibGUI/TextEditor.cpp index e337fd561c..4d9c181eaa 100644 --- a/Userland/Libraries/LibGUI/TextEditor.cpp +++ b/Userland/Libraries/LibGUI/TextEditor.cpp @@ -1077,6 +1077,8 @@ void TextEditor::keydown_event(KeyEvent& event) if (event.key() == KeyCode::Key_Escape) { if (on_escape_pressed) on_escape_pressed(); + else + event.ignore(); return; }