mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 14:17:36 +00:00
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.
This commit is contained in:
parent
201890e109
commit
ea2ffdfd0e
1 changed files with 2 additions and 0 deletions
|
@ -1077,6 +1077,8 @@ void TextEditor::keydown_event(KeyEvent& event)
|
||||||
if (event.key() == KeyCode::Key_Escape) {
|
if (event.key() == KeyCode::Key_Escape) {
|
||||||
if (on_escape_pressed)
|
if (on_escape_pressed)
|
||||||
on_escape_pressed();
|
on_escape_pressed();
|
||||||
|
else
|
||||||
|
event.ignore();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue