Pokered Save Editor 2
Pokemon Red & Blue save file editor - Qt 6 C++/QML
Loading...
Searching...
No Matches
shortcutdefs.h File Reference

Single source of truth for the global keyboard shortcut KEY SEQUENCES. More...

#include <QHash>
#include <QString>
#include <QKeySequence>
#include <Qt>
#include <functional>
#include <pse-savefile/filemanagement.h>
#include <pse-savefile/savefile.h>
Include dependency graph for shortcutdefs.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  pse

Functions

QHash< QString, QKeySequence > pse::shortcutKeyMap ()
 Named global shortcuts: action id -> key sequence.
QKeySequence pse::recentFileShortcutKey (int i)
 Recent-file shortcut i (0..MAX_RECENT_FILES-1) == Ctrl+Shift+(0+i), i.e.
QHash< QString, std::function< void()> > pse::shortcutActions (FileManagement *file, std::function< void()> onExit)
 What each named shortcut DOES, action id -> callable, over a live FileManagement.

Detailed Description

Single source of truth for the global keyboard shortcut KEY SEQUENCES.

MainWindow::setupShortcuts() builds its QShortcuts from this map (and wires each named action to its FileManagement verb), and tst_shortcuts asserts the map against the documented bindings + checks for accidental duplicates/rebinds. Keeping the keys here (header-only, in appcore's include root) lets the test see exactly what the window uses, so a typo or a clashing rebind is caught.

Only the KEY SEQUENCES live here – the action→verb wiring stays in MainWindow (it needs the live FileManagement instance).

Definition in file shortcutdefs.h.