From eb56cf5bb04771244f7bb90eadef165ccc5b9a94 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Mon, 3 Aug 2026 20:52:17 +0200 Subject: keymap: register complete_query bound to Ctrl+Space KeyMap::defaultBindings() is the single source of truth for shortcuts: the menus, the shortcut reference dialog and loadDefaults() all read it, so registering here makes the binding appear in the reference and stay rebindable from [keys] without any of them disagreeing. Ctrl+Space is a modifier plus a named key, so it sidesteps the bare capital trap in normalizeSequence() and needs no Shift on any layout. Verified it parses to a single non-empty combination that round-trips to "Ctrl+Space", and it collides with no existing default. Note test_mainwindow now fails its everyKnownActionIsRegistered() assertion: MainWindow does not yet implement complete_query. That wiring is a separate task, and the assertion firing is the intended signal. --- src/keymap.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/keymap.cpp') diff --git a/src/keymap.cpp b/src/keymap.cpp index 22c8da1..d8aacc5 100644 --- a/src/keymap.cpp +++ b/src/keymap.cpp @@ -33,6 +33,7 @@ QStringList KeyMap::knownActions() QStringLiteral("toggle_unread"), QStringLiteral("flag"), QStringLiteral("focus_query"), + QStringLiteral("complete_query"), QStringLiteral("toggle_html"), QStringLiteral("load_remote"), QStringLiteral("zoom_in"), @@ -64,6 +65,10 @@ QList> KeyMap::defaultBindings() { QStringLiteral("Ctrl+U"), QStringLiteral("toggle_unread") }, { QStringLiteral("Ctrl+I"), QStringLiteral("flag") }, { QStringLiteral("Ctrl+L"), QStringLiteral("focus_query") }, + // Ctrl+Space is the completion idiom users already carry over from + // shells and editors, and it is a named key rather than a symbol, so + // no layout has to shift it. + { QStringLiteral("Ctrl+Space"), QStringLiteral("complete_query") }, { QStringLiteral("Ctrl+H"), QStringLiteral("toggle_html") }, { QStringLiteral("Ctrl+M"), QStringLiteral("load_remote") }, // Ctrl++ is what the '+' key really delivers on a layout where '+' is -- cgit v1.2.3