1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 19:07:35 +00:00

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 <input> elements.
This commit is contained in:
Kenneth Myhra 2022-02-19 22:22:45 +01:00 committed by Andreas Kling
parent 8a168b2bc0
commit fde9c1bfb2

View file

@ -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)