From 1847219cbfe5c42367e63359baf08d785d8d870c Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Fri, 28 Aug 2020 20:55:25 +0200 Subject: [PATCH] LibGUI: Let's make F2 the standard "edit key" This matches what other systems do, and allows Return to become the unambiguous "activation key" instead. :^) --- Libraries/LibGUI/TableView.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/Libraries/LibGUI/TableView.cpp b/Libraries/LibGUI/TableView.cpp index d6b12c0f3d..ba70c64259 100644 --- a/Libraries/LibGUI/TableView.cpp +++ b/Libraries/LibGUI/TableView.cpp @@ -165,11 +165,17 @@ void TableView::keydown_event(KeyEvent& event) { if (!model()) return; - if (event.key() == KeyCode::Key_Return) { - if (is_editable() && edit_triggers() & EditTrigger::EditKeyPressed) + + if (event.key() == KeyCode::Key_F2) { + if (is_editable() && edit_triggers() & EditTrigger::EditKeyPressed) { begin_editing(cursor_index()); - else - activate(cursor_index()); + event.accept(); + return; + } + } + + if (event.key() == KeyCode::Key_Return) { + activate(cursor_index()); return; }