diff options
author | Andreas Kling <kling@serenityos.org> | 2020-08-28 20:55:25 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-08-28 20:55:25 +0200 |
commit | 1847219cbfe5c42367e63359baf08d785d8d870c (patch) | |
tree | a2ea606f5d2c54d8e59222768e9c8b271d3800e0 /Libraries/LibGUI | |
parent | 12dfeb984504442b4e41e857e05d4bfeffa80e13 (diff) | |
download | serenity-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.cpp | 14 |
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; } |