From fde9c1bfb2e00cef2e0681a0ed03609696250e32 Mon Sep 17 00:00:00 2001 From: Kenneth Myhra Date: Sat, 19 Feb 2022 22:22:45 +0100 Subject: LibWeb: Add key code 'Esc' to ignored Keydown Events in EventHandler This filters out the key code 'Esc' so it won't be printed to editable text nodes, e.g. text elements. --- Userland/Libraries/LibWeb/Page/EventHandler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Userland/Libraries/LibWeb') diff --git a/Userland/Libraries/LibWeb/Page/EventHandler.cpp b/Userland/Libraries/LibWeb/Page/EventHandler.cpp index 5c19a40a40..e5c0f3abd4 100644 --- a/Userland/Libraries/LibWeb/Page/EventHandler.cpp +++ b/Userland/Libraries/LibWeb/Page/EventHandler.cpp @@ -439,7 +439,7 @@ bool EventHandler::focus_previous_element() constexpr bool should_ignore_keydown_event(u32 code_point) { // FIXME: There are probably also keys with non-zero code points that should be filtered out. - return code_point == 0; + return code_point == 0 || code_point == 27; } bool EventHandler::handle_keydown(KeyCode key, unsigned modifiers, u32 code_point) -- cgit v1.2.3