summaryrefslogtreecommitdiff
path: root/Libraries/LibGUI
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-08-28 20:55:25 +0200
committerAndreas Kling <kling@serenityos.org>2020-08-28 20:55:25 +0200
commit1847219cbfe5c42367e63359baf08d785d8d870c (patch)
treea2ea606f5d2c54d8e59222768e9c8b271d3800e0 /Libraries/LibGUI
parent12dfeb984504442b4e41e857e05d4bfeffa80e13 (diff)
downloadserenity-1847219cbfe5c42367e63359baf08d785d8d870c.zip
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. :^)
Diffstat (limited to 'Libraries/LibGUI')
-rw-r--r--Libraries/LibGUI/TableView.cpp14
1 files 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;
}