1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 08:38:12 +00:00

LibGUI: Only reset GlyphMapWidget selection on Escape

and when using unmodified arrows.
This commit is contained in:
thankyouverycool 2022-12-17 13:12:15 -05:00 committed by Andreas Kling
parent 4c81fbc8c4
commit 673afffd5a
2 changed files with 10 additions and 1 deletions

View file

@ -263,7 +263,15 @@ void GlyphMapWidget::keydown_event(KeyEvent& event)
return;
}
if (!event.ctrl() && !event.shift() && event.key() != KeyCode::Key_Delete) {
if (event.key() == KeyCode::Key_Escape) {
m_selection.set_size(1);
m_selection.set_start(m_active_glyph);
if (on_escape_pressed)
on_escape_pressed();
return;
}
if (!event.modifiers() && event.is_arrow_key()) {
m_selection.set_size(1);
m_selection.set_start(m_active_glyph);
}