mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-02-20 22:55:03 +00:00
LibGUI: Move editing key handling up to AbstractView
We want all views to respond to the editing key as long as the relevant edit trigger is activated.
This commit is contained in:
@@ -447,6 +447,14 @@ void AbstractView::set_edit_triggers(unsigned triggers)
|
||||
|
||||
void AbstractView::keydown_event(KeyEvent& event)
|
||||
{
|
||||
if (event.key() == KeyCode::Key_F2) {
|
||||
if (is_editable() && edit_triggers() & EditTrigger::EditKeyPressed) {
|
||||
begin_editing(cursor_index());
|
||||
event.accept();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
SelectionUpdate selection_update = SelectionUpdate::Set;
|
||||
if (event.modifiers() == KeyModifier::Mod_Shift) {
|
||||
selection_update = SelectionUpdate::Shift;
|
||||
|
||||
Reference in New Issue
Block a user